-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #911 from storybooks/eslint-strict
Set ESlint rules more strict 🚑
- Loading branch information
Showing
254 changed files
with
2,865 additions
and
1,998 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const error = 2; | ||
const warn = 1; | ||
const ignore = 0; | ||
|
||
module.exports = { | ||
root: true, | ||
extends: ['eslint-config-airbnb', 'plugin:jest/recommended', 'prettier'], | ||
plugins: ['prettier', 'jest', 'react'], | ||
parser: 'babel-eslint', | ||
parserOptions: { | ||
sourceType: 'module', | ||
}, | ||
env: { | ||
es6: true, | ||
node: true, | ||
'jest/globals': true, | ||
}, | ||
globals: { | ||
storiesOf: true, | ||
addonAPI: true, | ||
__DEV__: true, | ||
fetch: true, | ||
}, | ||
rules: { | ||
strict: [error, 'never'], | ||
'prettier/prettier': [ | ||
warn, | ||
{ | ||
printWidth: 100, | ||
tabWidth: 2, | ||
bracketSpacing: true, | ||
trailingComma: 'es5', | ||
singleQuote: true, | ||
}, | ||
], | ||
'no-console': ignore, | ||
'global-require': ignore, | ||
quotes: [warn, 'single'], | ||
'no-unused-vars': ignore, | ||
'class-methods-use-this': ignore, | ||
'arrow-parens': [warn, 'as-needed'], | ||
'space-before-function-paren': ignore, | ||
'import/no-unresolved': ignore, | ||
'import/extensions': ignore, | ||
'import/no-extraneous-dependencies': ignore, | ||
'import/prefer-default-export': ignore, | ||
'react/prop-types': ignore, | ||
'react/jsx-wrap-multilines': ignore, | ||
'react/jsx-uses-react': error, | ||
'react/jsx-uses-vars': error, | ||
'react/react-in-jsx-scope': ignore, | ||
'react/jsx-filename-extension': ignore, | ||
'jsx-a11y/accessible-emoji': ignore, | ||
'react/no-unescaped-entities': ignore, | ||
}, | ||
}; |
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,29 +1,68 @@ | ||
const error = 2; | ||
const warn = 1; | ||
const ignore = 0; | ||
|
||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'./node_modules/eslint-config-airbnb-base/rules/es6.js', | ||
], | ||
plugins: [ | ||
'prettier', | ||
], | ||
extends: ['eslint-config-airbnb', 'plugin:jest/recommended', 'prettier'], | ||
plugins: ['prettier', 'jest', 'react', 'json'], | ||
parser: 'babel-eslint', | ||
parserOptions: { | ||
sourceType: 'module', | ||
}, | ||
env: { | ||
es6: true, | ||
node: true, | ||
'jest/globals': true, | ||
}, | ||
rules: { | ||
strict: 0, | ||
'prettier/prettier': ['warn', { | ||
printWidth: 100, | ||
tabWidth: 2, | ||
bracketSpacing: true, | ||
trailingComma: 'es5', | ||
singleQuote: true, | ||
}], | ||
quotes: ['warn', 'single'], | ||
'arrow-parens': ['warn', 'as-needed'], | ||
strict: [error, 'never'], | ||
'prettier/prettier': [ | ||
warn, | ||
{ | ||
printWidth: 100, | ||
tabWidth: 2, | ||
bracketSpacing: true, | ||
trailingComma: 'es5', | ||
singleQuote: true, | ||
}, | ||
], | ||
quotes: [warn, 'single'], | ||
'class-methods-use-this': ignore, | ||
'arrow-parens': [warn, 'as-needed'], | ||
'space-before-function-paren': ignore, | ||
'import/no-unresolved': warn, | ||
'import/extensions': [ | ||
warn, | ||
{ | ||
js: 'never', | ||
json: 'always', | ||
}, | ||
], | ||
'import/no-extraneous-dependencies': [ | ||
warn, | ||
{ | ||
devDependencies: [ | ||
'**/*.test.js', | ||
'**/scripts/*.js', | ||
'**/stories/*.js', | ||
'**/__tests__/*.js', | ||
], | ||
peerDependencies: true, | ||
}, | ||
], | ||
'import/prefer-default-export': ignore, | ||
'react/jsx-wrap-multilines': ignore, | ||
'react/jsx-uses-react': error, | ||
'react/jsx-uses-vars': error, | ||
'react/react-in-jsx-scope': error, | ||
'react/jsx-filename-extension': [ | ||
warn, | ||
{ | ||
extensions: ['.js', '.jsx'], | ||
}, | ||
], | ||
'jsx-a11y/accessible-emoji': ignore, | ||
'react/no-unescaped-entities': ignore, | ||
}, | ||
} | ||
}; |
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,25 @@ | ||
module.exports = { | ||
plugins: [ | ||
'remark-preset-lint-recommended', | ||
['remark-lint-list-item-indent', false], | ||
[ | ||
'remark-lint-code', | ||
{ | ||
js: { | ||
module: 'node_modules/remark-lint-code-eslint', | ||
options: { | ||
fix: true, | ||
configFile: '.eslintrc-markdown.js', | ||
}, | ||
}, | ||
}, | ||
], | ||
[ | ||
'remark-toc', | ||
{ | ||
tight: true, | ||
maxDepth: 3, | ||
}, | ||
], | ||
], | ||
}; |
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
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
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.