This repository has been archived by the owner on Jan 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
242 lines (236 loc) · 7.46 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
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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
env: {
'jest/globals': true,
browser: true,
node: true,
es6: true,
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 6,
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
},
settings: {
react: {
version: 'detect',
},
},
plugins: [
'react',
'@typescript-eslint',
'react-hooks',
'prettier',
'prefer-object-spread',
'import',
'jest',
'jsx-a11y',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react/recommended',
'plugin:prettier/recommended',
'plugin:array-func/all',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:jsx-a11y/recommended',
'prettier',
'prettier/react',
'prettier/@typescript-eslint',
],
rules: {
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/promise-function-async': [
'error',
{
allowAny: true,
},
],
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/array-type': [
'error',
{ default: 'array-simple', readonly: 'array-simple' },
],
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/no-unused-vars-experimental': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'require-atomic-updates': 'error',
'rest-spread-spacing': ['error', 'never'],
'symbol-description': 'error',
'template-curly-spacing': 'error',
'vars-on-top': 'error',
'arrow-body-style': ['error', 'as-needed'],
'object-shorthand': 'error',
'prefer-destructuring': ['error', { object: true, array: false }],
'no-else-return': 'error',
'no-await-in-loop': 'error',
'callback-return': 'error',
'prefer-template': 'error',
quotes: ['warn', 'single', 'avoid-escape'],
'no-bitwise': 'error',
'no-continue': 'error',
'no-console': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-ex-assign': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-label': 'error',
'no-floating-decimal': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-invalid-regexp': 'error',
'no-inner-declarations': 'error',
'no-lone-blocks': 'error',
'no-multi-assign': 'error',
'no-misleading-character-class': 'error',
'no-new-symbol': 'error',
'no-param-reassign': 'error',
'no-process-exit': 'error',
'no-prototype-builtins': 'error',
'no-return-await': 'warn',
'no-self-compare': 'error',
'no-shadow-restricted-names': 'error',
'no-sparse-arrays': 'error',
'no-this-before-super': 'error',
'no-undef': 'error',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'warn',
'no-useless-concat': 'error',
'no-useless-computed-key': 'error',
'no-useless-escape': 'warn',
'no-useless-rename': 'error',
'no-useless-return': 'warn',
'no-void': 'warn',
'one-var-declaration-per-line': 'error',
'prefer-object-spread': 'error',
'prefer-promise-reject-errors': 'error',
'comma-dangle': ['error', 'always-multiline'],
curly: 'error',
'dot-notation': 'error',
'eol-last': 'error',
eqeqeq: ['error', 'always', { null: 'ignore' }],
'guard-for-in': 'error',
'max-classes-per-file': ['error', 1],
'new-parens': 'error',
'no-caller': 'error',
'no-cond-assign': 'error',
'no-debugger': 'error',
'no-empty': 'error',
'no-eval': 'error',
'no-multiple-empty-lines': 'error',
'no-new-wrappers': 'error',
'no-shadow': 'error',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-undef-init': 'error',
'no-unused-expressions': 'error',
'no-unused-labels': 'error',
'one-var': ['error', 'never'],
radix: 'error',
semi: 'error',
'space-before-function-paren': [
'error',
{
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
},
],
'spaced-comment': [
'error',
'always',
{
exceptions: ['/'],
},
],
'use-isnan': 'error',
'no-extra-semi': 'off',
'jsx-quotes': ['error', 'prefer-single'],
'import/order': [
'error',
{
groups: [['external', 'builtin'], 'internal', ['parent', 'sibling', 'index']],
},
],
'import/no-default-export': 'warn',
'jest/prefer-strict-equal': 'error',
'jest/lowercase-name': 'error',
'react/jsx-pascal-case': 'error',
'react/jsx-closing-tag-location': 'error',
'react/jsx-curly-spacing': ['error', 'never', { allowMultiline: true }],
'react/jsx-indent-props': ['error', 2],
'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }],
'react/no-danger': 'warn',
'react/self-closing-comp': 'error',
'react/jsx-wrap-multilines': [
'error',
{
declaration: true,
assignment: true,
return: true,
arrow: true,
},
],
'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
'react/jsx-equals-spacing': ['error', 'never'],
'react/no-will-update-set-state': 'error',
'react/no-multi-comp': ['error', { ignoreStateless: true }],
'react/prefer-es6-class': ['error', 'always'],
'react/boolean-prop-naming': 'error',
'react/button-has-type': 'error',
'react/destructuring-assignment': 'error',
'react/forbid-dom-props': 'error',
'react/no-array-index-key': 'error',
'react/no-access-state-in-setstate': 'error',
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'react/display-name': 'off',
'react/no-redundant-should-component-update': 'error',
'react/no-typos': 'error',
'react/no-this-in-sfc': 'error',
'react/no-unsafe': 'error',
'react/no-unused-prop-types': 'error',
'react/no-unused-state': 'error',
'react/prefer-stateless-function': 'error',
'react/sort-comp': 'error',
'react/void-dom-elements-no-children': 'error',
'react/jsx-boolean-value': ['error'],
'react/jsx-no-bind': 'warn',
'react/jsx-no-literals': 'off',
'react/jsx-fragments': 'error',
'react/jsx-sort-default-props': 'error',
'react/jsx-sort-props': 'error',
'react/jsx-tag-spacing': 'error',
'react/jsx-curly-newline': 'error',
'react/jsx-no-useless-fragment': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'array-func/prefer-array-from': 'off',
'prefer-object-spread/prefer-object-spread': 'error',
},
};