-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve(eslint) modularize eslint configs (#899)
- Loading branch information
1 parent
0a0b8b6
commit d41d755
Showing
22 changed files
with
156 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,6 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['eslint:recommended'], | ||
env: { | ||
node: true, | ||
es6: true, | ||
amd: true, | ||
browser: true, | ||
jquery: true, | ||
}, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
experimentalObjectRestSpread: true, | ||
globalReturn: true, | ||
generators: false, | ||
impliedStrict: true, | ||
objectLiteralDuplicateProperties: false, | ||
}, | ||
ecmaVersion: 2017, | ||
sourceType: 'module', | ||
}, | ||
plugins: ['import'], | ||
settings: { | ||
'import/core-modules': [], | ||
'import/ignore': [ | ||
'node_modules', | ||
'\\.(coffee|scss|css|less|hbs|svg|json)$', | ||
], | ||
}, | ||
rules: { | ||
'no-console': 0, | ||
'comma-dangle': [ | ||
'error', | ||
{ | ||
arrays: 'always-multiline', | ||
objects: 'always-multiline', | ||
imports: 'always-multiline', | ||
exports: 'always-multiline', | ||
functions: 'ignore', | ||
}, | ||
], | ||
}, | ||
extends: [ | ||
require.resolve('@roots/bud-preset-recommend/eslint-config'), | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
require.resolve('@roots/bud-preset-recommend/eslint-config'), | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['@roots/sage/eslint-config'], | ||
extends: [require.resolve('@roots/sage/eslint-config')], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
require.resolve('@roots/bud-preset-wordpress/eslint-config'), | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Babel default eslint config | ||
* | ||
* @public | ||
*/ | ||
module.exports = { | ||
parser: '@babel/eslint-parser', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
experimentalObjectRestSpread: true, | ||
globalReturn: true, | ||
generators: false, | ||
impliedStrict: true, | ||
jsx: true, | ||
objectLiteralDuplicateProperties: false, | ||
}, | ||
ecmaVersion: 2017, | ||
requireConfigFile: false, | ||
sourceType: 'module', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Default eslint config | ||
* | ||
* @public | ||
*/ | ||
module.exports = { | ||
extends: ['eslint:recommended'], | ||
env: { | ||
browser: true, | ||
es6: true, | ||
node: true, | ||
}, | ||
plugins: ['import'], | ||
settings: { | ||
'import/core-modules': [], | ||
'import/ignore': [ | ||
'node_modules', | ||
'\\.(coffee|scss|css|less|hbs|svg|json)$', | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/@roots/bud-preset-recommend/eslint-config/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Recommended preset default eslint config | ||
* | ||
* @public | ||
*/ | ||
module.exports = { | ||
extends: [ | ||
require.resolve('@roots/bud-eslint/eslint-config'), | ||
require.resolve('@roots/bud-babel/eslint-config'), | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/@roots/bud-preset-wordpress/eslint-config/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* WordPress preset default eslint config | ||
* | ||
* @public | ||
*/ | ||
module.exports = { | ||
extends: [ | ||
require.resolve('@roots/bud-preset-recommend/eslint-config'), | ||
require.resolve('@roots/bud-react/eslint-config'), | ||
], | ||
env: {jquery: true}, | ||
globals: {wp: true}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* Prettier default eslint config | ||
* | ||
* @public | ||
*/ | ||
module.exports = { | ||
extends: ['plugin:prettier/recommended'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* React default eslint config | ||
* | ||
* @public | ||
*/ | ||
module.exports = { | ||
extends: ['plugin:react/recommended'], | ||
plugins: ['react-hooks', 'jsx-a11y'], | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.