-
Notifications
You must be signed in to change notification settings - Fork 405
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
refactor: updated eslint devDepencencies #1306
base: dev
Are you sure you want to change the base?
Changes from 100 commits
26db979
7812878
271dc8d
ccdf238
4c2070f
117ca22
4f5bff6
73df9d3
9115c17
e86272f
a243f5d
3238ac7
7f4ba39
f7b514b
37f9749
572afec
e4a5245
4aa9366
155c253
3b95604
6b4a6fb
6431987
d486051
be17657
6c18bdc
2e802d6
f13c69a
e77cd03
c352ce9
99dfe5f
4e8ab16
5584d12
b52e833
3f08102
84a3bbc
e20aca5
d1883eb
239a2b3
0a856f7
46eb7dc
f75705f
6e333ad
77238e7
e4cf179
250620a
67d70c9
8cba4a3
ed5c10c
819a9d4
25f7628
a456d97
0f22311
13b014f
44a4460
239b1d1
90a2074
ce0dedd
7584b93
2dc4ce1
e536cb2
0869a50
309138d
97543d4
f4fd4dd
fa140cf
2a15f56
9b60cf2
51c1d00
4617540
5ffb32a
688ced6
f9e5b0e
e3524db
5426328
ced1a85
20d3573
47d0fad
fbf5f46
a5a5166
da469b9
82a52f0
8249a87
9e3ffc6
e75fb79
0593efe
0b380a1
157a78c
7a748ff
b671804
c691cc2
7b75735
41f4ae7
9bde632
2e6cafa
9173c1b
ea18664
3fb60d3
a85cf4b
4138cb2
d2722a4
66bfaec
da6da4d
b14290f
29444dc
8198b2e
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 |
---|---|---|
|
@@ -6,7 +6,8 @@ module.exports = { | |
es6: true, | ||
browser: true, | ||
}, | ||
parser: 'babel-eslint', | ||
parser: '@babel/eslint-parser', | ||
// TODO: Check for "Note: The parserOptions described in the official documentation are for the default parser and are not necessarily supported by @babel/eslint-parser. Please see the section directly below for supported parserOptions.": https://www.npmjs.com/package/@babel/eslint-parser | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
|
@@ -17,8 +18,9 @@ module.exports = { | |
}, | ||
}, | ||
globals: {}, | ||
plugins: ['prettier'], | ||
extends: ['eslint-config-prettier'].map(require.resolve), | ||
plugins: ['@babel', 'prettier'], | ||
extends: ['plugin:prettier/recommended'], | ||
// TODO: Check for "ESLint rules relating to code formatting", compare to "This plugin works best if you disable all other ESLint rules relating to code formatting, and only enable rules that detect potential bugs. (If another active ESLint rule disagrees with prettier about how code should be formatted, it will be impossible to avoid lint errors.)", source: https://github.com/prettier/eslint-plugin-prettier#recommended-configuration | ||
rules: { | ||
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. Check for "ESLint rules relating to code formatting", compare to "This plugin works best if you disable all other ESLint rules relating to code formatting, and only enable rules that detect potential bugs. (If another active ESLint rule disagrees with prettier about how code should be formatted, it will be impossible to avoid lint errors.) You can use eslint-config-prettier to disable all formatting-related ESLint rules.", source: https://github.com/prettier/eslint-plugin-prettier#recommended-configuration |
||
'prettier/prettier': 'error', | ||
'block-scoped-var': 0, | ||
|
@@ -27,7 +29,7 @@ module.exports = { | |
curly: [2, 'all'], | ||
'dot-notation': [1, { allowKeywords: true }], | ||
eqeqeq: [2, 'allow-null'], | ||
'global-strict': [0, 'never'], | ||
'strict': [0, 'never'], | ||
'guard-for-in': 2, | ||
'key-spacing': 0, | ||
'new-cap': 0, | ||
|
@@ -49,9 +51,9 @@ module.exports = { | |
'no-irregular-whitespace': 1, | ||
'no-iterator': 2, | ||
'no-loop-func': 2, | ||
'no-mixed-requires': 0, | ||
'node/no-mixed-requires': 0, | ||
'no-multi-str': 2, | ||
'no-native-reassign': 2, | ||
'no-global-assign': 2, | ||
'no-new': 2, | ||
'no-param-reassign': 1, | ||
'no-proto': 2, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": "../../babel.config.js" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": "../../babel.config.js" } |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,30 +36,6 @@ const server = (patternlab) => { | |
patternlab.config.paths.public.root | ||
) | ||
); | ||
defaults.assets = [ | ||
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. I know this is an old PR which is still WIP, but could you elaborate why this gets removed when the PR only is about ESLint changes? |
||
path.resolve( | ||
path.join( | ||
process.cwd(), | ||
patternlab.config.paths.source.js, | ||
'**', | ||
'*.js' // prevent preprocessors like typescript from reloading | ||
) | ||
), | ||
path.resolve( | ||
path.join(process.cwd(), patternlab.config.paths.source.images) | ||
), | ||
path.resolve( | ||
path.join(process.cwd(), patternlab.config.paths.source.fonts) | ||
), | ||
path.resolve( | ||
path.join( | ||
process.cwd(), | ||
patternlab.config.paths.source.css, | ||
'**', | ||
'*.css' // prevent preprocessors from reloading | ||
) | ||
), | ||
]; | ||
|
||
// allow for overrides should they exist inside patternlab-config.json | ||
const liveServerConfig = Object.assign( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ function serve() { | |
return patternlab.server | ||
.serve({ | ||
cleanPublic: config.cleanPublic, | ||
watch: true, | ||
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. Same goes for the removal of this line |
||
}) | ||
.then(() => { | ||
// do something else when this promise resolves | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
env: { | ||
node: true, | ||
}, | ||
rules: { | ||
quotes: 0, | ||
curly: 0, | ||
strict: 0, | ||
'node/no-process-exit': 0, | ||
eqeqeq: 1, | ||
'no-unused-vars': 1, | ||
'no-shadow': 1, | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,7 @@ module.exports = function (apiConfig) { | |
], | ||
], | ||
plugins: [ | ||
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. From what I understand, we should even also be able to move those to the |
||
// TODO: From what I understand, we should even also be able to move those to the babel.config.js in root, to align both linting and building here | ||
'@babel/plugin-proposal-optional-chaining', | ||
['@babel/plugin-proposal-decorators', { legacy: true }], | ||
['@babel/plugin-proposal-class-properties', { loose: true }], | ||
|
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.
Check for "Note: The
parserOptions
described in the official documentation are for the default parser and are not necessarily supported by@babel/eslint-parser
. Please see the section directly below for supported parserOptions.": https://www.npmjs.com/package/@babel/eslint-parser