@allthings/eslint-config 2.2.3 → 3.0.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -7
- package/index.js +351 -424
- package/node.js +317 -389
- package/package.json +10 -5
package/node.js
CHANGED
|
@@ -1,404 +1,332 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import stylisticPlugin from '@stylistic/eslint-plugin'
|
|
2
|
+
import tsPlugin from '@typescript-eslint/eslint-plugin'
|
|
3
|
+
import globals from 'globals'
|
|
4
|
+
import importPlugin from 'eslint-plugin-import'
|
|
5
|
+
import jestPlugin from 'eslint-plugin-jest'
|
|
6
|
+
import preferArrowPlugin from 'eslint-plugin-prefer-arrow'
|
|
7
|
+
import prettierConfig from 'eslint-plugin-prettier/recommended'
|
|
8
|
+
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort'
|
|
9
|
+
import typescriptSortKeysPlugin from 'eslint-plugin-typescript-sort-keys'
|
|
10
|
+
import unicornPlugin from 'eslint-plugin-unicorn'
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// maintain order of node_modules outside cwd
|
|
27
|
-
sortedPaths.push(...keptPaths.reverse())
|
|
28
|
-
|
|
29
|
-
const hookPropertyMap = new Map(
|
|
30
|
-
[
|
|
31
|
-
['eslint-plugin-unicorn', 'eslint-plugin-unicorn'],
|
|
32
|
-
['eslint-plugin-jest', 'eslint-plugin-jest'],
|
|
33
|
-
['eslint-plugin-import', 'eslint-plugin-import'],
|
|
34
|
-
[
|
|
35
|
-
'eslint-plugin-typescript-sort-keys',
|
|
36
|
-
'eslint-plugin-typescript-sort-keys',
|
|
37
|
-
],
|
|
38
|
-
['eslint-plugin-prefer-arrow', 'eslint-plugin-prefer-arrow'],
|
|
39
|
-
['eslint-plugin-simple-import-sort', 'eslint-plugin-simple-import-sort'],
|
|
40
|
-
['@stylistic/eslint-plugin', '@stylistic/eslint-plugin'],
|
|
41
|
-
].map(([request, replacement]) => [
|
|
42
|
-
request,
|
|
43
|
-
require.resolve(replacement, { paths: sortedPaths }),
|
|
44
|
-
]),
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
const mod = require('module')
|
|
48
|
-
const resolveFilename = mod._resolveFilename
|
|
49
|
-
mod._resolveFilename = function (request, parent, isMain, options) {
|
|
50
|
-
const hookResolved = hookPropertyMap.get(request)
|
|
51
|
-
if (hookResolved) {
|
|
52
|
-
request = hookResolved
|
|
53
|
-
}
|
|
54
|
-
return resolveFilename.call(mod, request, parent, isMain, options)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
require('@rushstack/eslint-patch/modern-module-resolution')
|
|
58
|
-
|
|
59
|
-
module.exports = {
|
|
60
|
-
extends: [
|
|
61
|
-
'plugin:unicorn/recommended',
|
|
62
|
-
'plugin:import/recommended',
|
|
63
|
-
'plugin:import/typescript',
|
|
64
|
-
'eslint:recommended',
|
|
65
|
-
'plugin:@typescript-eslint/recommended-type-checked',
|
|
66
|
-
'plugin:@typescript-eslint/stylistic-type-checked',
|
|
67
|
-
'plugin:typescript-sort-keys/recommended',
|
|
68
|
-
'plugin:prettier/recommended',
|
|
69
|
-
],
|
|
70
|
-
plugins: [
|
|
71
|
-
'@stylistic',
|
|
72
|
-
'unicorn',
|
|
73
|
-
'jest',
|
|
74
|
-
'import',
|
|
75
|
-
'typescript-sort-keys',
|
|
76
|
-
'prefer-arrow',
|
|
77
|
-
'simple-import-sort',
|
|
78
|
-
],
|
|
79
|
-
rules: {
|
|
80
|
-
'@stylistic/member-delimiter-style': [
|
|
81
|
-
'error',
|
|
82
|
-
{
|
|
83
|
-
multiline: {
|
|
84
|
-
delimiter: 'none',
|
|
85
|
-
requireLast: true,
|
|
86
|
-
},
|
|
87
|
-
singleline: {
|
|
88
|
-
delimiter: 'semi',
|
|
89
|
-
requireLast: false,
|
|
90
|
-
},
|
|
12
|
+
export default [
|
|
13
|
+
...tsPlugin.configs['flat/recommended-type-checked'],
|
|
14
|
+
...tsPlugin.configs['flat/stylistic-type-checked'],
|
|
15
|
+
unicornPlugin.configs['flat/recommended'],
|
|
16
|
+
importPlugin.flatConfigs.recommended,
|
|
17
|
+
importPlugin.flatConfigs.typescript,
|
|
18
|
+
{
|
|
19
|
+
languageOptions: {
|
|
20
|
+
globals: {
|
|
21
|
+
...globals.node,
|
|
22
|
+
...jestPlugin.environments.globals.globals,
|
|
91
23
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
avoidEscape: true,
|
|
24
|
+
parserOptions: {
|
|
25
|
+
ecmaVersion: 2021,
|
|
26
|
+
project: 'tsconfig.json',
|
|
27
|
+
sourceType: 'module',
|
|
28
|
+
warnOnUnsupportedTypeScriptVersion: false,
|
|
98
29
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
'
|
|
105
|
-
|
|
106
|
-
|
|
30
|
+
},
|
|
31
|
+
plugins: {
|
|
32
|
+
'@stylistic': stylisticPlugin,
|
|
33
|
+
'jest': jestPlugin,
|
|
34
|
+
'prefer-arrow': preferArrowPlugin,
|
|
35
|
+
'simple-import-sort': simpleImportSortPlugin,
|
|
36
|
+
'typescript-sort-keys': typescriptSortKeysPlugin,
|
|
37
|
+
},
|
|
38
|
+
settings: {
|
|
39
|
+
'import/parsers': {
|
|
40
|
+
'@typescript-eslint/parser': ['.ts', '.mts', '.cts', '.tsx', '.d.ts'],
|
|
107
41
|
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
'@typescript-eslint/dot-notation': 'error',
|
|
112
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
113
|
-
'@typescript-eslint/explicit-module-boundary-types': [
|
|
114
|
-
'warn', // TODO: strict later
|
|
115
|
-
{
|
|
116
|
-
allowArgumentsExplicitlyTypedAsAny: true,
|
|
117
|
-
allowDirectConstAssertionInArrowFunctions: true,
|
|
118
|
-
allowHigherOrderFunctions: false,
|
|
119
|
-
allowTypedFunctionExpressions: false,
|
|
42
|
+
'import/resolver': {
|
|
43
|
+
node: { extensions: ['.js', '.jsx', '.ts', '.tsx'] },
|
|
44
|
+
typescript: { alwaysTryTypes: true },
|
|
120
45
|
},
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
46
|
+
},
|
|
47
|
+
rules: {
|
|
48
|
+
// typescript-sort-keys (no native flat config)
|
|
49
|
+
'typescript-sort-keys/interface': 'error',
|
|
50
|
+
'typescript-sort-keys/string-enum': 'error',
|
|
51
|
+
'@stylistic/member-delimiter-style': [
|
|
52
|
+
'error',
|
|
53
|
+
{
|
|
54
|
+
multiline: {
|
|
55
|
+
delimiter: 'none',
|
|
56
|
+
requireLast: true,
|
|
57
|
+
},
|
|
58
|
+
singleline: {
|
|
59
|
+
delimiter: 'semi',
|
|
60
|
+
requireLast: false,
|
|
61
|
+
},
|
|
128
62
|
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
'@typescript-eslint/no-empty-function': 'warn',
|
|
136
|
-
'@typescript-eslint/no-empty-interface': 'error',
|
|
137
|
-
'@typescript-eslint/no-explicit-any': 'warn',
|
|
138
|
-
// turn on later
|
|
139
|
-
'@typescript-eslint/no-floating-promises': 'warn',
|
|
140
|
-
'@typescript-eslint/no-for-in-array': 'error',
|
|
141
|
-
'@typescript-eslint/no-inferrable-types': 'error',
|
|
142
|
-
'@typescript-eslint/no-misused-new': 'error',
|
|
143
|
-
'@typescript-eslint/no-namespace': 'error',
|
|
144
|
-
'@typescript-eslint/no-redundant-type-constituents': 'warn',
|
|
145
|
-
'@typescript-eslint/no-require-imports': 'warn',
|
|
146
|
-
'@typescript-eslint/no-shadow': [
|
|
147
|
-
'error',
|
|
148
|
-
{
|
|
149
|
-
hoist: 'all',
|
|
150
|
-
},
|
|
151
|
-
],
|
|
152
|
-
'@typescript-eslint/no-this-alias': 'error',
|
|
153
|
-
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
154
|
-
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
|
155
|
-
'@typescript-eslint/no-unsafe-call': 'warn',
|
|
156
|
-
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
|
|
157
|
-
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
158
|
-
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
159
|
-
'@typescript-eslint/no-unused-expressions': 'error',
|
|
160
|
-
'@typescript-eslint/no-unused-vars': 'error',
|
|
161
|
-
'@typescript-eslint/no-use-before-define': 'error',
|
|
162
|
-
'@typescript-eslint/no-var-requires': 'error',
|
|
163
|
-
'@typescript-eslint/prefer-for-of': 'error',
|
|
164
|
-
'@typescript-eslint/prefer-function-type': 'error',
|
|
165
|
-
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
166
|
-
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
167
|
-
'@typescript-eslint/prefer-promise-reject-errors': 'warn',
|
|
168
|
-
'@typescript-eslint/restrict-template-expressions': 'warn',
|
|
169
|
-
'@typescript-eslint/triple-slash-reference': [
|
|
170
|
-
'error',
|
|
171
|
-
{
|
|
172
|
-
path: 'always',
|
|
173
|
-
types: 'prefer-import',
|
|
174
|
-
lib: 'always',
|
|
175
|
-
},
|
|
176
|
-
],
|
|
177
|
-
'@typescript-eslint/typedef': 'error',
|
|
178
|
-
'@typescript-eslint/unified-signatures': 'error',
|
|
179
|
-
'arrow-body-style': ['error', 'as-needed'],
|
|
180
|
-
complexity: [
|
|
181
|
-
'error',
|
|
182
|
-
{
|
|
183
|
-
max: 15,
|
|
184
|
-
},
|
|
185
|
-
],
|
|
186
|
-
'constructor-super': 'error',
|
|
187
|
-
eqeqeq: ['error', 'smart'],
|
|
188
|
-
'guard-for-in': 'error',
|
|
189
|
-
'id-denylist': [
|
|
190
|
-
'error',
|
|
191
|
-
'any',
|
|
192
|
-
'Number',
|
|
193
|
-
'number',
|
|
194
|
-
'String',
|
|
195
|
-
'string',
|
|
196
|
-
'Boolean',
|
|
197
|
-
'boolean',
|
|
198
|
-
'Undefined',
|
|
199
|
-
'undefined',
|
|
200
|
-
],
|
|
201
|
-
'id-match': 'error',
|
|
202
|
-
'import/no-anonymous-default-export': [
|
|
203
|
-
'error',
|
|
204
|
-
{
|
|
205
|
-
allowAnonymousClass: false,
|
|
206
|
-
allowAnonymousFunction: false,
|
|
207
|
-
allowArray: false,
|
|
208
|
-
allowArrowFunction: true,
|
|
209
|
-
allowCallExpression: true,
|
|
210
|
-
// The true value here is for backward compatibility
|
|
211
|
-
allowLiteral: false,
|
|
212
|
-
allowObject: true,
|
|
213
|
-
},
|
|
214
|
-
],
|
|
215
|
-
'import/no-extraneous-dependencies': [
|
|
216
|
-
'error',
|
|
217
|
-
{
|
|
218
|
-
devDependencies: true,
|
|
219
|
-
},
|
|
220
|
-
],
|
|
221
|
-
'jest/no-disabled-tests': 'warn',
|
|
222
|
-
'jest/no-focused-tests': 'error',
|
|
223
|
-
'jest/no-identical-title': 'error',
|
|
224
|
-
'jest/valid-expect': 'error',
|
|
225
|
-
'max-classes-per-file': ['error', 1],
|
|
226
|
-
'no-bitwise': 'error',
|
|
227
|
-
'no-caller': 'error',
|
|
228
|
-
'no-cond-assign': 'error',
|
|
229
|
-
'no-console': 'error',
|
|
230
|
-
'no-debugger': 'error',
|
|
231
|
-
'no-duplicate-case': 'error',
|
|
232
|
-
'no-duplicate-imports': 'error',
|
|
233
|
-
'no-empty': 'error',
|
|
234
|
-
'no-eval': 'error',
|
|
235
|
-
'no-extra-bind': 'error',
|
|
236
|
-
'no-multiple-empty-lines': 'error',
|
|
237
|
-
'no-new-func': 'error',
|
|
238
|
-
'no-new-wrappers': 'error',
|
|
239
|
-
'no-param-reassign': 'error',
|
|
240
|
-
'no-redeclare': 'error',
|
|
241
|
-
'no-return-await': 'error',
|
|
242
|
-
'no-sequences': 'error',
|
|
243
|
-
'no-sparse-arrays': 'error',
|
|
244
|
-
'no-template-curly-in-string': 'error',
|
|
245
|
-
'no-throw-literal': 'error',
|
|
246
|
-
'no-trailing-spaces': 'error',
|
|
247
|
-
'no-undef-init': 'error',
|
|
248
|
-
'no-unsafe-finally': 'error',
|
|
249
|
-
'no-unused-labels': 'error',
|
|
250
|
-
'no-var': 'error',
|
|
251
|
-
'object-shorthand': 'error',
|
|
252
|
-
'one-var': ['error', 'never'],
|
|
253
|
-
'padding-line-between-statements': [
|
|
254
|
-
'error',
|
|
255
|
-
{
|
|
256
|
-
blankLine: 'always',
|
|
257
|
-
prev: '*',
|
|
258
|
-
next: 'return',
|
|
259
|
-
},
|
|
260
|
-
],
|
|
261
|
-
'prefer-arrow/prefer-arrow-functions': 'warn',
|
|
262
|
-
'prefer-const': 'error',
|
|
263
|
-
'prefer-object-spread': 'error',
|
|
264
|
-
'prefer-template': 'error',
|
|
265
|
-
quotes: ['error', 'single', { avoidEscape: true }],
|
|
266
|
-
radix: 'error',
|
|
267
|
-
'simple-import-sort/imports': 'error',
|
|
268
|
-
'simple-import-sort/exports': 'error',
|
|
269
|
-
'sort-keys': 'error',
|
|
270
|
-
'spaced-comment': [
|
|
271
|
-
'error',
|
|
272
|
-
'always',
|
|
273
|
-
{
|
|
274
|
-
markers: ['/'],
|
|
275
|
-
},
|
|
276
|
-
],
|
|
277
|
-
'unicorn/better-regex': 'off',
|
|
278
|
-
'unicorn/consistent-existence-index-check': 'off',
|
|
279
|
-
'unicorn/expiring-todo-comments': 'off',
|
|
280
|
-
'unicorn/filename-case': [
|
|
281
|
-
'warn',
|
|
282
|
-
{
|
|
283
|
-
cases: {
|
|
284
|
-
camelCase: true,
|
|
285
|
-
pascalCase: true,
|
|
63
|
+
],
|
|
64
|
+
'@stylistic/quotes': [
|
|
65
|
+
'error',
|
|
66
|
+
'single',
|
|
67
|
+
{
|
|
68
|
+
avoidEscape: true,
|
|
286
69
|
},
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
'error',
|
|
309
|
-
{
|
|
310
|
-
allowList: {
|
|
311
|
-
params: true,
|
|
312
|
-
props: true,
|
|
70
|
+
],
|
|
71
|
+
'@stylistic/semi': ['error', 'never'],
|
|
72
|
+
'@stylistic/type-annotation-spacing': 'error',
|
|
73
|
+
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
74
|
+
'@typescript-eslint/array-type': [
|
|
75
|
+
'error',
|
|
76
|
+
{
|
|
77
|
+
default: 'array',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
81
|
+
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
82
|
+
'@typescript-eslint/dot-notation': 'error',
|
|
83
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
84
|
+
'@typescript-eslint/explicit-module-boundary-types': [
|
|
85
|
+
'warn', // TODO: strict later
|
|
86
|
+
{
|
|
87
|
+
allowArgumentsExplicitlyTypedAsAny: true,
|
|
88
|
+
allowDirectConstAssertionInArrowFunctions: true,
|
|
89
|
+
allowHigherOrderFunctions: false,
|
|
90
|
+
allowTypedFunctionExpressions: false,
|
|
313
91
|
},
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
92
|
+
],
|
|
93
|
+
'@typescript-eslint/naming-convention': [
|
|
94
|
+
'error',
|
|
95
|
+
{
|
|
96
|
+
custom: {
|
|
97
|
+
match: true,
|
|
98
|
+
regex: '^I[A-Z]',
|
|
317
99
|
},
|
|
318
|
-
|
|
319
|
-
|
|
100
|
+
format: ['PascalCase'],
|
|
101
|
+
selector: 'interface',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
'@typescript-eslint/no-base-to-string': 'warn',
|
|
105
|
+
// need for tests' mockups
|
|
106
|
+
'@typescript-eslint/no-empty-function': 'warn',
|
|
107
|
+
'@typescript-eslint/no-empty-interface': 'error',
|
|
108
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
109
|
+
// turn on later
|
|
110
|
+
'@typescript-eslint/no-floating-promises': 'warn',
|
|
111
|
+
'@typescript-eslint/no-for-in-array': 'error',
|
|
112
|
+
'@typescript-eslint/no-inferrable-types': 'error',
|
|
113
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
114
|
+
'@typescript-eslint/no-namespace': 'error',
|
|
115
|
+
'@typescript-eslint/no-redundant-type-constituents': 'warn',
|
|
116
|
+
'@typescript-eslint/no-require-imports': 'warn',
|
|
117
|
+
'@typescript-eslint/no-shadow': [
|
|
118
|
+
'error',
|
|
119
|
+
{
|
|
120
|
+
hoist: 'all',
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
'@typescript-eslint/no-this-alias': 'error',
|
|
124
|
+
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
125
|
+
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
|
126
|
+
'@typescript-eslint/no-unsafe-call': 'warn',
|
|
127
|
+
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
|
|
128
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
129
|
+
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
130
|
+
'@typescript-eslint/no-unused-expressions': 'error',
|
|
131
|
+
'@typescript-eslint/no-unused-vars': 'error',
|
|
132
|
+
'@typescript-eslint/no-use-before-define': 'error',
|
|
133
|
+
'@typescript-eslint/no-var-requires': 'error',
|
|
134
|
+
'@typescript-eslint/prefer-for-of': 'error',
|
|
135
|
+
'@typescript-eslint/prefer-function-type': 'error',
|
|
136
|
+
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
137
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
138
|
+
'@typescript-eslint/prefer-promise-reject-errors': 'warn',
|
|
139
|
+
'@typescript-eslint/restrict-template-expressions': 'warn',
|
|
140
|
+
'@typescript-eslint/triple-slash-reference': [
|
|
141
|
+
'error',
|
|
142
|
+
{
|
|
143
|
+
path: 'always',
|
|
144
|
+
types: 'prefer-import',
|
|
145
|
+
lib: 'always',
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
'@typescript-eslint/typedef': 'error',
|
|
149
|
+
'@typescript-eslint/unified-signatures': 'error',
|
|
150
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
151
|
+
complexity: [
|
|
152
|
+
'error',
|
|
153
|
+
{
|
|
154
|
+
max: 15,
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
'constructor-super': 'error',
|
|
158
|
+
eqeqeq: ['error', 'smart'],
|
|
159
|
+
'guard-for-in': 'error',
|
|
160
|
+
'id-denylist': [
|
|
161
|
+
'error',
|
|
162
|
+
'any',
|
|
163
|
+
'Number',
|
|
164
|
+
'number',
|
|
165
|
+
'String',
|
|
166
|
+
'string',
|
|
167
|
+
'Boolean',
|
|
168
|
+
'boolean',
|
|
169
|
+
'Undefined',
|
|
170
|
+
'undefined',
|
|
171
|
+
],
|
|
172
|
+
'id-match': 'error',
|
|
173
|
+
'import/no-anonymous-default-export': [
|
|
174
|
+
'error',
|
|
175
|
+
{
|
|
176
|
+
allowAnonymousClass: false,
|
|
177
|
+
allowAnonymousFunction: false,
|
|
178
|
+
allowArray: false,
|
|
179
|
+
allowArrowFunction: true,
|
|
180
|
+
allowCallExpression: true,
|
|
181
|
+
// The true value here is for backward compatibility
|
|
182
|
+
allowLiteral: false,
|
|
183
|
+
allowObject: true,
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
'import/no-extraneous-dependencies': [
|
|
187
|
+
'error',
|
|
188
|
+
{
|
|
189
|
+
devDependencies: true,
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
'jest/no-disabled-tests': 'warn',
|
|
193
|
+
'jest/no-focused-tests': 'error',
|
|
194
|
+
'jest/no-identical-title': 'error',
|
|
195
|
+
'jest/valid-expect': 'error',
|
|
196
|
+
'max-classes-per-file': ['error', 1],
|
|
197
|
+
'no-bitwise': 'error',
|
|
198
|
+
'no-caller': 'error',
|
|
199
|
+
'no-cond-assign': 'error',
|
|
200
|
+
'no-console': 'error',
|
|
201
|
+
'no-debugger': 'error',
|
|
202
|
+
'no-duplicate-case': 'error',
|
|
203
|
+
'no-duplicate-imports': 'error',
|
|
204
|
+
'no-empty': 'error',
|
|
205
|
+
'no-eval': 'error',
|
|
206
|
+
'no-extra-bind': 'error',
|
|
207
|
+
'no-multiple-empty-lines': 'error',
|
|
208
|
+
'no-new-func': 'error',
|
|
209
|
+
'no-new-wrappers': 'error',
|
|
210
|
+
'no-param-reassign': 'error',
|
|
211
|
+
'no-redeclare': 'error',
|
|
212
|
+
'no-return-await': 'error',
|
|
213
|
+
'no-sequences': 'error',
|
|
214
|
+
'no-sparse-arrays': 'error',
|
|
215
|
+
'no-template-curly-in-string': 'error',
|
|
216
|
+
'no-throw-literal': 'error',
|
|
217
|
+
'no-trailing-spaces': 'error',
|
|
218
|
+
'no-undef-init': 'error',
|
|
219
|
+
'no-unsafe-finally': 'error',
|
|
220
|
+
'no-unused-labels': 'error',
|
|
221
|
+
'no-var': 'error',
|
|
222
|
+
'object-shorthand': 'error',
|
|
223
|
+
'one-var': ['error', 'never'],
|
|
224
|
+
'padding-line-between-statements': [
|
|
225
|
+
'error',
|
|
226
|
+
{
|
|
227
|
+
blankLine: 'always',
|
|
228
|
+
prev: '*',
|
|
229
|
+
next: 'return',
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
'prefer-arrow/prefer-arrow-functions': 'warn',
|
|
233
|
+
'prefer-const': 'error',
|
|
234
|
+
'prefer-object-spread': 'error',
|
|
235
|
+
'prefer-template': 'error',
|
|
236
|
+
quotes: ['error', 'single', { avoidEscape: true }],
|
|
237
|
+
radix: 'error',
|
|
238
|
+
'simple-import-sort/exports': 'error',
|
|
239
|
+
'simple-import-sort/imports': 'error',
|
|
240
|
+
'sort-keys': 'error',
|
|
241
|
+
'spaced-comment': [
|
|
242
|
+
'error',
|
|
243
|
+
'always',
|
|
244
|
+
{
|
|
245
|
+
markers: ['/'],
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
'unicorn/better-regex': 'off',
|
|
249
|
+
'unicorn/consistent-existence-index-check': 'off',
|
|
250
|
+
'unicorn/expiring-todo-comments': 'off',
|
|
251
|
+
'unicorn/filename-case': [
|
|
252
|
+
'warn',
|
|
253
|
+
{
|
|
254
|
+
cases: {
|
|
255
|
+
camelCase: true,
|
|
256
|
+
pascalCase: true,
|
|
320
257
|
},
|
|
321
258
|
},
|
|
322
|
-
},
|
|
323
|
-
],
|
|
324
|
-
'unicorn/prefer-export-from': 'off',
|
|
325
|
-
'unicorn/prefer-global-this': 'warn',
|
|
326
|
-
'unicorn/prefer-includes': 'off',
|
|
327
|
-
'unicorn/prefer-math-min-max': 'warn',
|
|
328
|
-
'unicorn/prefer-module': 'warn',
|
|
329
|
-
'unicorn/prefer-optional-catch-binding': 'off',
|
|
330
|
-
'unicorn/prefer-prototype-methods': 'off',
|
|
331
|
-
'unicorn/prefer-query-selector': 'off',
|
|
332
|
-
'unicorn/prefer-regexp-test': 'off',
|
|
333
|
-
'unicorn/prefer-set-has': 'off',
|
|
334
|
-
'unicorn/prefer-set-size': 'off',
|
|
335
|
-
'unicorn/prefer-string-raw': 'off',
|
|
336
|
-
'unicorn/prefer-string-replace-all': 'off',
|
|
337
|
-
'unicorn/prefer-structured-clone': 'warn',
|
|
338
|
-
'unicorn/prefer-node-protocol': 'off',
|
|
339
|
-
'unicorn/relative-url-style': 'off',
|
|
340
|
-
'unicorn/switch-case-braces': 'off',
|
|
341
|
-
'unicorn/template-indent': 'off',
|
|
342
|
-
'use-isnan': 'error',
|
|
343
|
-
},
|
|
344
|
-
parser: '@typescript-eslint/parser',
|
|
345
|
-
parserOptions: {
|
|
346
|
-
ecmaFeatures: {
|
|
347
|
-
jsx: true,
|
|
348
|
-
},
|
|
349
|
-
ecmaVersion: 2021,
|
|
350
|
-
project: 'tsconfig.json',
|
|
351
|
-
sourceType: 'module',
|
|
352
|
-
warnOnUnsupportedTypeScriptVersion: false,
|
|
353
|
-
},
|
|
354
|
-
settings: {
|
|
355
|
-
'import/parsers': {
|
|
356
|
-
[require.resolve('@typescript-eslint/parser')]: [
|
|
357
|
-
'.ts',
|
|
358
|
-
'.mts',
|
|
359
|
-
'.cts',
|
|
360
|
-
'.tsx',
|
|
361
|
-
'.d.ts',
|
|
362
259
|
],
|
|
260
|
+
'unicorn/import-style': 'warn',
|
|
261
|
+
'unicorn/no-anonymous-default-export': 'off',
|
|
262
|
+
'unicorn/no-array-reduce': 'off',
|
|
263
|
+
'unicorn/no-await-expression-member': 'warn',
|
|
264
|
+
'unicorn/no-console-spaces': 'off',
|
|
265
|
+
'unicorn/no-document-cookie': 'warn',
|
|
266
|
+
'unicorn/no-empty-file': 'off',
|
|
267
|
+
'unicorn/no-hex-escape': 'warn',
|
|
268
|
+
'unicorn/no-invalid-remove-event-listener': 'warn',
|
|
269
|
+
'unicorn/no-nested-ternary': 'off',
|
|
270
|
+
// because we have a lot of logic depends on null
|
|
271
|
+
'unicorn/no-null': 'warn',
|
|
272
|
+
'unicorn/no-object-as-default-parameter': 'warn',
|
|
273
|
+
'unicorn/no-single-promise-in-promise-methods': 'warn',
|
|
274
|
+
'unicorn/no-unreadable-array-destructuring': 'off',
|
|
275
|
+
'unicorn/no-unsafe-regex': 'off',
|
|
276
|
+
'unicorn/no-unused-properties': 'warn',
|
|
277
|
+
'unicorn/no-zero-fractions': 'off',
|
|
278
|
+
'unicorn/prefer-export-from': 'off',
|
|
279
|
+
'unicorn/prefer-global-this': 'warn',
|
|
280
|
+
'unicorn/prefer-includes': 'off',
|
|
281
|
+
'unicorn/prefer-math-min-max': 'warn',
|
|
282
|
+
'unicorn/prefer-module': 'warn',
|
|
283
|
+
'unicorn/prefer-node-protocol': 'off',
|
|
284
|
+
'unicorn/prefer-optional-catch-binding': 'off',
|
|
285
|
+
'unicorn/prefer-prototype-methods': 'off',
|
|
286
|
+
'unicorn/prefer-query-selector': 'off',
|
|
287
|
+
'unicorn/prefer-regexp-test': 'off',
|
|
288
|
+
'unicorn/prefer-set-has': 'off',
|
|
289
|
+
'unicorn/prefer-set-size': 'off',
|
|
290
|
+
'unicorn/prefer-string-raw': 'off',
|
|
291
|
+
'unicorn/prefer-string-replace-all': 'off',
|
|
292
|
+
'unicorn/prefer-structured-clone': 'warn',
|
|
293
|
+
'unicorn/prevent-abbreviations': [
|
|
294
|
+
'error',
|
|
295
|
+
{
|
|
296
|
+
allowList: {
|
|
297
|
+
params: true,
|
|
298
|
+
props: true,
|
|
299
|
+
},
|
|
300
|
+
replacements: {
|
|
301
|
+
params: {
|
|
302
|
+
properties: false,
|
|
303
|
+
},
|
|
304
|
+
props: {
|
|
305
|
+
properties: false,
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
'unicorn/relative-url-style': 'off',
|
|
311
|
+
'unicorn/switch-case-braces': 'off',
|
|
312
|
+
'unicorn/template-indent': 'off',
|
|
313
|
+
'use-isnan': 'error',
|
|
363
314
|
},
|
|
364
|
-
'import/resolver': {
|
|
365
|
-
[require.resolve('eslint-import-resolver-node')]: {
|
|
366
|
-
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
367
|
-
},
|
|
368
|
-
[require.resolve('eslint-import-resolver-typescript')]: {
|
|
369
|
-
alwaysTryTypes: true,
|
|
370
|
-
},
|
|
371
|
-
},
|
|
372
|
-
},
|
|
373
|
-
env: {
|
|
374
|
-
node: true,
|
|
375
|
-
es6: true,
|
|
376
|
-
'jest/globals': true,
|
|
377
315
|
},
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
392
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
393
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
394
|
-
'@typescript-eslint/no-misused-promises': 'off',
|
|
395
|
-
'@typescript-eslint/no-unsafe-return': 'off',
|
|
396
|
-
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
397
|
-
'@typescript-eslint/require-await': 'off',
|
|
398
|
-
'unicorn/no-array-callback-reference': 'off',
|
|
399
|
-
'unicorn/no-await-expression-member': 'off',
|
|
400
|
-
},
|
|
316
|
+
{
|
|
317
|
+
// because of jest
|
|
318
|
+
files: ['**/*.test.ts'],
|
|
319
|
+
rules: {
|
|
320
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
321
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
322
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
323
|
+
'@typescript-eslint/no-misused-promises': 'off',
|
|
324
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
325
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
326
|
+
'@typescript-eslint/require-await': 'off',
|
|
327
|
+
'unicorn/no-array-callback-reference': 'off',
|
|
328
|
+
'unicorn/no-await-expression-member': 'off',
|
|
401
329
|
},
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
330
|
+
},
|
|
331
|
+
prettierConfig,
|
|
332
|
+
]
|