-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
71 lines (69 loc) · 2.5 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const ignoreExports = [
'.eslintrc.js',
'app/script.js',
'app/script.test.js',
'commitlint.config.js',
'test/About.test.js',
'truffle-config.js',
// TODO: Fix index exports
'**/index.js',
]
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
},
extends: [
'standard', 'standard-react',
'eslint:recommended',
'plugin:import/errors',
'plugin:react/recommended', // will import plugin and enable jsx in parser options
'plugin:jsx-a11y/recommended',
],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
},
plugins: [ 'react-hooks', 'sort-keys-fix' ],
rules: {
'array-bracket-spacing': [ 'error', 'always', { singleValue: false } ],
'arrow-parens': [ 'error', 'as-needed' ],
'comma-dangle': [ 'error', 'always-multiline' ],
'comma-spacing': ['error'],
'func-style': [ 'warn', 'declaration', { 'allowArrowFunctions': true } ],
'import/no-unresolved': ['error'],
'import/no-unused-modules': [ 'error', { ignoreExports, missingExports: true, unusedExports: true } ],
'indent': [ 'error', 2 ],
'linebreak-style': [ 'error', 'unix' ],
'no-console': [ 'warn', { allow: [ 'warn', 'error' ] } ],
'no-multi-spaces': 'error',
'no-trailing-spaces': ['error'],
'no-undef': 'error',
'no-unused-vars': [ 'warn', { 'args': 'after-used', 'ignoreRestSiblings': false, 'vars': 'all' } ],
'object-curly-spacing': [ 'error', 'always' ],
'quotes': [ 'error', 'single' ],
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
'react/default-props-match-prop-types': ['error'],
'react/destructuring-assignment': [ 'error', 'always' ],
'react/forbid-prop-types': ['warn'],
'react/function-component-definition': [ 'error', { 'namedComponents': 'arrow-function', 'unnamedComponents': 'function-expression' } ],
'react/no-array-index-key': 'warn',
'react/no-danger': 'error',
'react/no-typos': 'error',
'react/no-unused-prop-types': 'warn',
'react/require-default-props': ['error'],
'react/self-closing-comp': [ 'error', { 'component': true, 'html': true } ],
'react/sort-comp': ['error'],
'react/sort-prop-types': [ 'error', { 'ignoreCase': true, 'sortShapeProp': 'true' } ],
'react/void-dom-elements-no-children': 'error',
'semi': [ 'error', 'never' ],
'sort-imports': [ 'error', { 'ignoreDeclarationSort': true } ],
'sort-keys-fix/sort-keys-fix': 'error',
},
settings: {
react: { version: 'detect' },
},
}