@ver0/oxlint-config 1.0.0 → 2.0.1
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 +48 -8
- package/configs/browser-globals.js +68 -0
- package/configs/browser.js +6 -78
- package/configs/javascript.js +118 -251
- package/configs/node.js +16 -36
- package/configs/react.js +76 -109
- package/configs/typescript.js +190 -497
- package/configs/vitest.js +1 -8
- package/package.json +2 -1
package/configs/typescript.js
CHANGED
|
@@ -1,494 +1,192 @@
|
|
|
1
|
-
import {GLOBS} from '../utils/globs.js';
|
|
2
|
-
|
|
3
1
|
/** @type {import('oxlint').OxlintConfig} */
|
|
4
2
|
const typescript = {
|
|
5
|
-
plugins: [],
|
|
3
|
+
plugins: ['typescript'],
|
|
6
4
|
categories: {
|
|
7
|
-
correctness: '
|
|
5
|
+
correctness: 'error',
|
|
6
|
+
suspicious: 'error',
|
|
7
|
+
pedantic: 'error',
|
|
8
|
+
perf: 'error',
|
|
8
9
|
},
|
|
9
10
|
options: {
|
|
10
11
|
typeAware: true,
|
|
11
12
|
},
|
|
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
|
-
'unicorn/custom-error-definition': 'off',
|
|
114
|
-
'unicorn/empty-brace-spaces': 'error',
|
|
115
|
-
'unicorn/error-message': 'error',
|
|
116
|
-
'unicorn/escape-case': 'error',
|
|
117
|
-
'unicorn/explicit-length-check': 'error',
|
|
118
|
-
'unicorn/filename-case': 'error',
|
|
119
|
-
'unicorn/import-style': 'error',
|
|
120
|
-
'unicorn/new-for-builtins': 'error',
|
|
121
|
-
'unicorn/no-abusive-eslint-disable': 'error',
|
|
122
|
-
'unicorn/no-accessor-recursion': 'error',
|
|
123
|
-
'unicorn/no-anonymous-default-export': 'error',
|
|
124
|
-
'unicorn/no-array-callback-reference': 'error',
|
|
125
|
-
'unicorn/no-array-fill-with-reference-type': 'error',
|
|
126
|
-
'unicorn/no-array-for-each': 'error',
|
|
127
|
-
'unicorn/no-array-method-this-argument': 'error',
|
|
128
|
-
'unicorn/no-array-reduce': 'error',
|
|
129
|
-
'unicorn/no-array-reverse': 'error',
|
|
130
|
-
'unicorn/no-array-sort': 'error',
|
|
131
|
-
'unicorn/no-await-expression-member': 'error',
|
|
132
|
-
'unicorn/no-await-in-promise-methods': 'error',
|
|
133
|
-
'unicorn/no-console-spaces': 'error',
|
|
134
|
-
'unicorn/no-document-cookie': 'error',
|
|
135
|
-
'unicorn/no-empty-file': 'error',
|
|
136
|
-
'unicorn/no-hex-escape': 'error',
|
|
137
|
-
'unicorn/no-immediate-mutation': 'error',
|
|
138
|
-
'unicorn/no-instanceof-builtins': 'error',
|
|
139
|
-
'unicorn/no-invalid-fetch-options': 'error',
|
|
140
|
-
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
141
|
-
'unicorn/no-lonely-if': 'error',
|
|
142
|
-
'unicorn/no-magic-array-flat-depth': 'error',
|
|
143
|
-
'unicorn/no-negated-condition': 'error',
|
|
144
|
-
'unicorn/no-negation-in-equality-check': 'error',
|
|
145
|
-
'unicorn/no-nested-ternary': 'error',
|
|
146
|
-
'unicorn/no-new-array': 'error',
|
|
147
|
-
'unicorn/no-new-buffer': 'error',
|
|
148
|
-
'unicorn/no-null': 'off',
|
|
149
|
-
'unicorn/no-object-as-default-parameter': 'error',
|
|
150
|
-
'unicorn/no-process-exit': 'error',
|
|
151
|
-
'unicorn/no-single-promise-in-promise-methods': 'error',
|
|
152
|
-
'unicorn/no-static-only-class': 'error',
|
|
153
|
-
'unicorn/no-thenable': 'error',
|
|
154
|
-
'unicorn/no-this-assignment': 'error',
|
|
155
|
-
'unicorn/no-typeof-undefined': 'error',
|
|
156
|
-
'unicorn/no-unnecessary-array-flat-depth': 'error',
|
|
157
|
-
'unicorn/no-unnecessary-array-splice-count': 'error',
|
|
158
|
-
'unicorn/no-unnecessary-await': 'error',
|
|
159
|
-
'unicorn/no-unnecessary-slice-end': 'error',
|
|
160
|
-
'unicorn/no-unreadable-array-destructuring': 'error',
|
|
161
|
-
'unicorn/no-unreadable-iife': 'error',
|
|
162
|
-
'unicorn/no-useless-collection-argument': 'error',
|
|
163
|
-
'unicorn/no-useless-error-capture-stack-trace': 'error',
|
|
164
|
-
'unicorn/no-useless-fallback-in-spread': 'error',
|
|
165
|
-
'unicorn/no-useless-length-check': 'error',
|
|
166
|
-
'unicorn/no-useless-promise-resolve-reject': 'error',
|
|
167
|
-
'unicorn/no-useless-spread': 'error',
|
|
168
|
-
'unicorn/no-useless-switch-case': 'error',
|
|
169
|
-
'unicorn/no-useless-undefined': 'off',
|
|
170
|
-
'unicorn/no-zero-fractions': 'error',
|
|
171
|
-
'unicorn/number-literal-case': 'error',
|
|
172
|
-
'unicorn/numeric-separators-style': 'error',
|
|
173
|
-
'unicorn/prefer-add-event-listener': 'error',
|
|
174
|
-
'unicorn/prefer-array-find': 'error',
|
|
175
|
-
'unicorn/prefer-array-flat': 'error',
|
|
176
|
-
'unicorn/prefer-array-flat-map': 'error',
|
|
177
|
-
'unicorn/prefer-array-index-of': 'error',
|
|
178
|
-
'unicorn/prefer-array-some': 'error',
|
|
179
|
-
'unicorn/prefer-at': 'error',
|
|
180
|
-
'unicorn/prefer-bigint-literals': 'error',
|
|
181
|
-
'unicorn/prefer-blob-reading-methods': 'error',
|
|
182
|
-
'unicorn/prefer-class-fields': 'error',
|
|
183
|
-
'unicorn/prefer-classlist-toggle': 'error',
|
|
184
|
-
'unicorn/prefer-code-point': 'error',
|
|
185
|
-
'unicorn/prefer-date-now': 'error',
|
|
186
|
-
'unicorn/prefer-default-parameters': 'error',
|
|
187
|
-
'unicorn/prefer-dom-node-append': 'error',
|
|
188
|
-
'unicorn/prefer-dom-node-remove': 'error',
|
|
189
|
-
'unicorn/prefer-dom-node-text-content': 'error',
|
|
190
|
-
'unicorn/prefer-event-target': 'error',
|
|
191
|
-
'unicorn/prefer-export-from': 'error',
|
|
192
|
-
'unicorn/prefer-global-this': 'error',
|
|
193
|
-
'unicorn/prefer-import-meta-properties': 'off',
|
|
194
|
-
'unicorn/prefer-includes': 'error',
|
|
195
|
-
'unicorn/prefer-keyboard-event-key': 'error',
|
|
196
|
-
'unicorn/prefer-logical-operator-over-ternary': 'error',
|
|
197
|
-
'unicorn/prefer-math-min-max': 'error',
|
|
198
|
-
'unicorn/prefer-math-trunc': 'error',
|
|
199
|
-
'unicorn/prefer-modern-dom-apis': 'error',
|
|
200
|
-
'unicorn/prefer-modern-math-apis': 'error',
|
|
201
|
-
'unicorn/prefer-module': 'error',
|
|
202
|
-
'unicorn/prefer-native-coercion-functions': 'error',
|
|
203
|
-
'unicorn/prefer-negative-index': 'error',
|
|
204
|
-
'unicorn/prefer-node-protocol': 'error',
|
|
205
|
-
'unicorn/prefer-number-properties': 'error',
|
|
206
|
-
'unicorn/prefer-object-from-entries': 'error',
|
|
207
|
-
'unicorn/prefer-optional-catch-binding': 'error',
|
|
208
|
-
'unicorn/prefer-prototype-methods': 'error',
|
|
209
|
-
'unicorn/prefer-query-selector': 'error',
|
|
210
|
-
'unicorn/prefer-reflect-apply': 'error',
|
|
211
|
-
'unicorn/prefer-regexp-test': 'error',
|
|
212
|
-
'unicorn/prefer-response-static-json': 'error',
|
|
213
|
-
'unicorn/prefer-set-has': 'error',
|
|
214
|
-
'unicorn/prefer-set-size': 'error',
|
|
215
|
-
'unicorn/prefer-single-call': 'error',
|
|
216
|
-
'unicorn/prefer-spread': 'error',
|
|
217
|
-
'unicorn/prefer-string-raw': 'off',
|
|
218
|
-
'unicorn/prefer-string-replace-all': 'error',
|
|
219
|
-
'unicorn/prefer-string-slice': 'error',
|
|
220
|
-
'unicorn/prefer-string-starts-ends-with': 'error',
|
|
221
|
-
'unicorn/prefer-string-trim-start-end': 'error',
|
|
222
|
-
'unicorn/prefer-structured-clone': 'error',
|
|
223
|
-
'unicorn/prefer-ternary': 'off',
|
|
224
|
-
'unicorn/prefer-top-level-await': 'error',
|
|
225
|
-
'unicorn/prefer-type-error': 'error',
|
|
226
|
-
'unicorn/relative-url-style': 'error',
|
|
227
|
-
'unicorn/require-array-join-separator': 'error',
|
|
228
|
-
'unicorn/require-module-attributes': 'error',
|
|
229
|
-
'unicorn/require-module-specifiers': 'error',
|
|
230
|
-
'unicorn/require-number-to-fixed-digits-argument': 'error',
|
|
231
|
-
'unicorn/require-post-message-target-origin': 'off',
|
|
232
|
-
'unicorn/switch-case-braces': 'error',
|
|
233
|
-
'unicorn/switch-case-break-position': 'error',
|
|
234
|
-
'unicorn/text-encoding-identifier-case': 'error',
|
|
235
|
-
'unicorn/throw-new-error': 'error',
|
|
236
|
-
'default-param-last': 'error',
|
|
237
|
-
'no-array-constructor': 'error',
|
|
238
|
-
'no-empty-function': 'error',
|
|
239
|
-
'no-loop-func': 'error',
|
|
240
|
-
'no-void': [
|
|
241
|
-
'error',
|
|
242
|
-
{
|
|
243
|
-
allowAsStatement: true,
|
|
244
|
-
},
|
|
245
|
-
],
|
|
246
|
-
'no-restricted-imports': [
|
|
247
|
-
'error',
|
|
248
|
-
{
|
|
249
|
-
paths: ['error', 'domain', 'freelist', 'smalloc', 'punycode', 'sys', 'querystring', 'colors'],
|
|
250
|
-
},
|
|
251
|
-
],
|
|
252
|
-
'no-throw-literal': 'off',
|
|
253
|
-
'no-unused-expressions': 'error',
|
|
254
|
-
'no-useless-constructor': 'error',
|
|
255
|
-
'prefer-promise-reject-errors': 'off',
|
|
256
|
-
'default-case': 'off',
|
|
257
|
-
'no-duplicate-imports': 'off',
|
|
258
|
-
'typescript/adjacent-overload-signatures': 'error',
|
|
259
|
-
'typescript/array-type': [
|
|
260
|
-
'error',
|
|
261
|
-
{
|
|
262
|
-
default: 'array-simple',
|
|
263
|
-
},
|
|
264
|
-
],
|
|
265
|
-
'typescript/await-thenable': 'error',
|
|
266
|
-
'typescript/ban-ts-comment': [
|
|
267
|
-
'error',
|
|
268
|
-
{
|
|
269
|
-
'ts-expect-error': 'allow-with-description',
|
|
270
|
-
minimumDescriptionLength: 4,
|
|
271
|
-
},
|
|
272
|
-
],
|
|
273
|
-
'typescript/ban-tslint-comment': 'error',
|
|
274
|
-
'typescript/no-restricted-types': [
|
|
275
|
-
'error',
|
|
276
|
-
{
|
|
277
|
-
types: {
|
|
278
|
-
object: {
|
|
279
|
-
message:
|
|
280
|
-
'The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848',
|
|
281
|
-
fixWith: 'Record<string, unknown>',
|
|
282
|
-
},
|
|
283
|
-
Buffer: {
|
|
284
|
-
message: 'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer',
|
|
285
|
-
suggest: ['Uint8Array'],
|
|
286
|
-
},
|
|
287
|
-
'[]': "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
|
|
288
|
-
'[[]]':
|
|
289
|
-
"Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
|
|
290
|
-
'[[[]]]': "Don't use `[[[]]]`. Use `SomeType[][][]` instead.",
|
|
291
|
-
'[[[[]]]]': 'ur drunk 🤡',
|
|
292
|
-
'[[[[[]]]]]': '🦄💥',
|
|
293
|
-
},
|
|
294
|
-
},
|
|
295
|
-
],
|
|
296
|
-
'typescript/class-literal-property-style': ['error', 'getters'],
|
|
297
|
-
'typescript/consistent-generic-constructors': ['error', 'constructor'],
|
|
298
|
-
'typescript/consistent-indexed-object-style': 'error',
|
|
299
|
-
'typescript/dot-notation': 'error',
|
|
300
|
-
'typescript/consistent-type-assertions': [
|
|
301
|
-
'error',
|
|
302
|
-
{
|
|
303
|
-
assertionStyle: 'as',
|
|
304
|
-
objectLiteralTypeAssertions: 'allow-as-parameter',
|
|
305
|
-
},
|
|
306
|
-
],
|
|
307
|
-
'typescript/consistent-type-definitions': ['error', 'type'],
|
|
308
|
-
'typescript/consistent-type-exports': [
|
|
309
|
-
'error',
|
|
310
|
-
{
|
|
311
|
-
fixMixedExportsWithInlineTypeSpecifier: true,
|
|
312
|
-
},
|
|
313
|
-
],
|
|
314
|
-
'typescript/consistent-type-imports': [
|
|
315
|
-
'error',
|
|
316
|
-
{
|
|
317
|
-
fixStyle: 'inline-type-imports',
|
|
318
|
-
},
|
|
319
|
-
],
|
|
320
|
-
'typescript/no-base-to-string': 'error',
|
|
321
|
-
'typescript/no-array-delete': 'error',
|
|
322
|
-
'typescript/no-confusing-void-expression': 'error',
|
|
323
|
-
'typescript/no-deprecated': 'error',
|
|
324
|
-
'typescript/no-duplicate-enum-values': 'error',
|
|
325
|
-
'typescript/no-duplicate-type-constituents': 'error',
|
|
326
|
-
'typescript/no-dynamic-delete': 'error',
|
|
327
|
-
'typescript/no-empty-interface': [
|
|
328
|
-
'error',
|
|
329
|
-
{
|
|
330
|
-
allowSingleExtends: true,
|
|
331
|
-
},
|
|
332
|
-
],
|
|
333
|
-
'typescript/no-empty-object-type': 'error',
|
|
334
|
-
'typescript/no-extra-non-null-assertion': 'error',
|
|
335
|
-
'typescript/no-extraneous-class': [
|
|
336
|
-
'error',
|
|
337
|
-
{
|
|
338
|
-
allowConstructorOnly: false,
|
|
339
|
-
allowEmpty: false,
|
|
340
|
-
allowStaticOnly: false,
|
|
341
|
-
allowWithDecorator: true,
|
|
342
|
-
},
|
|
343
|
-
],
|
|
344
|
-
'typescript/no-floating-promises': [
|
|
345
|
-
'error',
|
|
346
|
-
{
|
|
347
|
-
checkThenables: true,
|
|
348
|
-
ignoreVoid: true,
|
|
349
|
-
ignoreIIFE: true,
|
|
350
|
-
},
|
|
351
|
-
],
|
|
352
|
-
'typescript/no-for-in-array': 'error',
|
|
353
|
-
'typescript/no-inferrable-types': 'error',
|
|
354
|
-
'typescript/no-meaningless-void-operator': 'error',
|
|
355
|
-
'typescript/no-misused-new': 'error',
|
|
356
|
-
'typescript/no-misused-promises': [
|
|
357
|
-
'error',
|
|
358
|
-
{
|
|
359
|
-
checksConditionals: true,
|
|
360
|
-
checksVoidReturn: false,
|
|
361
|
-
},
|
|
362
|
-
],
|
|
363
|
-
'typescript/no-namespace': 'error',
|
|
364
|
-
'typescript/no-non-null-asserted-nullish-coalescing': 'error',
|
|
365
|
-
'typescript/no-non-null-asserted-optional-chain': 'error',
|
|
366
|
-
'typescript/no-require-imports': 'error',
|
|
367
|
-
'typescript/no-this-alias': [
|
|
368
|
-
'error',
|
|
369
|
-
{
|
|
370
|
-
allowDestructuring: true,
|
|
371
|
-
},
|
|
372
|
-
],
|
|
373
|
-
'typescript/only-throw-error': [
|
|
374
|
-
'error',
|
|
375
|
-
{
|
|
376
|
-
allowThrowingUnknown: true,
|
|
377
|
-
allowThrowingAny: false,
|
|
378
|
-
},
|
|
379
|
-
],
|
|
380
|
-
'typescript/no-unnecessary-boolean-literal-compare': 'error',
|
|
381
|
-
'typescript/no-unnecessary-qualifier': 'error',
|
|
382
|
-
'typescript/no-unnecessary-type-arguments': 'error',
|
|
383
|
-
'typescript/no-unnecessary-type-assertion': 'error',
|
|
384
|
-
'typescript/no-unnecessary-type-constraint': 'error',
|
|
385
|
-
'typescript/no-unsafe-argument': 'error',
|
|
386
|
-
'typescript/no-unsafe-assignment': 'error',
|
|
387
|
-
'typescript/no-unsafe-call': 'error',
|
|
388
|
-
'typescript/no-unsafe-declaration-merging': 'error',
|
|
389
|
-
'typescript/no-unsafe-enum-comparison': 'error',
|
|
390
|
-
'typescript/no-unsafe-function-type': 'error',
|
|
391
|
-
'typescript/no-unsafe-member-access': 'error',
|
|
392
|
-
'typescript/no-unsafe-return': 'error',
|
|
393
|
-
'typescript/no-unsafe-type-assertion': 'error',
|
|
394
|
-
'typescript/no-useless-empty-export': 'error',
|
|
395
|
-
'typescript/no-useless-default-assignment': 'error',
|
|
396
|
-
'typescript/no-wrapper-object-types': 'error',
|
|
397
|
-
'typescript/non-nullable-type-assertion-style': 'error',
|
|
398
|
-
'typescript/prefer-as-const': 'error',
|
|
399
|
-
'typescript/prefer-find': 'error',
|
|
400
|
-
'typescript/prefer-for-of': 'error',
|
|
401
|
-
'typescript/prefer-function-type': 'error',
|
|
402
|
-
'typescript/prefer-includes': 'error',
|
|
403
|
-
'typescript/prefer-literal-enum-member': 'error',
|
|
404
|
-
'typescript/prefer-namespace-keyword': 'error',
|
|
405
|
-
'typescript/prefer-nullish-coalescing': [
|
|
406
|
-
'error',
|
|
407
|
-
{
|
|
408
|
-
ignoreTernaryTests: false,
|
|
409
|
-
ignoreConditionalTests: false,
|
|
410
|
-
ignoreMixedLogicalExpressions: false,
|
|
411
|
-
},
|
|
412
|
-
],
|
|
413
|
-
'typescript/prefer-promise-reject-errors': 'error',
|
|
414
|
-
'typescript/prefer-readonly': 'error',
|
|
415
|
-
'typescript/prefer-reduce-type-parameter': 'error',
|
|
416
|
-
'typescript/prefer-string-starts-ends-with': 'error',
|
|
417
|
-
'typescript/promise-function-async': 'error',
|
|
418
|
-
'typescript/related-getter-setter-pairs': 'error',
|
|
419
|
-
'typescript/restrict-plus-operands': [
|
|
420
|
-
'error',
|
|
421
|
-
{
|
|
422
|
-
allowAny: false,
|
|
423
|
-
},
|
|
424
|
-
],
|
|
425
|
-
'typescript/restrict-template-expressions': [
|
|
426
|
-
'error',
|
|
427
|
-
{
|
|
428
|
-
allowNumber: true,
|
|
429
|
-
},
|
|
430
|
-
],
|
|
431
|
-
'typescript/return-await': 'error',
|
|
432
|
-
'typescript/require-array-sort-compare': [
|
|
433
|
-
'error',
|
|
434
|
-
{
|
|
435
|
-
ignoreStringArrays: true,
|
|
436
|
-
},
|
|
437
|
-
],
|
|
438
|
-
'typescript/strict-void-return': 'error',
|
|
439
|
-
'typescript/switch-exhaustiveness-check': [
|
|
440
|
-
'error',
|
|
441
|
-
{
|
|
442
|
-
allowDefaultCaseForExhaustiveSwitch: false,
|
|
443
|
-
requireDefaultForNonUnion: true,
|
|
444
|
-
},
|
|
445
|
-
],
|
|
446
|
-
'typescript/triple-slash-reference': [
|
|
447
|
-
'error',
|
|
448
|
-
{
|
|
449
|
-
path: 'never',
|
|
450
|
-
types: 'never',
|
|
451
|
-
lib: 'never',
|
|
452
|
-
},
|
|
453
|
-
],
|
|
454
|
-
'typescript/prefer-regexp-exec': 'error',
|
|
455
|
-
'typescript/prefer-return-this-type': 'error',
|
|
456
|
-
'typescript/unified-signatures': [
|
|
457
|
-
'error',
|
|
458
|
-
{
|
|
459
|
-
ignoreDifferentlyNamedParameters: true,
|
|
460
|
-
},
|
|
461
|
-
],
|
|
462
|
-
'typescript/use-unknown-in-catch-callback-variable': 'error',
|
|
463
|
-
'capitalized-comments': 'off',
|
|
464
|
-
'import/first': 'error',
|
|
465
|
-
'import/no-unassigned-import': 'off',
|
|
466
|
-
'import/extensions': [
|
|
467
|
-
'error',
|
|
468
|
-
'always',
|
|
469
|
-
{
|
|
470
|
-
ignorePackages: true,
|
|
471
|
-
},
|
|
472
|
-
],
|
|
473
|
-
'import/no-absolute-path': 'error',
|
|
474
|
-
'import/no-anonymous-default-export': 'off',
|
|
475
|
-
'import/no-named-default': 'error',
|
|
476
|
-
'import/no-webpack-loader-syntax': 'error',
|
|
477
|
-
'import/no-self-import': 'error',
|
|
478
|
-
'import/no-cycle': 'off',
|
|
479
|
-
'import/newline-after-import': 'error',
|
|
480
|
-
'import/no-amd': 'error',
|
|
481
|
-
'import/no-empty-named-blocks': 'error',
|
|
482
|
-
'import/no-mutable-exports': 'error',
|
|
483
|
-
'promise/prefer-await-to-then': 'error',
|
|
484
|
-
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
|
|
13
|
+
rules: {
|
|
14
|
+
// typescript/require-await (type-aware) supersedes it and exempts
|
|
15
|
+
// promise-returning bodies; with the base rule on, promise-function-async
|
|
16
|
+
// + return-await leave no compliant shape for `async fn() { return promise; }`.
|
|
17
|
+
'require-await': 'off',
|
|
18
|
+
|
|
19
|
+
'typescript/adjacent-overload-signatures': 'error',
|
|
20
|
+
'typescript/array-type': [
|
|
21
|
+
'error',
|
|
22
|
+
{
|
|
23
|
+
default: 'array-simple',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
'typescript/ban-ts-comment': [
|
|
27
|
+
'error',
|
|
28
|
+
{
|
|
29
|
+
'ts-expect-error': 'allow-with-description',
|
|
30
|
+
minimumDescriptionLength: 4,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
'typescript/ban-tslint-comment': 'error',
|
|
34
|
+
'typescript/class-literal-property-style': ['error', 'getters'],
|
|
35
|
+
'typescript/consistent-generic-constructors': ['error', 'constructor'],
|
|
36
|
+
'typescript/consistent-indexed-object-style': 'error',
|
|
37
|
+
'typescript/consistent-type-assertions': [
|
|
38
|
+
'error',
|
|
39
|
+
{
|
|
40
|
+
assertionStyle: 'as',
|
|
41
|
+
objectLiteralTypeAssertions: 'allow-as-parameter',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
'typescript/consistent-type-definitions': ['error', 'type'],
|
|
45
|
+
'typescript/consistent-type-exports': [
|
|
46
|
+
'error',
|
|
47
|
+
{
|
|
48
|
+
fixMixedExportsWithInlineTypeSpecifier: true,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
'typescript/consistent-type-imports': [
|
|
52
|
+
'error',
|
|
53
|
+
{
|
|
54
|
+
fixStyle: 'inline-type-imports',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
'typescript/dot-notation': 'error',
|
|
58
|
+
'typescript/no-dynamic-delete': 'error',
|
|
59
|
+
'typescript/no-empty-interface': [
|
|
60
|
+
'error',
|
|
61
|
+
{
|
|
62
|
+
allowSingleExtends: true,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
'typescript/no-empty-object-type': 'error',
|
|
66
|
+
'typescript/no-extraneous-class': [
|
|
67
|
+
'error',
|
|
68
|
+
{
|
|
69
|
+
allowConstructorOnly: false,
|
|
70
|
+
allowEmpty: false,
|
|
71
|
+
allowStaticOnly: false,
|
|
72
|
+
allowWithDecorator: true,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
'typescript/no-floating-promises': [
|
|
76
|
+
'error',
|
|
77
|
+
{
|
|
78
|
+
checkThenables: true,
|
|
79
|
+
ignoreVoid: true,
|
|
80
|
+
ignoreIIFE: true,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
'typescript/no-inferrable-types': 'error',
|
|
84
|
+
'typescript/no-misused-promises': [
|
|
85
|
+
'error',
|
|
86
|
+
{
|
|
87
|
+
checksConditionals: true,
|
|
88
|
+
checksVoidReturn: false,
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
'typescript/no-namespace': 'error',
|
|
92
|
+
'typescript/no-non-null-asserted-nullish-coalescing': 'error',
|
|
93
|
+
'typescript/no-require-imports': 'error',
|
|
94
|
+
'typescript/no-restricted-types': [
|
|
95
|
+
'error',
|
|
96
|
+
{
|
|
97
|
+
types: {
|
|
98
|
+
object: {
|
|
99
|
+
message:
|
|
100
|
+
'The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848',
|
|
101
|
+
fixWith: 'Record<string, unknown>',
|
|
102
|
+
},
|
|
103
|
+
Buffer: {
|
|
104
|
+
message: 'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer',
|
|
105
|
+
suggest: ['Uint8Array'],
|
|
106
|
+
},
|
|
107
|
+
'[]': "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
|
|
108
|
+
'[[]]':
|
|
109
|
+
"Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
|
|
110
|
+
'[[[]]]': "Don't use `[[[]]]`. Use `SomeType[][][]` instead.",
|
|
111
|
+
'[[[[]]]]': 'ur drunk 🤡',
|
|
112
|
+
'[[[[[]]]]]': '🦄💥',
|
|
113
|
+
},
|
|
485
114
|
},
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
115
|
+
],
|
|
116
|
+
'typescript/no-this-alias': [
|
|
117
|
+
'error',
|
|
118
|
+
{
|
|
119
|
+
allowDestructuring: true,
|
|
489
120
|
},
|
|
490
|
-
|
|
491
|
-
|
|
121
|
+
],
|
|
122
|
+
'typescript/no-unnecessary-qualifier': 'error',
|
|
123
|
+
'typescript/non-nullable-type-assertion-style': 'error',
|
|
124
|
+
'typescript/only-throw-error': [
|
|
125
|
+
'error',
|
|
126
|
+
{
|
|
127
|
+
allowThrowingUnknown: true,
|
|
128
|
+
allowThrowingAny: false,
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
'typescript/prefer-find': 'error',
|
|
132
|
+
'typescript/prefer-for-of': 'error',
|
|
133
|
+
'typescript/prefer-function-type': 'error',
|
|
134
|
+
'typescript/prefer-literal-enum-member': 'error',
|
|
135
|
+
'typescript/prefer-nullish-coalescing': [
|
|
136
|
+
'error',
|
|
137
|
+
{
|
|
138
|
+
ignoreTernaryTests: false,
|
|
139
|
+
ignoreConditionalTests: false,
|
|
140
|
+
ignoreMixedLogicalExpressions: false,
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
'typescript/prefer-readonly': 'error',
|
|
144
|
+
'typescript/prefer-reduce-type-parameter': 'error',
|
|
145
|
+
'typescript/prefer-regexp-exec': 'error',
|
|
146
|
+
'typescript/prefer-return-this-type': 'error',
|
|
147
|
+
'typescript/prefer-string-starts-ends-with': 'error',
|
|
148
|
+
'typescript/promise-function-async': 'error',
|
|
149
|
+
'typescript/require-array-sort-compare': [
|
|
150
|
+
'error',
|
|
151
|
+
{
|
|
152
|
+
ignoreStringArrays: true,
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
'typescript/restrict-plus-operands': [
|
|
156
|
+
'error',
|
|
157
|
+
{
|
|
158
|
+
allowAny: false,
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
'typescript/restrict-template-expressions': [
|
|
162
|
+
'error',
|
|
163
|
+
{
|
|
164
|
+
allowNumber: true,
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
'typescript/switch-exhaustiveness-check': [
|
|
168
|
+
'error',
|
|
169
|
+
{
|
|
170
|
+
allowDefaultCaseForExhaustiveSwitch: false,
|
|
171
|
+
requireDefaultForNonUnion: true,
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
'typescript/triple-slash-reference': [
|
|
175
|
+
'error',
|
|
176
|
+
{
|
|
177
|
+
path: 'never',
|
|
178
|
+
types: 'never',
|
|
179
|
+
lib: 'never',
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
'typescript/unified-signatures': [
|
|
183
|
+
'error',
|
|
184
|
+
{
|
|
185
|
+
ignoreDifferentlyNamedParameters: true,
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
'typescript/use-unknown-in-catch-callback-variable': 'error',
|
|
189
|
+
},
|
|
492
190
|
};
|
|
493
191
|
|
|
494
192
|
/**
|
|
@@ -497,21 +195,16 @@ const typescript = {
|
|
|
497
195
|
* @type {import('oxlint').OxlintConfig}
|
|
498
196
|
*/
|
|
499
197
|
export const typescriptUnsafe = {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
'typescript/no-unsafe-return': 'off',
|
|
511
|
-
'typescript/no-unsafe-type-assertion': 'off',
|
|
512
|
-
},
|
|
513
|
-
},
|
|
514
|
-
],
|
|
198
|
+
rules: {
|
|
199
|
+
'typescript/no-unsafe-argument': 'off',
|
|
200
|
+
'typescript/no-unsafe-assignment': 'off',
|
|
201
|
+
'typescript/no-unsafe-call': 'off',
|
|
202
|
+
'typescript/no-unsafe-declaration-merging': 'off',
|
|
203
|
+
'typescript/no-unsafe-enum-comparison': 'off',
|
|
204
|
+
'typescript/no-unsafe-member-access': 'off',
|
|
205
|
+
'typescript/no-unsafe-return': 'off',
|
|
206
|
+
'typescript/no-unsafe-type-assertion': 'off',
|
|
207
|
+
},
|
|
515
208
|
};
|
|
516
209
|
|
|
517
210
|
export default typescript;
|