-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
327 lines (327 loc) · 11.7 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
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
319
320
321
322
323
324
325
326
327
module.exports = {
env: {
browser: true,
node: true
},
parser: '@typescript-eslint/parser',
root: true,
parserOptions: {
ecmaVersion: 13,
requireConfigFile: false,
ecmaFeatures: {
jsx: true
},
sourceType: 'module'
},
settings: {
'import/resolver': {
typescript: {}
},
react: {
version: 'detect'
},
jsdoc: {
structuredTags: {
JSX: {type: true}
},
definedTags: ['link']
}
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended'
],
plugins: [
'prettier',
'eslint-plugin-jsdoc',
'eslint-plugin-prefer-arrow',
'eslint-plugin-react',
'react',
'react-hooks',
'@typescript-eslint',
'unicorn'
],
rules: {
'unicorn/better-regex': 'off',
'unicorn/catch-error-name': 'off',
'unicorn/consistent-destructuring': 'error',
'unicorn/consistent-function-scoping': 'off',
'unicorn/empty-brace-spaces': 'error',
'unicorn/error-message': 'error',
'unicorn/expiring-todo-comments': 'error',
'unicorn/escape-case': 'error',
'unicorn/explicit-length-check': 'error',
'unicorn/filename-case': 'off',
'unicorn/import-index': 'off',
'unicorn/import-style': 'off',
'unicorn/new-for-builtins': 'error',
'unicorn/no-abusive-eslint-disable': 'error',
'unicorn/no-array-callback-reference': 'error',
'unicorn/no-array-for-each': 'error',
'unicorn/no-array-method-this-argument': 'error',
'unicorn/no-array-push-push': 'error',
'unicorn/no-array-reduce': 'error',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-console-spaces': 'error',
'unicorn/no-document-cookie': 'error',
'unicorn/no-empty-file': 'error',
'unicorn/no-for-loop': 'error',
'unicorn/no-hex-escape': 'error',
'unicorn/no-instanceof-array': 'error',
'unicorn/no-invalid-remove-event-listener': 'error',
'unicorn/no-keyword-prefix': 'off',
'unicorn/no-lonely-if': 'error',
'no-nested-ternary': 'off',
'unicorn/no-nested-ternary': 'error',
'unicorn/no-new-array': 'error',
'unicorn/no-new-buffer': 'error',
'unicorn/no-null': 'off',
'unicorn/no-object-as-default-parameter': 'error',
'unicorn/no-process-exit': 'error',
'unicorn/no-static-only-class': 'error',
'unicorn/no-this-assignment': 'error',
'unicorn/no-unreadable-array-destructuring': 'error',
'unicorn/no-unsafe-regex': 'error',
'unicorn/no-unused-properties': 'error',
'unicorn/no-useless-fallback-in-spread': 'error',
'unicorn/no-useless-length-check': 'error',
'unicorn/no-useless-spread': 'error',
'unicorn/no-useless-undefined': 'error',
'unicorn/no-zero-fractions': 'error',
'unicorn/number-literal-case': 'error',
'unicorn/numeric-separators-style': 'error',
'unicorn/prefer-add-event-listener': 'error',
'unicorn/prefer-array-find': 'error',
'unicorn/prefer-array-flat': 'error',
'unicorn/prefer-array-flat-map': 'error',
'unicorn/prefer-array-index-of': 'error',
'unicorn/prefer-array-some': 'error',
'unicorn/prefer-at': 'error',
'unicorn/prefer-code-point': 'error',
'unicorn/prefer-date-now': 'error',
'unicorn/prefer-default-parameters': 'error',
'unicorn/prefer-dom-node-append': 'error',
'unicorn/prefer-dom-node-dataset': 'error',
'unicorn/prefer-dom-node-remove': 'error',
'unicorn/prefer-dom-node-text-content': 'error',
'unicorn/prefer-export-from': 'error',
'unicorn/prefer-includes': 'error',
'unicorn/prefer-math-trunc': 'error',
'unicorn/prefer-modern-dom-apis': 'error',
'unicorn/prefer-module': 'off',
'unicorn/prefer-negative-index': 'error',
'unicorn/prefer-node-protocol': 'error',
'unicorn/prefer-number-properties': 'error',
'unicorn/prefer-object-from-entries': 'error',
'unicorn/prefer-object-has-own': 'off',
'unicorn/prefer-optional-catch-binding': 'error',
'unicorn/prefer-prototype-methods': 'off',
'unicorn/prefer-query-selector': 'off',
'unicorn/prefer-reflect-apply': 'error',
'unicorn/prefer-regexp-test': 'error',
'unicorn/prefer-set-has': 'error',
'unicorn/prefer-spread': 'error',
'unicorn/prefer-string-replace-all': 'error',
'unicorn/prefer-string-slice': 'error',
'unicorn/prefer-string-starts-ends-with': 'error',
'unicorn/prefer-string-trim-start-end': 'error',
'unicorn/prefer-switch': 'error',
'unicorn/prefer-ternary': 'error',
'unicorn/prefer-top-level-await': 'error',
'unicorn/prefer-type-error': 'error',
'unicorn/prevent-abbreviations': [
'error',
{
allowList: {
CustomMenuProps: true,
IDropdownProps: true,
IModalProps: true,
IProps: true,
ITableProps: true,
ITitleProps: true,
TProps: true,
defaultNoButtonProps: true,
defaultYesButtonProps: true,
doc: true,
dropdownProps: true,
idx: true,
n: true,
noButtonProps: true,
props: true,
ref: true,
tableProps: true,
yesButtonProps: true
}
}
],
'unicorn/require-array-join-separator': 'error',
'unicorn/require-number-to-fixed-digits-argument': 'error',
'unicorn/require-post-message-target-origin': 'error',
'unicorn/string-content': 'error',
'unicorn/template-indent': 'error',
'unicorn/throw-new-error': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/adjacent-overload-signatures': 'error',
'arrow-parens': ['error', 'always'],
'brace-style': ['error', '1tbs', {allowSingleLine: true}],
'comma-dangle': 'error',
complexity: ['error', {max: 20}],
'constructor-super': 'error',
'dot-notation': 'error',
'eol-last': ['error', 'always'],
eqeqeq: ['error', 'smart'],
'guard-for-in': 'error',
'id-denylist': [
'error',
'any',
'Number',
'number',
'String',
'string',
'Boolean',
'boolean',
'Undefined',
'undefined'
],
'id-match': 'error',
indent: 'off',
'max-classes-per-file': ['error', 1],
'linebreak-style': 'off',
'jsdoc/check-alignment': 'error',
'jsdoc/check-indentation': 'error',
'jsdoc/newline-after-description': 'off',
'jsdoc/no-undefined-types': 1,
'jsdoc/check-line-alignment': 1,
'jsdoc/check-param-names': 1,
'jsdoc/check-property-names': 1,
'jsdoc/check-syntax': 1,
'jsdoc/check-tag-names': ['error', {definedTags: ['link']}],
'jsdoc/check-types': 1,
'jsdoc/check-values': 1,
'jsdoc/empty-tags': 1,
'jsdoc/implements-on-classes': 1,
'jsdoc/multiline-blocks': 1,
'jsdoc/no-bad-blocks': 1,
'jsdoc/no-defaults': 1,
'jsdoc/no-multi-asterisks': 1,
'jsdoc/require-asterisk-prefix': 1,
'jsdoc/require-description': 1,
'jsdoc/require-jsdoc': 1,
'jsdoc/require-param': 1,
'jsdoc/require-param-description': 1,
'jsdoc/require-param-name': 1,
'jsdoc/require-param-type': 1,
'jsdoc/require-property': 1,
'jsdoc/require-property-description': 1,
'jsdoc/require-property-name': 1,
'jsdoc/require-property-type': 1,
'jsdoc/require-returns-check': 1,
'jsdoc/require-returns-description': 1,
'jsdoc/require-returns-type': 1,
'jsdoc/require-throws': 1,
'jsdoc/require-yields': 1,
'jsdoc/require-yields-check': 1,
'jsdoc/tag-lines': 1,
'jsdoc/valid-types': ['error', {allowEmptyNamepaths: true, checkSeesForNamepaths: false}],
'jsdoc/check-access': 1,
'jsdoc/check-examples': 1,
'jsdoc/match-description': 'off',
'jsdoc/no-missing-syntax': 'off',
'jsdoc/no-restricted-syntax': 'off',
'jsdoc/no-types': 'off',
'jsdoc/require-description-complete-sentence': 'off',
'jsdoc/require-example': 'off',
'jsdoc/require-file-overview': 'off',
'jsdoc/require-hyphen-before-param-description': 'off',
'jsdoc/require-returns': 'off',
'max-len': [
'error',
{
ignoreUrls: true,
code: 120
}
],
'new-parens': ['error', 'always'],
'newline-per-chained-call': ['error', {ignoreChainWithDepth: 2}],
'no-array-constructor': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-cond-assign': 'error',
'no-console': 'error',
'no-debugger': 'error',
'no-empty': 'error',
'no-empty-function': 'error',
'no-eval': 'error',
'no-extra-semi': 'error',
'no-fallthrough': 'error',
'no-implied-eval': 'error',
'no-invalid-this': 'error',
'no-irregular-whitespace': 'error',
'no-multiple-empty-lines': 'error',
'no-new-wrappers': 'error',
'no-shadow': 'off',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-undef-init': 'error',
'no-underscore-dangle': [
'off',
{
allow: ['_baseUrl', '_frak', '_apiKey', '_authenticate', '_alert']
}
],
'no-unsafe-finally': 'error',
'no-unused-expressions': 'error',
'no-unused-labels': 'error',
'no-unused-vars': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'no-var': 'error',
'object-shorthand': 'error',
'one-var': ['error', 'never'],
'padded-blocks': [
'off',
{
blocks: 'never'
},
{
allowSingleLineBlocks: false
}
],
'prefer-arrow/prefer-arrow-functions': 'error',
'prefer-const': 'error',
'quote-props': ['error', 'as-needed'],
quotes: ['error', 'single'],
'jsx-quotes': ['error', 'prefer-double'],
radix: ['error', 'as-needed'],
'react/jsx-curly-spacing': ['error', {when: 'never'}],
'react/jsx-equals-spacing': 'error',
'react/jsx-tag-spacing': [
'error',
{
afterOpening: 'allow',
closingSlash: 'allow'
}
],
'react/jsx-wrap-multilines': 'error',
'require-await': 'error',
'react-hooks/exhaustive-deps': 'error',
semi: ['error', 'always'],
'space-before-function-paren': 'off',
'space-in-parens': ['off', 'never'],
'spaced-comment': [
'error',
'always',
{
markers: ['/']
}
],
'use-isnan': 'error',
'valid-typeof': 'off'
},
globals: {
JSX: true
}
};