-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
129 lines (125 loc) · 3.78 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
module.exports = {
extends: ['airbnb', 'prettier', 'prettier/react'],
parser: 'babel-eslint',
plugins: ['react', 'jest', 'flowtype', 'react-hooks'],
env: {
browser: true,
node: true,
es6: true,
mocha: true,
jest: true,
},
settings: {
ecmascript: 6,
jsx: true,
flowtype: {
onlyFilesWithFlowAnnotation: true,
},
},
rules: {
'class-methods-use-this': 0,
'eol-last': [2, 'always'],
'no-multiple-empty-lines': [2, { max: 2 }],
'no-unused-expressions': [2, { allowShortCircuit: true }],
'no-plusplus': 0,
'func-names': 0,
'no-param-reassign': 0,
'no-use-before-define': 0,
'no-console': 0,
'no-debugger': 0,
'no-underscore-dangle': 0,
'no-shadow': 0,
'no-unused-vars': [
2,
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
varsIgnorePattern: '^_$',
},
],
'import/first': 0,
'import/extensions': [2, 'always', { js: 'never', json: 'never' }],
'import/no-named-as-default': 0,
'arrow-body-style': 0,
'no-else-return': 0,
'consistent-return': [1, { treatUndefinedAsUnspecified: true }],
'no-prototype-builtins': 0,
'global-require': 0,
'newline-before-return': 2,
'no-cond-assign': [2, 'except-parens'],
'no-return-assign': [2, 'except-parens'],
'no-restricted-syntax': 0,
'no-nested-ternary': 0,
'import/prefer-default-export': 0,
'import/no-named-as-default': 0,
curly: [2, 'all'],
// React
'react/display-name': 0,
'react/jsx-boolean-value': 1,
'react/jsx-sort-props': 0,
'react/jsx-sort-prop-types': 0,
'react/jsx-uses-react': 1,
'react/jsx-uses-vars': 1,
'react/no-did-mount-set-state': 0,
'react/no-did-update-set-state': 0,
'react/no-multi-comp': 0,
'react/no-unknown-property': 1,
'react/prop-types': 1,
'react/react-in-jsx-scope': 0,
'react/require-default-props': 0,
'react/jsx-filename-extension': 0,
'react/sort-comp': 0,
'react/forbid-prop-types': 0,
'react/jsx-no-bind': 0,
'react/no-unused-prop-types': 1,
'react/jsx-no-undef': [2, { allowGlobals: true }],
'react/jsx-pascal-case': 0,
'react/prefer-stateless-function': 0,
'react/no-string-refs': 1,
'react/no-find-dom-node': 1,
'react/no-array-index-key': 0,
'react/prefer-es6-class': 0,
'jsx-a11y/label-has-for': 1,
'jsx-a11y/no-static-element-interactions': 0,
'jsx-a11y/no-noninteractive-element-interactions': 0,
'jsx-a11y/tabindex-no-positive': 0,
'jsx-a11y/media-has-caption': 0,
// Jest
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/valid-expect': 'error',
// Flow
'flowtype/boolean-style': [2, 'boolean'],
'flowtype/define-flow-type': 1,
'flowtype/delimiter-dangle': 0,
'flowtype/generic-spacing': [2, 'never'],
'flowtype/no-primitive-constructor-types': 2,
'flowtype/no-types-missing-file-annotation': 2,
'flowtype/no-weak-types': [
2,
{ Function: false, Object: false, any: false },
],
'flowtype/object-type-delimiter': [2, 'comma'],
'flowtype/require-parameter-type': 0,
'flowtype/require-return-type': [
0,
'always',
{
annotateUndefined: 'never',
},
],
'flowtype/require-valid-file-annotation': 2,
'flowtype/semi': [2, 'always'],
'flowtype/space-after-type-colon': [2, 'always'],
'flowtype/space-before-generic-bracket': [2, 'never'],
'flowtype/space-before-type-colon': [2, 'never'],
'flowtype/type-id-match': 0,
'flowtype/union-intersection-spacing': [2, 'always'],
'flowtype/use-flow-type': 1,
'flowtype/valid-syntax': 1,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
};