-
Notifications
You must be signed in to change notification settings - Fork 11
chore: fix linting errors #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
c93eb00
2856f0c
4eac657
954297c
c8cd6e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
const rules = require('@netlify/eslint-config-node/.prettierrc.json') | ||
|
||
module.exports = { | ||
...require("@netlify/eslint-config-node/.prettierrc.json"), | ||
endOfLine: "auto", | ||
...rules, | ||
endOfLine: 'auto', | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import _ from "lodash" | ||
import _ from 'lodash' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One day we should see if we can remove lodash. The gatsby codebase is littered with pointless use of it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call. I've added a draft ticket to the board. |
||
|
||
// Gatsby values | ||
export const BUILD_HTML_STAGE = `build-html` | ||
|
@@ -7,17 +7,19 @@ export const BUILD_CSS_STAGE = `build-css` | |
// Plugin values | ||
export const NETLIFY_HEADERS_FILENAME = `_headers` | ||
|
||
// Default options including transform to manipulate headers for | ||
// sorting and rewrites for client only paths | ||
export const DEFAULT_OPTIONS = { | ||
headers: {}, | ||
mergeSecurityHeaders: true, | ||
mergeLinkHeaders: true, | ||
mergeCachingHeaders: true, | ||
transformHeaders: _.identity, // optional transform for manipulating headers for sorting, etc | ||
generateMatchPathRewrites: true, // generate rewrites for client only paths | ||
transformHeaders: _.identity, | ||
generateMatchPathRewrites: true, | ||
} | ||
|
||
export const SECURITY_HEADERS = { | ||
"/*": [ | ||
'/*': [ | ||
`X-Frame-Options: DENY`, | ||
`X-XSS-Protection: 1; mode=block`, | ||
`X-Content-Type-Options: nosniff`, | ||
|
@@ -28,8 +30,8 @@ export const SECURITY_HEADERS = { | |
export const IMMUTABLE_CACHING_HEADER = `Cache-Control: public, max-age=31536000, immutable` | ||
|
||
export const CACHING_HEADERS = { | ||
"/static/*": [IMMUTABLE_CACHING_HEADER], | ||
"/sw.js": [`Cache-Control: no-cache`], | ||
'/static/*': [IMMUTABLE_CACHING_HEADER], | ||
'/sw.js': [`Cache-Control: no-cache`], | ||
} | ||
|
||
export const LINK_REGEX = /^(Link: <\/)(.+)(>;.+)/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably best to add a general override, disabling this for all test files, like we've done in the build plugins: https://github.com/netlify/netlify-plugin-gatsby/blob/main/.eslintrc.js#L21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks. I was trying to do this by adding another .eslintrc file to the test folder, but couldn't figure out a neat way to get Jest to ignore it. This is a much better solution.