-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
85 lines (85 loc) · 2.61 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'plugin:react/recommended',
'airbnb',
],
ignorePatterns: ['config/webpack.config.js'],
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: [
'react',
],
rules: {
'class-methods-use-this': ['warn'],
'consistent-return': ['warn'],
'guard-for-in': ['warn'],
'implicit-arrow-linebreak': ['warn'],
'import/extensions': ['warn'],
'import/no-cycle': ['warn'],
'import/no-extraneous-dependencies': ['warn'],
'import/no-unresolved': ['warn'],
'import/prefer-default-export': ['warn'],
'jsx-a11y/click-events-have-key-events': ['warn'],
'jsx-a11y/control-has-associated-label': ['warn'],
'jsx-a11y/label-has-associated-control': ['warn'],
'jsx-a11y/no-static-element-interactions': ['warn'],
'max-len': [
'error',
180,
2,
{
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
},
],
'no-case-declarations': ['warn'],
'no-console': ['error'], // default is 'warn'
'no-continue': ['warn'],
'no-lonely-if': ['warn'],
'no-mixed-operators': ['warn'],
'no-nested-ternary': ['warn'],
'no-param-reassign': ['warn'],
'no-plusplus': ['warn'],
'no-prototype-builtins': ['warn'],
'no-restricted-globals': ['warn'],
'no-restricted-properties': ['warn'],
'no-restricted-syntax': ['warn'],
'no-return-assign': ['warn'],
'no-shadow': ['warn'],
// 'no-underscore-dangle': ['error', { allowFunctionParams: false }],
'no-unused-vars': ['error', { argsIgnorePattern: '^_', args: 'after-used' }],
'prefer-rest-params': ['warn'],
radix: ['warn'],
'react/button-has-type': ['warn'],
'react/destructuring-assignment': ['warn', 'always'],
'react/forbid-prop-types': ['warn'],
'react/jsx-filename-extension': ['warn'],
'react/jsx-no-bind': ['warn'],
'react/no-array-index-key': ['warn'],
'react/no-did-update-set-state': ['warn'],
'react/no-string-refs': ['warn'],
'react/no-unused-prop-types': ['warn'],
'react/no-unused-state': ['warn'],
// 'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'always' }],
'react/prefer-stateless-function': ['warn'],
'react/prop-types': ['warn'],
'react/require-default-props': ['warn'],
'react/sort-comp': ['warn'],
'react/state-in-constructor': ['warn'],
'react/static-property-placement': ['warn'],
},
};