@standard-config/oxlint 1.8.0 → 2.0.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 +112 -18
- package/dist/index.d.mts +57 -19
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +264 -186
- package/dist/index.mjs.map +1 -1
- package/package.json +24 -13
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { defineConfig as defineConfig$1 } from "oxlint";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
2
3
|
//#region src/config-base/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* Base config entry containing core rules. No overrides included.
|
|
6
|
+
*/
|
|
3
7
|
const config = {
|
|
4
8
|
plugins: [
|
|
5
9
|
"eslint",
|
|
@@ -12,14 +16,6 @@ const config = {
|
|
|
12
16
|
"unicorn",
|
|
13
17
|
"vitest"
|
|
14
18
|
],
|
|
15
|
-
categories: {
|
|
16
|
-
correctness: "error",
|
|
17
|
-
pedantic: "error",
|
|
18
|
-
perf: "error",
|
|
19
|
-
restriction: "error",
|
|
20
|
-
style: "error",
|
|
21
|
-
suspicious: "error"
|
|
22
|
-
},
|
|
23
19
|
env: {
|
|
24
20
|
browser: true,
|
|
25
21
|
node: true
|
|
@@ -41,16 +37,27 @@ const config = {
|
|
|
41
37
|
"eslint/curly": ["error", "all"],
|
|
42
38
|
"eslint/default-case": "off",
|
|
43
39
|
"eslint/default-case-last": "error",
|
|
40
|
+
"eslint/default-param-last": "error",
|
|
44
41
|
"eslint/eqeqeq": "error",
|
|
42
|
+
"eslint/for-direction": "error",
|
|
43
|
+
"eslint/func-name-matching": [
|
|
44
|
+
"error",
|
|
45
|
+
"never",
|
|
46
|
+
{ considerPropertyDescriptor: true }
|
|
47
|
+
],
|
|
45
48
|
"eslint/func-names": "off",
|
|
46
49
|
"eslint/func-style": [
|
|
47
50
|
"error",
|
|
48
51
|
"declaration",
|
|
49
52
|
{ allowArrowFunctions: true }
|
|
50
53
|
],
|
|
54
|
+
"eslint/getter-return": "error",
|
|
51
55
|
"eslint/grouped-accessor-pairs": ["error", "getBeforeSet"],
|
|
56
|
+
"eslint/guard-for-in": "error",
|
|
52
57
|
"eslint/id-length": "off",
|
|
58
|
+
"eslint/id-match": "off",
|
|
53
59
|
"eslint/init-declarations": "off",
|
|
60
|
+
"eslint/logical-assignment-operators": "off",
|
|
54
61
|
"eslint/max-classes-per-file": "off",
|
|
55
62
|
"eslint/max-depth": "off",
|
|
56
63
|
"eslint/max-lines": "off",
|
|
@@ -59,70 +66,113 @@ const config = {
|
|
|
59
66
|
"eslint/max-params": "off",
|
|
60
67
|
"eslint/max-statements": "off",
|
|
61
68
|
"eslint/new-cap": "off",
|
|
69
|
+
"eslint/no-alert": "off",
|
|
70
|
+
"eslint/no-array-constructor": "error",
|
|
71
|
+
"eslint/no-async-promise-executor": "error",
|
|
62
72
|
"eslint/no-await-in-loop": "off",
|
|
63
73
|
"eslint/no-bitwise": "error",
|
|
74
|
+
"eslint/no-caller": "error",
|
|
75
|
+
"eslint/no-case-declarations": "error",
|
|
64
76
|
"eslint/no-class-assign": "off",
|
|
77
|
+
"eslint/no-compare-neg-zero": "error",
|
|
65
78
|
"eslint/no-cond-assign": "error",
|
|
66
79
|
"eslint/no-console": "warn",
|
|
67
80
|
"eslint/no-const-assign": "off",
|
|
81
|
+
"eslint/no-constant-binary-expression": "error",
|
|
68
82
|
"eslint/no-constant-condition": "off",
|
|
83
|
+
"eslint/no-constructor-return": "error",
|
|
69
84
|
"eslint/no-continue": "off",
|
|
85
|
+
"eslint/no-control-regex": "error",
|
|
86
|
+
"eslint/no-debugger": "error",
|
|
70
87
|
"eslint/no-delete-var": "off",
|
|
71
88
|
"eslint/no-div-regex": "off",
|
|
72
89
|
"eslint/no-dupe-class-members": "off",
|
|
90
|
+
"eslint/no-dupe-else-if": "error",
|
|
73
91
|
"eslint/no-dupe-keys": "off",
|
|
92
|
+
"eslint/no-duplicate-case": "error",
|
|
74
93
|
"eslint/no-duplicate-imports": "off",
|
|
75
94
|
"eslint/no-else-return": ["error", { allowElseIf: false }],
|
|
76
95
|
"eslint/no-empty": ["error", { allowEmptyCatch: true }],
|
|
96
|
+
"eslint/no-empty-character-class": "error",
|
|
77
97
|
"eslint/no-empty-function": "warn",
|
|
78
98
|
"eslint/no-empty-pattern": "error",
|
|
99
|
+
"eslint/no-empty-static-block": "error",
|
|
79
100
|
"eslint/no-eq-null": "error",
|
|
80
101
|
"eslint/no-eval": "off",
|
|
102
|
+
"eslint/no-ex-assign": "error",
|
|
81
103
|
"eslint/no-extend-native": "error",
|
|
82
104
|
"eslint/no-extra-bind": "warn",
|
|
83
105
|
"eslint/no-extra-boolean-cast": "error",
|
|
106
|
+
"eslint/no-extra-label": "error",
|
|
84
107
|
"eslint/no-fallthrough": "off",
|
|
85
108
|
"eslint/no-func-assign": "off",
|
|
86
109
|
"eslint/no-global-assign": "error",
|
|
87
110
|
"eslint/no-implicit-coercion": "error",
|
|
111
|
+
"eslint/no-implicit-globals": "error",
|
|
112
|
+
"eslint/no-implied-eval": "error",
|
|
88
113
|
"eslint/no-import-assign": "off",
|
|
89
114
|
"eslint/no-inline-comments": "off",
|
|
90
115
|
"eslint/no-inner-declarations": "off",
|
|
91
116
|
"eslint/no-invalid-regexp": "error",
|
|
92
117
|
"eslint/no-irregular-whitespace": "off",
|
|
93
118
|
"eslint/no-iterator": "off",
|
|
119
|
+
"eslint/no-label-var": "off",
|
|
94
120
|
"eslint/no-labels": "off",
|
|
121
|
+
"eslint/no-lone-blocks": "off",
|
|
95
122
|
"eslint/no-lonely-if": "warn",
|
|
123
|
+
"eslint/no-loop-func": "error",
|
|
124
|
+
"eslint/no-loss-of-precision": "error",
|
|
96
125
|
"eslint/no-magic-numbers": "off",
|
|
97
126
|
"eslint/no-misleading-character-class": "error",
|
|
98
127
|
"eslint/no-multi-assign": "error",
|
|
99
128
|
"eslint/no-multi-str": "off",
|
|
100
129
|
"eslint/no-negated-condition": "off",
|
|
101
|
-
"eslint/no-nested-ternary": "
|
|
130
|
+
"eslint/no-nested-ternary": "off",
|
|
131
|
+
"eslint/no-new": "off",
|
|
132
|
+
"eslint/no-new-func": "error",
|
|
102
133
|
"eslint/no-new-native-nonconstructor": "off",
|
|
134
|
+
"eslint/no-new-wrappers": "error",
|
|
135
|
+
"eslint/no-nonoctal-decimal-escape": "error",
|
|
103
136
|
"eslint/no-obj-calls": "off",
|
|
137
|
+
"eslint/no-object-constructor": "error",
|
|
104
138
|
"eslint/no-param-reassign": "error",
|
|
105
139
|
"eslint/no-plusplus": "off",
|
|
106
140
|
"eslint/no-promise-executor-return": "error",
|
|
141
|
+
"eslint/no-proto": "error",
|
|
142
|
+
"eslint/no-prototype-builtins": "off",
|
|
107
143
|
"eslint/no-redeclare": "off",
|
|
108
144
|
"eslint/no-regex-spaces": "error",
|
|
145
|
+
"eslint/no-restricted-exports": "off",
|
|
109
146
|
"eslint/no-restricted-globals": "off",
|
|
110
147
|
"eslint/no-restricted-imports": "off",
|
|
148
|
+
"eslint/no-restricted-properties": "off",
|
|
111
149
|
"eslint/no-return-assign": ["error", "always"],
|
|
150
|
+
"eslint/no-script-url": "off",
|
|
112
151
|
"eslint/no-self-assign": ["error", { props: true }],
|
|
152
|
+
"eslint/no-self-compare": "error",
|
|
113
153
|
"eslint/no-sequences": "error",
|
|
114
154
|
"eslint/no-setter-return": "off",
|
|
115
155
|
"eslint/no-shadow": "off",
|
|
116
156
|
"eslint/no-shadow-restricted-names": "error",
|
|
157
|
+
"eslint/no-sparse-arrays": "error",
|
|
158
|
+
"eslint/no-template-curly-in-string": "warn",
|
|
117
159
|
"eslint/no-ternary": "off",
|
|
118
160
|
"eslint/no-this-before-super": "off",
|
|
161
|
+
"eslint/no-throw-literal": "error",
|
|
162
|
+
"eslint/no-unassigned-vars": "error",
|
|
119
163
|
"eslint/no-undef": "off",
|
|
120
164
|
"eslint/no-undefined": "off",
|
|
165
|
+
"eslint/no-underscore-dangle": "off",
|
|
121
166
|
"eslint/no-unexpected-multiline": "off",
|
|
167
|
+
"eslint/no-unmodified-loop-condition": "error",
|
|
122
168
|
"eslint/no-unneeded-ternary": "warn",
|
|
123
|
-
"eslint/no-
|
|
169
|
+
"eslint/no-unreachable": "off",
|
|
170
|
+
"eslint/no-unsafe-finally": "error",
|
|
171
|
+
"eslint/no-unsafe-negation": "off",
|
|
124
172
|
"eslint/no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
|
|
125
173
|
"eslint/no-unused-expressions": ["error", { enforceForJSX: true }],
|
|
174
|
+
"eslint/no-unused-labels": "error",
|
|
175
|
+
"eslint/no-unused-private-class-members": "error",
|
|
126
176
|
"eslint/no-unused-vars": ["warn", {
|
|
127
177
|
argsIgnorePattern: "^_",
|
|
128
178
|
caughtErrorsIgnorePattern: "^_",
|
|
@@ -130,7 +180,12 @@ const config = {
|
|
|
130
180
|
varsIgnorePattern: "^_"
|
|
131
181
|
}],
|
|
132
182
|
"eslint/no-use-before-define": "off",
|
|
183
|
+
"eslint/no-useless-assignment": "warn",
|
|
184
|
+
"eslint/no-useless-backreference": "error",
|
|
185
|
+
"eslint/no-useless-call": "error",
|
|
186
|
+
"eslint/no-useless-catch": "error",
|
|
133
187
|
"eslint/no-useless-computed-key": "warn",
|
|
188
|
+
"eslint/no-useless-concat": "error",
|
|
134
189
|
"eslint/no-useless-constructor": "off",
|
|
135
190
|
"eslint/no-useless-escape": "warn",
|
|
136
191
|
"eslint/no-useless-rename": "warn",
|
|
@@ -138,19 +193,31 @@ const config = {
|
|
|
138
193
|
"eslint/no-var": "error",
|
|
139
194
|
"eslint/no-void": "off",
|
|
140
195
|
"eslint/no-warning-comments": "off",
|
|
196
|
+
"eslint/no-with": "error",
|
|
197
|
+
"eslint/object-shorthand": ["error", "always"],
|
|
141
198
|
"eslint/operator-assignment": ["warn", "always"],
|
|
199
|
+
"eslint/prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
|
|
142
200
|
"eslint/prefer-const": "error",
|
|
143
201
|
"eslint/prefer-destructuring": ["error", { enforceForRenamedProperties: false }],
|
|
144
202
|
"eslint/prefer-exponentiation-operator": "warn",
|
|
203
|
+
"eslint/prefer-named-capture-group": "off",
|
|
145
204
|
"eslint/prefer-numeric-literals": "off",
|
|
205
|
+
"eslint/prefer-object-has-own": "error",
|
|
206
|
+
"eslint/prefer-object-spread": "error",
|
|
146
207
|
"eslint/prefer-promise-reject-errors": "off",
|
|
208
|
+
"eslint/prefer-regex-literals": "warn",
|
|
209
|
+
"eslint/prefer-rest-params": "error",
|
|
147
210
|
"eslint/prefer-spread": "warn",
|
|
211
|
+
"eslint/prefer-template": "error",
|
|
148
212
|
"eslint/preserve-caught-error": "error",
|
|
149
213
|
"eslint/radix": "error",
|
|
150
214
|
"eslint/require-await": "off",
|
|
215
|
+
"eslint/require-unicode-regexp": "off",
|
|
216
|
+
"eslint/require-yield": "error",
|
|
151
217
|
"eslint/sort-imports": "off",
|
|
152
218
|
"eslint/sort-keys": "off",
|
|
153
219
|
"eslint/sort-vars": "off",
|
|
220
|
+
"eslint/symbol-description": "error",
|
|
154
221
|
"eslint/unicode-bom": ["error", "never"],
|
|
155
222
|
"eslint/use-isnan": "error",
|
|
156
223
|
"eslint/valid-typeof": ["error", { requireStringLiterals: false }],
|
|
@@ -168,6 +235,7 @@ const config = {
|
|
|
168
235
|
"import/group-exports": "off",
|
|
169
236
|
"import/max-dependencies": "off",
|
|
170
237
|
"import/namespace": "error",
|
|
238
|
+
"import/newline-after-import": "error",
|
|
171
239
|
"import/no-absolute-path": "error",
|
|
172
240
|
"import/no-amd": "off",
|
|
173
241
|
"import/no-anonymous-default-export": "error",
|
|
@@ -225,6 +293,7 @@ const config = {
|
|
|
225
293
|
"jest/prefer-each": "off",
|
|
226
294
|
"jest/prefer-ending-with-an-expect": "off",
|
|
227
295
|
"jest/prefer-equality-matcher": "off",
|
|
296
|
+
"jest/prefer-expect-assertions": "off",
|
|
228
297
|
"jest/prefer-expect-resolves": "off",
|
|
229
298
|
"jest/prefer-hooks-in-order": "off",
|
|
230
299
|
"jest/prefer-hooks-on-top": "off",
|
|
@@ -249,6 +318,7 @@ const config = {
|
|
|
249
318
|
"jest/valid-expect": "off",
|
|
250
319
|
"jest/valid-expect-in-promise": "off",
|
|
251
320
|
"jest/valid-title": "off",
|
|
321
|
+
"node/callback-return": "off",
|
|
252
322
|
"node/global-require": "off",
|
|
253
323
|
"node/handle-callback-err": ["error", "error"],
|
|
254
324
|
"node/no-exports-assign": "off",
|
|
@@ -314,7 +384,7 @@ const config = {
|
|
|
314
384
|
"typescript/class-literal-property-style": ["error", "fields"],
|
|
315
385
|
"typescript/consistent-generic-constructors": ["error", "constructor"],
|
|
316
386
|
"typescript/consistent-indexed-object-style": ["error", "record"],
|
|
317
|
-
"typescript/consistent-return": "
|
|
387
|
+
"typescript/consistent-return": "off",
|
|
318
388
|
"typescript/consistent-type-assertions": ["error", { assertionStyle: "as" }],
|
|
319
389
|
"typescript/consistent-type-definitions": ["error", "type"],
|
|
320
390
|
"typescript/consistent-type-exports": "error",
|
|
@@ -324,7 +394,9 @@ const config = {
|
|
|
324
394
|
}],
|
|
325
395
|
"typescript/dot-notation": "warn",
|
|
326
396
|
"typescript/explicit-function-return-type": "off",
|
|
397
|
+
"typescript/explicit-member-accessibility": ["error", { accessibility: "no-public" }],
|
|
327
398
|
"typescript/explicit-module-boundary-types": ["error", { allowArgumentsExplicitlyTypedAsAny: true }],
|
|
399
|
+
"typescript/method-signature-style": ["error", "property"],
|
|
328
400
|
"typescript/no-array-delete": "off",
|
|
329
401
|
"typescript/no-base-to-string": "error",
|
|
330
402
|
"typescript/no-confusing-non-null-assertion": "error",
|
|
@@ -343,7 +415,7 @@ const config = {
|
|
|
343
415
|
"typescript/no-implied-eval": "error",
|
|
344
416
|
"typescript/no-import-type-side-effects": "error",
|
|
345
417
|
"typescript/no-inferrable-types": "warn",
|
|
346
|
-
"typescript/no-invalid-void-type": "
|
|
418
|
+
"typescript/no-invalid-void-type": "off",
|
|
347
419
|
"typescript/no-meaningless-void-operator": "warn",
|
|
348
420
|
"typescript/no-misused-new": "error",
|
|
349
421
|
"typescript/no-misused-promises": ["error", {
|
|
@@ -415,6 +487,7 @@ const config = {
|
|
|
415
487
|
"typescript/restrict-template-expressions": ["error", { allowNullish: true }],
|
|
416
488
|
"typescript/return-await": ["error", "in-try-catch"],
|
|
417
489
|
"typescript/strict-boolean-expressions": "off",
|
|
490
|
+
"typescript/strict-void-return": "error",
|
|
418
491
|
"typescript/switch-exhaustiveness-check": ["error", {
|
|
419
492
|
allowDefaultCaseForExhaustiveSwitch: false,
|
|
420
493
|
considerDefaultExhaustiveForUnions: true,
|
|
@@ -437,10 +510,11 @@ const config = {
|
|
|
437
510
|
"unicorn/escape-case": "error",
|
|
438
511
|
"unicorn/explicit-length-check": "error",
|
|
439
512
|
"unicorn/filename-case": "off",
|
|
513
|
+
"unicorn/import-style": "off",
|
|
440
514
|
"unicorn/new-for-builtins": "error",
|
|
441
515
|
"unicorn/no-abusive-eslint-disable": "error",
|
|
442
516
|
"unicorn/no-accessor-recursion": "error",
|
|
443
|
-
"unicorn/no-anonymous-default-export": "
|
|
517
|
+
"unicorn/no-anonymous-default-export": "off",
|
|
444
518
|
"unicorn/no-array-callback-reference": "off",
|
|
445
519
|
"unicorn/no-array-for-each": "error",
|
|
446
520
|
"unicorn/no-array-method-this-argument": "error",
|
|
@@ -459,8 +533,9 @@ const config = {
|
|
|
459
533
|
"unicorn/no-invalid-fetch-options": "error",
|
|
460
534
|
"unicorn/no-invalid-remove-event-listener": "error",
|
|
461
535
|
"unicorn/no-length-as-slice-end": "error",
|
|
462
|
-
"unicorn/no-lonely-if": "
|
|
536
|
+
"unicorn/no-lonely-if": "warn",
|
|
463
537
|
"unicorn/no-magic-array-flat-depth": "error",
|
|
538
|
+
"unicorn/no-negated-condition": "off",
|
|
464
539
|
"unicorn/no-negation-in-equality-check": "error",
|
|
465
540
|
"unicorn/no-nested-ternary": "error",
|
|
466
541
|
"unicorn/no-new-array": "error",
|
|
@@ -511,7 +586,7 @@ const config = {
|
|
|
511
586
|
"unicorn/prefer-event-target": "error",
|
|
512
587
|
"unicorn/prefer-global-this": "error",
|
|
513
588
|
"unicorn/prefer-import-meta-properties": "error",
|
|
514
|
-
"unicorn/prefer-includes": "
|
|
589
|
+
"unicorn/prefer-includes": "off",
|
|
515
590
|
"unicorn/prefer-keyboard-event-key": "error",
|
|
516
591
|
"unicorn/prefer-logical-operator-over-ternary": "error",
|
|
517
592
|
"unicorn/prefer-math-min-max": "error",
|
|
@@ -535,11 +610,11 @@ const config = {
|
|
|
535
610
|
"unicorn/prefer-response-static-json": "error",
|
|
536
611
|
"unicorn/prefer-set-has": "error",
|
|
537
612
|
"unicorn/prefer-set-size": "error",
|
|
538
|
-
"unicorn/prefer-spread": "
|
|
613
|
+
"unicorn/prefer-spread": "warn",
|
|
539
614
|
"unicorn/prefer-string-raw": "error",
|
|
540
615
|
"unicorn/prefer-string-replace-all": "error",
|
|
541
616
|
"unicorn/prefer-string-slice": "error",
|
|
542
|
-
"unicorn/prefer-string-starts-ends-with": "
|
|
617
|
+
"unicorn/prefer-string-starts-ends-with": "warn",
|
|
543
618
|
"unicorn/prefer-string-trim-start-end": "error",
|
|
544
619
|
"unicorn/prefer-structured-clone": "off",
|
|
545
620
|
"unicorn/prefer-ternary": ["error", "always"],
|
|
@@ -557,30 +632,84 @@ const config = {
|
|
|
557
632
|
"unicorn/throw-new-error": "error",
|
|
558
633
|
"vitest/consistent-each-for": "off",
|
|
559
634
|
"vitest/consistent-test-filename": "off",
|
|
635
|
+
"vitest/consistent-test-it": "off",
|
|
560
636
|
"vitest/consistent-vitest-vi": "off",
|
|
637
|
+
"vitest/expect-expect": "off",
|
|
561
638
|
"vitest/hoisted-apis-on-top": "off",
|
|
639
|
+
"vitest/max-expects": "off",
|
|
640
|
+
"vitest/max-nested-describe": "off",
|
|
641
|
+
"vitest/no-alias-methods": "off",
|
|
642
|
+
"vitest/no-commented-out-tests": "off",
|
|
643
|
+
"vitest/no-conditional-expect": "off",
|
|
644
|
+
"vitest/no-conditional-in-test": "off",
|
|
562
645
|
"vitest/no-conditional-tests": "off",
|
|
646
|
+
"vitest/no-disabled-tests": "off",
|
|
647
|
+
"vitest/no-duplicate-hooks": "off",
|
|
648
|
+
"vitest/no-focused-tests": "off",
|
|
649
|
+
"vitest/no-hooks": "off",
|
|
650
|
+
"vitest/no-identical-title": "off",
|
|
563
651
|
"vitest/no-import-node-test": "off",
|
|
564
652
|
"vitest/no-importing-vitest-globals": "off",
|
|
653
|
+
"vitest/no-interpolation-in-snapshots": "off",
|
|
654
|
+
"vitest/no-large-snapshots": "off",
|
|
655
|
+
"vitest/no-mocks-import": "off",
|
|
656
|
+
"vitest/no-restricted-matchers": "off",
|
|
657
|
+
"vitest/no-restricted-vi-methods": "off",
|
|
658
|
+
"vitest/no-standalone-expect": "off",
|
|
659
|
+
"vitest/no-test-prefixes": "off",
|
|
660
|
+
"vitest/no-test-return-statement": "off",
|
|
661
|
+
"vitest/no-unneeded-async-expect-function": "off",
|
|
662
|
+
"vitest/padding-around-after-all-blocks": "off",
|
|
565
663
|
"vitest/prefer-called-exactly-once-with": "off",
|
|
566
664
|
"vitest/prefer-called-once": "off",
|
|
567
665
|
"vitest/prefer-called-times": "off",
|
|
666
|
+
"vitest/prefer-called-with": "off",
|
|
667
|
+
"vitest/prefer-comparison-matcher": "off",
|
|
568
668
|
"vitest/prefer-describe-function-title": "off",
|
|
669
|
+
"vitest/prefer-each": "off",
|
|
670
|
+
"vitest/prefer-equality-matcher": "off",
|
|
671
|
+
"vitest/prefer-expect-assertions": "off",
|
|
672
|
+
"vitest/prefer-expect-resolves": "off",
|
|
569
673
|
"vitest/prefer-expect-type-of": "off",
|
|
674
|
+
"vitest/prefer-hooks-in-order": "off",
|
|
675
|
+
"vitest/prefer-hooks-on-top": "off",
|
|
570
676
|
"vitest/prefer-import-in-mock": "off",
|
|
571
677
|
"vitest/prefer-importing-vitest-globals": "off",
|
|
678
|
+
"vitest/prefer-lowercase-title": "off",
|
|
679
|
+
"vitest/prefer-mock-promise-shorthand": "off",
|
|
680
|
+
"vitest/prefer-mock-return-shorthand": "off",
|
|
681
|
+
"vitest/prefer-snapshot-hint": "off",
|
|
682
|
+
"vitest/prefer-spy-on": "off",
|
|
572
683
|
"vitest/prefer-strict-boolean-matchers": "off",
|
|
684
|
+
"vitest/prefer-strict-equal": "off",
|
|
685
|
+
"vitest/prefer-to-be": "off",
|
|
573
686
|
"vitest/prefer-to-be-falsy": "off",
|
|
574
687
|
"vitest/prefer-to-be-object": "off",
|
|
575
688
|
"vitest/prefer-to-be-truthy": "off",
|
|
689
|
+
"vitest/prefer-to-contain": "off",
|
|
690
|
+
"vitest/prefer-to-have-been-called-times": "off",
|
|
691
|
+
"vitest/prefer-to-have-length": "off",
|
|
692
|
+
"vitest/prefer-todo": "off",
|
|
576
693
|
"vitest/require-awaited-expect-poll": "off",
|
|
694
|
+
"vitest/require-hook": "off",
|
|
577
695
|
"vitest/require-local-test-context-for-concurrent-snapshots": "off",
|
|
578
696
|
"vitest/require-mock-type-parameters": "off",
|
|
697
|
+
"vitest/require-test-timeout": "off",
|
|
698
|
+
"vitest/require-to-throw-message": "off",
|
|
699
|
+
"vitest/require-top-level-describe": "off",
|
|
700
|
+
"vitest/valid-describe-callback": "off",
|
|
701
|
+
"vitest/valid-expect": "off",
|
|
702
|
+
"vitest/valid-expect-in-promise": "off",
|
|
703
|
+
"vitest/valid-title": "off",
|
|
579
704
|
"vitest/warn-todo": "off"
|
|
580
705
|
}
|
|
581
706
|
};
|
|
582
707
|
//#endregion
|
|
583
708
|
//#region src/config-config-files/index.ts
|
|
709
|
+
/**
|
|
710
|
+
* Optional config entry containing core rules that target config files.
|
|
711
|
+
* Intended for explicit overrides.
|
|
712
|
+
*/
|
|
584
713
|
const config$1 = { rules: {
|
|
585
714
|
"import/no-anonymous-default-export": ["error", { allowObject: true }],
|
|
586
715
|
"import/no-unassigned-import": "off",
|
|
@@ -589,145 +718,10 @@ const config$1 = { rules: {
|
|
|
589
718
|
"unicorn/no-empty-file": "off"
|
|
590
719
|
} };
|
|
591
720
|
//#endregion
|
|
592
|
-
//#region ../
|
|
593
|
-
const
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
"react",
|
|
597
|
-
"react-perf"
|
|
598
|
-
],
|
|
599
|
-
rules: {
|
|
600
|
-
"jsx-a11y/alt-text": "error",
|
|
601
|
-
"jsx-a11y/anchor-ambiguous-text": "error",
|
|
602
|
-
"jsx-a11y/anchor-has-content": "error",
|
|
603
|
-
"jsx-a11y/anchor-is-valid": "error",
|
|
604
|
-
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
|
|
605
|
-
"jsx-a11y/aria-props": "error",
|
|
606
|
-
"jsx-a11y/aria-proptypes": "error",
|
|
607
|
-
"jsx-a11y/aria-role": "error",
|
|
608
|
-
"jsx-a11y/aria-unsupported-elements": "error",
|
|
609
|
-
"jsx-a11y/autocomplete-valid": "error",
|
|
610
|
-
"jsx-a11y/click-events-have-key-events": "warn",
|
|
611
|
-
"jsx-a11y/heading-has-content": "error",
|
|
612
|
-
"jsx-a11y/html-has-lang": "error",
|
|
613
|
-
"jsx-a11y/iframe-has-title": "error",
|
|
614
|
-
"jsx-a11y/img-redundant-alt": "off",
|
|
615
|
-
"jsx-a11y/label-has-associated-control": "error",
|
|
616
|
-
"jsx-a11y/lang": "error",
|
|
617
|
-
"jsx-a11y/media-has-caption": "off",
|
|
618
|
-
"jsx-a11y/mouse-events-have-key-events": "warn",
|
|
619
|
-
"jsx-a11y/no-access-key": "error",
|
|
620
|
-
"jsx-a11y/no-aria-hidden-on-focusable": "error",
|
|
621
|
-
"jsx-a11y/no-autofocus": "error",
|
|
622
|
-
"jsx-a11y/no-distracting-elements": "error",
|
|
623
|
-
"jsx-a11y/no-noninteractive-tabindex": "error",
|
|
624
|
-
"jsx-a11y/no-redundant-roles": "error",
|
|
625
|
-
"jsx-a11y/no-static-element-interactions": "error",
|
|
626
|
-
"jsx-a11y/prefer-tag-over-role": "error",
|
|
627
|
-
"jsx-a11y/role-has-required-aria-props": "error",
|
|
628
|
-
"jsx-a11y/role-supports-aria-props": "error",
|
|
629
|
-
"jsx-a11y/scope": "error",
|
|
630
|
-
"jsx-a11y/tabindex-no-positive": "error",
|
|
631
|
-
"react-perf/jsx-no-jsx-as-prop": "off",
|
|
632
|
-
"react-perf/jsx-no-new-array-as-prop": "error",
|
|
633
|
-
"react-perf/jsx-no-new-function-as-prop": "off",
|
|
634
|
-
"react-perf/jsx-no-new-object-as-prop": "off",
|
|
635
|
-
"react/button-has-type": "error",
|
|
636
|
-
"react/checked-requires-onchange-or-readonly": "error",
|
|
637
|
-
"react/display-name": "off",
|
|
638
|
-
"react/exhaustive-deps": "error",
|
|
639
|
-
"react/forbid-dom-props": "off",
|
|
640
|
-
"react/forbid-elements": "off",
|
|
641
|
-
"react/forward-ref-uses-ref": "off",
|
|
642
|
-
"react/hook-use-state": "error",
|
|
643
|
-
"react/iframe-missing-sandbox": "off",
|
|
644
|
-
"react/jsx-boolean-value": "error",
|
|
645
|
-
"react/jsx-curly-brace-presence": ["error", {
|
|
646
|
-
children: "never",
|
|
647
|
-
propElementValues: "always",
|
|
648
|
-
props: "never"
|
|
649
|
-
}],
|
|
650
|
-
"react/jsx-filename-extension": ["error", { extensions: [".tsx"] }],
|
|
651
|
-
"react/jsx-fragments": "error",
|
|
652
|
-
"react/jsx-handler-names": "error",
|
|
653
|
-
"react/jsx-key": "error",
|
|
654
|
-
"react/jsx-max-depth": "off",
|
|
655
|
-
"react/jsx-no-comment-textnodes": "error",
|
|
656
|
-
"react/jsx-no-constructed-context-values": "error",
|
|
657
|
-
"react/jsx-no-duplicate-props": "error",
|
|
658
|
-
"react/jsx-no-script-url": "error",
|
|
659
|
-
"react/jsx-no-target-blank": ["error", { warnOnSpreadAttributes: true }],
|
|
660
|
-
"react/jsx-no-undef": "error",
|
|
661
|
-
"react/jsx-no-useless-fragment": "error",
|
|
662
|
-
"react/jsx-pascal-case": "error",
|
|
663
|
-
"react/jsx-props-no-spread-multi": "error",
|
|
664
|
-
"react/jsx-props-no-spreading": "off",
|
|
665
|
-
"react/no-array-index-key": "error",
|
|
666
|
-
"react/no-children-prop": "error",
|
|
667
|
-
"react/no-clone-element": "off",
|
|
668
|
-
"react/no-danger": "error",
|
|
669
|
-
"react/no-danger-with-children": "error",
|
|
670
|
-
"react/no-did-mount-set-state": "off",
|
|
671
|
-
"react/no-direct-mutation-state": "off",
|
|
672
|
-
"react/no-find-dom-node": "off",
|
|
673
|
-
"react/no-is-mounted": "off",
|
|
674
|
-
"react/no-multi-comp": "off",
|
|
675
|
-
"react/no-namespace": "error",
|
|
676
|
-
"react/no-react-children": "off",
|
|
677
|
-
"react/no-redundant-should-component-update": "off",
|
|
678
|
-
"react/no-render-return-value": "off",
|
|
679
|
-
"react/no-set-state": "off",
|
|
680
|
-
"react/no-string-refs": "off",
|
|
681
|
-
"react/no-this-in-sfc": "off",
|
|
682
|
-
"react/no-unescaped-entities": "error",
|
|
683
|
-
"react/no-unknown-property": "error",
|
|
684
|
-
"react/no-unsafe": "off",
|
|
685
|
-
"react/no-will-update-set-state": "off",
|
|
686
|
-
"react/only-export-components": "off",
|
|
687
|
-
"react/prefer-es6-class": "off",
|
|
688
|
-
"react/prefer-function-component": "off",
|
|
689
|
-
"react/react-in-jsx-scope": "off",
|
|
690
|
-
"react/require-render-return": "off",
|
|
691
|
-
"react/rules-of-hooks": "error",
|
|
692
|
-
"react/self-closing-comp": "error",
|
|
693
|
-
"react/state-in-constructor": "off",
|
|
694
|
-
"react/style-prop-object": "error",
|
|
695
|
-
"react/void-dom-elements-no-children": "error",
|
|
696
|
-
"typescript/consistent-return": "off"
|
|
697
|
-
}
|
|
698
|
-
};
|
|
699
|
-
//#endregion
|
|
700
|
-
//#region ../oxlint-react/src/config-test-files/index.ts
|
|
701
|
-
const config$5 = { rules: {
|
|
702
|
-
"jsx-a11y/alt-text": "off",
|
|
703
|
-
"jsx-a11y/anchor-ambiguous-text": "off",
|
|
704
|
-
"jsx-a11y/anchor-has-content": "off",
|
|
705
|
-
"jsx-a11y/anchor-is-valid": "off",
|
|
706
|
-
"jsx-a11y/click-events-have-key-events": "off",
|
|
707
|
-
"jsx-a11y/heading-has-content": "off",
|
|
708
|
-
"jsx-a11y/html-has-lang": "off",
|
|
709
|
-
"jsx-a11y/iframe-has-title": "off",
|
|
710
|
-
"jsx-a11y/label-has-associated-control": "off",
|
|
711
|
-
"jsx-a11y/lang": "off",
|
|
712
|
-
"jsx-a11y/mouse-events-have-key-events": "off",
|
|
713
|
-
"jsx-a11y/no-access-key": "off",
|
|
714
|
-
"jsx-a11y/no-autofocus": "off",
|
|
715
|
-
"jsx-a11y/no-distracting-elements": "off",
|
|
716
|
-
"jsx-a11y/no-noninteractive-tabindex": "off",
|
|
717
|
-
"jsx-a11y/no-redundant-roles": "off",
|
|
718
|
-
"jsx-a11y/no-static-element-interactions": "off",
|
|
719
|
-
"jsx-a11y/prefer-tag-over-role": "off",
|
|
720
|
-
"jsx-a11y/scope": "off",
|
|
721
|
-
"jsx-a11y/tabindex-no-positive": "off",
|
|
722
|
-
"react-perf/jsx-no-new-array-as-prop": "off",
|
|
723
|
-
"react/button-has-type": "off",
|
|
724
|
-
"react/checked-requires-onchange-or-readonly": "off",
|
|
725
|
-
"react/jsx-no-target-blank": "off",
|
|
726
|
-
"react/jsx-no-useless-fragment": "off",
|
|
727
|
-
"react/no-array-index-key": "off",
|
|
728
|
-
"react/no-children-prop": "off",
|
|
729
|
-
"react/no-danger": "off"
|
|
730
|
-
} };
|
|
721
|
+
//#region ../utilities/src/constants/index.ts
|
|
722
|
+
const GLOB_SET_CONFIG_FILES = ["**/*.config.{js,ts,cjs,cts,mjs,mts}", "**/*.setup.{js,ts,cjs,cts,mjs,mts}"];
|
|
723
|
+
const GLOB_SET_TEST_FILES = ["**/*.test.{js,jsx,ts,tsx,cjs,cts,mjs,mts}", "**/*.test-d.{ts,cts,mts}"];
|
|
724
|
+
const GLOB_SET_TYPE_DEFINITIONS = ["**/*.d.{ts,cts,mts}", "**/*.test-d.{ts,cts,mts}"];
|
|
731
725
|
//#endregion
|
|
732
726
|
//#region ../utilities/src/clone/index.ts
|
|
733
727
|
function clone(value) {
|
|
@@ -770,11 +764,16 @@ function isObject(value) {
|
|
|
770
764
|
}
|
|
771
765
|
//#endregion
|
|
772
766
|
//#region src/config-test-files/index.ts
|
|
773
|
-
|
|
774
|
-
|
|
767
|
+
/**
|
|
768
|
+
* Optional config entry containing core rules that target test files. Intended
|
|
769
|
+
* for explicit overrides.
|
|
770
|
+
*/
|
|
771
|
+
const config$2 = { rules: {
|
|
772
|
+
"eslint/getter-return": "off",
|
|
775
773
|
"eslint/no-empty-function": "off",
|
|
776
774
|
"eslint/no-param-reassign": "off",
|
|
777
775
|
"eslint/no-promise-executor-return": "off",
|
|
776
|
+
"eslint/no-useless-assignment": "off",
|
|
778
777
|
"import/no-unassigned-import": "off",
|
|
779
778
|
"import/unambiguous": "off",
|
|
780
779
|
"jest/expect-expect": "warn",
|
|
@@ -853,23 +852,59 @@ const config$3 = mergeConfig(config$5, { rules: {
|
|
|
853
852
|
suite: "each"
|
|
854
853
|
}],
|
|
855
854
|
"vitest/consistent-vitest-vi": "error",
|
|
855
|
+
"vitest/expect-expect": "warn",
|
|
856
856
|
"vitest/hoisted-apis-on-top": "error",
|
|
857
|
+
"vitest/no-commented-out-tests": "warn",
|
|
858
|
+
"vitest/no-conditional-expect": "error",
|
|
859
|
+
"vitest/no-conditional-in-test": "error",
|
|
860
|
+
"vitest/no-disabled-tests": "warn",
|
|
861
|
+
"vitest/no-duplicate-hooks": "warn",
|
|
862
|
+
"vitest/no-focused-tests": "warn",
|
|
863
|
+
"vitest/no-identical-title": "warn",
|
|
857
864
|
"vitest/no-import-node-test": "error",
|
|
865
|
+
"vitest/no-interpolation-in-snapshots": "error",
|
|
866
|
+
"vitest/no-mocks-import": "error",
|
|
867
|
+
"vitest/no-standalone-expect": "error",
|
|
868
|
+
"vitest/no-test-return-statement": "error",
|
|
869
|
+
"vitest/no-unneeded-async-expect-function": "error",
|
|
870
|
+
"vitest/padding-around-after-all-blocks": "error",
|
|
858
871
|
"vitest/prefer-called-exactly-once-with": "warn",
|
|
859
872
|
"vitest/prefer-called-times": "error",
|
|
873
|
+
"vitest/prefer-comparison-matcher": "error",
|
|
860
874
|
"vitest/prefer-describe-function-title": "error",
|
|
875
|
+
"vitest/prefer-each": "error",
|
|
876
|
+
"vitest/prefer-equality-matcher": "error",
|
|
877
|
+
"vitest/prefer-expect-resolves": "error",
|
|
861
878
|
"vitest/prefer-expect-type-of": "error",
|
|
879
|
+
"vitest/prefer-hooks-in-order": "warn",
|
|
880
|
+
"vitest/prefer-hooks-on-top": "warn",
|
|
862
881
|
"vitest/prefer-importing-vitest-globals": "error",
|
|
882
|
+
"vitest/prefer-mock-promise-shorthand": "error",
|
|
883
|
+
"vitest/prefer-mock-return-shorthand": "error",
|
|
863
884
|
"vitest/prefer-strict-boolean-matchers": "error",
|
|
885
|
+
"vitest/prefer-strict-equal": "error",
|
|
886
|
+
"vitest/prefer-to-be": "error",
|
|
864
887
|
"vitest/prefer-to-be-object": "error",
|
|
888
|
+
"vitest/prefer-to-contain": "error",
|
|
889
|
+
"vitest/prefer-to-have-been-called-times": "error",
|
|
890
|
+
"vitest/prefer-to-have-length": "error",
|
|
891
|
+
"vitest/prefer-todo": "error",
|
|
865
892
|
"vitest/require-awaited-expect-poll": "error",
|
|
866
893
|
"vitest/require-local-test-context-for-concurrent-snapshots": "error",
|
|
867
|
-
"vitest/require-
|
|
894
|
+
"vitest/require-to-throw-message": "error",
|
|
895
|
+
"vitest/valid-describe-callback": "error",
|
|
896
|
+
"vitest/valid-expect": "error",
|
|
897
|
+
"vitest/valid-expect-in-promise": "error",
|
|
898
|
+
"vitest/valid-title": "error",
|
|
868
899
|
"vitest/warn-todo": "warn"
|
|
869
|
-
} }
|
|
900
|
+
} };
|
|
870
901
|
//#endregion
|
|
871
902
|
//#region src/config-type-definitions/index.ts
|
|
872
|
-
|
|
903
|
+
/**
|
|
904
|
+
* Optional config entry containing core rules that target type definition
|
|
905
|
+
* files. Intended for explicit overrides.
|
|
906
|
+
*/
|
|
907
|
+
const config$3 = { rules: {
|
|
873
908
|
"import/no-empty-named-blocks": "off",
|
|
874
909
|
"import/no-unassigned-import": "off",
|
|
875
910
|
"import/unambiguous": "off",
|
|
@@ -880,32 +915,42 @@ const config$4 = { rules: {
|
|
|
880
915
|
"unicorn/require-module-specifiers": "off"
|
|
881
916
|
} };
|
|
882
917
|
//#endregion
|
|
918
|
+
//#region src/config-default/index.ts
|
|
919
|
+
/**
|
|
920
|
+
* Resolved Standard Config core entry.
|
|
921
|
+
*/
|
|
922
|
+
const config$4 = mergeConfig(config, { overrides: [
|
|
923
|
+
{
|
|
924
|
+
files: GLOB_SET_TYPE_DEFINITIONS,
|
|
925
|
+
...config$3
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
files: GLOB_SET_TEST_FILES,
|
|
929
|
+
...config$2
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
files: GLOB_SET_CONFIG_FILES,
|
|
933
|
+
...config$1
|
|
934
|
+
}
|
|
935
|
+
] });
|
|
936
|
+
//#endregion
|
|
883
937
|
//#region src/define-config/index.ts
|
|
938
|
+
const SUPPLEMENTAL_CONFIGS = [];
|
|
939
|
+
for (const config of ["@standard-config/oxlint-react", "@standard-config/oxlint-stylistic"]) {
|
|
940
|
+
let resolvedConfig;
|
|
941
|
+
try {
|
|
942
|
+
resolvedConfig = (await import(config)).default;
|
|
943
|
+
} catch {}
|
|
944
|
+
if (typeof resolvedConfig === "object") SUPPLEMENTAL_CONFIGS.push(resolvedConfig);
|
|
945
|
+
}
|
|
884
946
|
function defineConfig(...configs) {
|
|
885
|
-
let
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
return defineConfig$1(mergeConfig({
|
|
893
|
-
...includeReactConfig ? mergeConfig(config, config$2) : config,
|
|
894
|
-
overrides: [
|
|
895
|
-
{
|
|
896
|
-
files: ["**/*.d.{ts,cts,mts}", "**/*.test-d.{ts,cts,mts}"],
|
|
897
|
-
...config$4
|
|
898
|
-
},
|
|
899
|
-
{
|
|
900
|
-
files: ["**/*.test.{ts,tsx,cts,mts}", "**/*.test-d.{ts,cts,mts}"],
|
|
901
|
-
...config$3
|
|
902
|
-
},
|
|
903
|
-
{
|
|
904
|
-
files: ["**/*.config.{ts,cts,mts}", "**/*.setup.{ts,cts,mts}"],
|
|
905
|
-
...config$1
|
|
906
|
-
}
|
|
907
|
-
]
|
|
908
|
-
}, extensionConfig));
|
|
947
|
+
let mergedConfig = {};
|
|
948
|
+
for (const config of [
|
|
949
|
+
config$4,
|
|
950
|
+
...SUPPLEMENTAL_CONFIGS,
|
|
951
|
+
...configs
|
|
952
|
+
]) mergedConfig = mergeConfig(mergedConfig, config);
|
|
953
|
+
return defineConfig$1(mergedConfig);
|
|
909
954
|
}
|
|
910
955
|
//#endregion
|
|
911
956
|
//#region src/define-oxlint-config/index.ts
|
|
@@ -916,6 +961,39 @@ function defineOxlintConfig(...configs) {
|
|
|
916
961
|
return defineConfig(...configs);
|
|
917
962
|
}
|
|
918
963
|
//#endregion
|
|
919
|
-
|
|
964
|
+
//#region ../utilities/src/resolve-plugin/index.ts
|
|
965
|
+
/**
|
|
966
|
+
* Resolve an external plugin specifier to a file path.
|
|
967
|
+
*
|
|
968
|
+
* @example
|
|
969
|
+
*
|
|
970
|
+
* ```ts
|
|
971
|
+
* import { resolvePlugin } from '@standard-config/oxlint';
|
|
972
|
+
* import { defineConfig } from 'oxlint';
|
|
973
|
+
*
|
|
974
|
+
* const config = defineConfig({
|
|
975
|
+
* jsPlugins: [
|
|
976
|
+
* resolvePlugin(
|
|
977
|
+
* 'react-x',
|
|
978
|
+
* '@eslint-react/eslint-plugin',
|
|
979
|
+
* ),
|
|
980
|
+
* ],
|
|
981
|
+
* rules: {
|
|
982
|
+
* 'react-x/refs': 'error',
|
|
983
|
+
* },
|
|
984
|
+
* });
|
|
985
|
+
* ```
|
|
986
|
+
*/
|
|
987
|
+
function resolvePlugin(name, specifier) {
|
|
988
|
+
try {
|
|
989
|
+
specifier = fileURLToPath(import.meta.resolve(specifier));
|
|
990
|
+
} catch {}
|
|
991
|
+
return {
|
|
992
|
+
name,
|
|
993
|
+
specifier
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
//#endregion
|
|
997
|
+
export { config as configCoreBase, config$1 as configCoreConfigFiles, config$2 as configCoreTestFiles, config$3 as configCoreTypeDefinitions, config$4 as default, defineConfig, defineOxlintConfig, resolvePlugin };
|
|
920
998
|
|
|
921
999
|
//# sourceMappingURL=index.mjs.map
|