Repository navigation
Expand file tree
/
Copy path.eslintrc.js
More file actions
318 lines (318 loc) · 13.2 KB
/
Copy path.eslintrc.js
File metadata and controls
318 lines (318 loc) · 13.2 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
const isFixMode = process.argv.includes('--fix')
module.exports = {
env: {es6: true},
extends: ['eslint:all', 'plugin:@typescript-eslint/recommended-type-checked', 'plugin:import/recommended'],
globals: {
__DEV__: false,
__HOT__: false,
__FILE_SUFFIX__: false,
cancelAnimationFrame: 'readonly',
requestAnimationFrame: 'readonly',
require: 'readonly',
},
overrides: [
{
files: ['*.tsx', '*.ts', '*.d.ts'],
rules: {
'no-undef': 'off', // ts itself will catch this
'no-unused-vars': 'off', // ts itself will catch this
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
plugins: ['promise', 'react', 'react-hooks', '@typescript-eslint', 'deprecation', 'import'],
reportUnusedDisableDirectives: true,
rules: {
'@typescript-eslint/adjacent-overload-signatures': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-tslint-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/brace-style': 'off',
'@typescript-eslint/class-literal-property-style': 'error',
'@typescript-eslint/comma-dangle': 'off',
'@typescript-eslint/comma-spacing': 'off',
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/default-param-last': 'error',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/func-call-spacing': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/init-declarations': 'off',
'@typescript-eslint/keyword-spacing': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/method-signature-style': 'error',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-confusing-non-null-assertion': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-dupe-class-members': 'error',
'@typescript-eslint/no-dynamic-delete': 'error',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-extra-non-null-assertion': 'error',
'@typescript-eslint/no-extra-parens': 'off',
'@typescript-eslint/no-extra-semi': 'off',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-implied-eval': 'error',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-invalid-this': 'off',
'@typescript-eslint/no-invalid-void-type': 'error',
'@typescript-eslint/no-loop-func': 'error',
'@typescript-eslint/no-loss-of-precision': 'error',
'@typescript-eslint/no-magic-numbers': 'off',
'@typescript-eslint/no-meaningless-void-operator': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-restricted-imports': 'error',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/no-type-alias': 'off',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-unnecessary-condition': isFixMode
? 'off'
: ['error', {allowConstantLoopConditions: true}],
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': ['error', {argsIgnorePattern: '^_', ignoreRestSiblings: true}],
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/object-curly-spacing': 'error',
'@typescript-eslint/padding-line-between-statements': 'error',
'@typescript-eslint/prefer-as-const': 'error',
'@typescript-eslint/prefer-enum-initializers': 'off',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-literal-enum-member': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-readonly': 'off',
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
'@typescript-eslint/prefer-reduce-type-parameter': 'warn',
'@typescript-eslint/prefer-regexp-exec': 'off',
'@typescript-eslint/prefer-return-this-type': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/prefer-ts-expect-error': 'off',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/quotes': 'off',
'@typescript-eslint/require-array-sort-compare': 'off',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/restrict-template-expressions': 'error',
'@typescript-eslint/return-await': 'off',
'@typescript-eslint/semi': 'off',
'@typescript-eslint/sort-type-union-intersection-members': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/space-infix-ops': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/triple-slash-reference': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/typedef': 'error',
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/unified-signatures': 'error',
'array-callback-return': 'error',
'arrow-body-style': 'off',
'capitalized-comments': 'off',
'class-methods-use-this': 'off',
'consistent-return': 'off',
'default-case': 'off',
'default-param-last': 'off',
'deprecation/deprecation': 'error',
'dot-notation': 'off',
'func-names': 'off',
'func-style': 'off',
'guard-for-in': 'off',
'id-length': 'off',
'import/named': 'off',
'import/namespace': 'off',
'import/no-anonymous-default-export': 'error',
'import/no-unresolved': 'off',
'init-declarations': 'off',
'line-comment-position': 'off',
'logical-assignment-operators': 'off',
'max-classes-per-file': 'off',
'max-depth': 'off',
'max-lines': 'off',
'max-lines-per-function': 'off',
'max-params': 'off',
'max-statements': 'off',
'multiline-comment-style': 'off',
'new-cap': 'off',
'no-await-in-loop': 'off',
'no-console': 'off',
'no-constant-condition': ['warn', {checkLoops: false}],
'no-continue': 'off',
'no-duplicate-imports': 'off',
'no-else-return': 'off',
'no-empty': 'off',
'no-empty-function': 'off',
'no-implicit-coercion': 'off',
'no-implied-eval': 'error',
'no-inline-comments': 'off',
'no-lonely-if': 'off',
'no-loop-func': 'off',
'no-magic-numbers': 'off',
'no-negated-condition': 'off',
'no-nested-ternary': 'off',
'no-plusplus': 'off',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-shadow': 'off',
'no-ternary': 'off',
'no-undefined': 'off',
'no-underscore-dangle': 'off',
'no-unused-expressions': 'off',
'no-use-before-define': 'off',
'no-useless-return': 'off',
'no-warning-comments': 'off',
'object-shorthand': 'off',
'one-var': 'off',
'operator-assignment': 'off',
'prefer-arrow-callback': 'off',
'prefer-const': 'error',
'prefer-destructuring': 'off',
'prefer-named-capture-group': 'off',
'prefer-template': 'off',
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
'react/boolean-prop-naming': 'error',
'react/button-has-type': 'off',
'react/default-props-match-prop-types': 'off',
'react/destructuring-assignment': 'off',
'react/display-name': 'off',
'react/forbid-component-props': 'off',
'react/forbid-dom-props': 'off',
'react/forbid-elements': 'off',
'react/forbid-foreign-prop-types': 'off',
'react/forbid-prop-types': 'off',
'react/jsx-boolean-value': ['error', 'always'],
'react/jsx-child-element-spacing': 'off',
'react/jsx-closing-bracket-location': 'off',
'react/jsx-closing-tag-location': 'off',
'react/jsx-curly-brace-presence': 'off',
'react/jsx-curly-newline': 'off',
'react/jsx-curly-spacing': 'off',
'react/jsx-equals-spacing': 'off',
'react/jsx-filename-extension': 'off',
'react/jsx-first-prop-new-line': 'off',
'react/jsx-fragments': ['error', 'syntax'],
'react/jsx-handler-names': 'off',
'react/jsx-indent': 'off',
'react/jsx-indent-props': 'off',
'react/jsx-key': 'error',
'react/jsx-max-depth': 'off',
'react/jsx-max-props-per-line': 'off',
'react/jsx-no-bind': 'off',
'react/jsx-no-comment-textnodes': 'error',
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-literals': 'off',
'react/jsx-no-target-blank': 'error',
'react/jsx-no-undef': 'error',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-pascal-case': 'off',
'react/jsx-props-no-multi-spaces': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-sort-default-props': 'off',
'react/jsx-sort-props': 'off',
'react/jsx-space-before-closing': 'off',
'react/jsx-tag-spacing': 'off',
'react/jsx-uses-react': 'off',
'react/jsx-uses-vars': 'error',
'react/jsx-wrap-multilines': 'off',
'react/no-access-state-in-setstate': 'error',
'react/no-array-index-key': 'off',
'react/no-children-prop': 'off',
'react/no-danger': 'error',
'react/no-danger-with-children': 'error',
'react/no-deprecated': 'error',
'react/no-did-mount-set-state': 'warn',
'react/no-did-update-set-state': 'warn',
'react/no-direct-mutation-state': 'error',
'react/no-find-dom-node': 'warn',
'react/no-is-mounted': 'error',
'react/no-multi-comp': 'off',
'react/no-redundant-should-component-update': 'error',
'react/no-render-return-value': 'error',
'react/no-set-state': 'off',
'react/no-string-refs': 'error',
'react/no-this-in-sfc': 'error',
'react/no-typos': 'warn',
'react/no-unescaped-entities': 'off',
'react/no-unknown-property': 'error',
'react/no-unsafe': 'error',
'react/no-unused-prop-types': 'off',
'react/no-unused-state': 'error',
'react/no-will-update-set-state': 'warn',
'react/prefer-es6-class': 'off',
'react/prefer-read-only-props': 'off',
'react/prefer-stateless-function': 'error',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/require-default-props': 'off',
'react/require-optimization': 'off',
'react/require-render-return': 'off',
'react/self-closing-comp': 'off',
'react/sort-comp': 'off',
'react/sort-prop-types': 'off',
'react/state-in-constructor': 'off',
'react/static-property-placement': 'off',
'react/style-prop-object': 'error',
'react/void-dom-elements-no-children': 'error',
'require-unicode-regexp': 'off',
'sort-imports': 'off',
'sort-keys': ['error', 'asc', {caseSensitive: true, natural: false}],
camelcase: 'off',
complexity: 'off',
curly: 'off',
radix: 'off',
strict: ['error', 'global'],
yoda: 'off',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.tsx', '.d.ts', '.native.tsx', '.desktop.tsx', '.native.js', '.desktop.js'],
},
},
react: {version: 'detect'},
},
}