@oxlint/migrate 0.15.13 → 0.15.14

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.
@@ -1,4 +1,4 @@
1
- const version = "0.15.13";
1
+ const version = "0.15.14";
2
2
  const packageJson = {
3
3
  version
4
4
  };
@@ -27,8 +27,7 @@ const TS_ESLINT_DEFAULT_OVERRIDE = {
27
27
  "no-var": "error",
28
28
  "prefer-rest-params": "error",
29
29
  "prefer-spread": "error"
30
- },
31
- plugins: []
30
+ }
32
31
  };
33
32
  const cleanUpDefaultTypeScriptOverridesForEslint = (config) => {
34
33
  if (config.overrides === void 0) {
@@ -1,3 +1,7 @@
1
- declare const rules: string[];
1
+ export declare const pedanticRules: string[];
2
2
  export declare const nurseryRules: string[];
3
- export default rules;
3
+ export declare const styleRules: string[];
4
+ export declare const restrictionRules: string[];
5
+ export declare const correctnessRules: string[];
6
+ export declare const perfRules: string[];
7
+ export declare const suspiciousRules: string[];
@@ -1,125 +1,128 @@
1
- const rules = [
1
+ const pedanticRules = [
2
2
  "array-callback-return",
3
+ "eqeqeq",
4
+ "max-nested-callbacks",
5
+ "max-lines-per-function",
6
+ "max-classes-per-file",
7
+ "max-depth",
8
+ "max-lines",
9
+ "no-object-constructor",
10
+ "no-array-constructor",
11
+ "no-case-declarations",
12
+ "no-constructor-return",
13
+ "no-else-return",
14
+ "no-fallthrough",
15
+ "no-inner-declarations",
16
+ "no-negated-condition",
17
+ "no-new-wrappers",
18
+ "no-prototype-builtins",
19
+ "no-redeclare",
20
+ "no-self-compare",
21
+ "no-throw-literal",
22
+ "radix",
23
+ "require-await",
24
+ "sort-vars",
25
+ "symbol-description",
26
+ "import/max-dependencies",
27
+ "jest/no-conditional-in-test",
28
+ "jsdoc/require-param",
29
+ "jsdoc/require-param-description",
30
+ "jsdoc/require-param-name",
31
+ "jsdoc/require-param-type",
32
+ "jsdoc/require-returns",
33
+ "jsdoc/require-returns-description",
34
+ "jsdoc/require-returns-type",
35
+ "react/checked-requires-onchange-or-readonly",
36
+ "react/jsx-no-useless-fragment",
37
+ "react/no-unescaped-entities",
38
+ "react-hooks/rules-of-hooks",
39
+ "@typescript-eslint/ban-ts-comment",
40
+ "@typescript-eslint/ban-types",
41
+ "@typescript-eslint/no-unsafe-function-type",
42
+ "@typescript-eslint/prefer-enum-initializers",
43
+ "@typescript-eslint/prefer-ts-expect-error",
44
+ "unicorn/consistent-empty-array-spread",
45
+ "unicorn/escape-case",
46
+ "unicorn/explicit-length-check",
47
+ "unicorn/new-for-builtins",
48
+ "unicorn/no-hex-escape",
49
+ "unicorn/no-instanceof-array",
50
+ "unicorn/no-lonely-if",
51
+ "unicorn/no-negation-in-equality-check",
52
+ "unicorn/no-new-buffer",
53
+ "unicorn/no-object-as-default-parameter",
54
+ "unicorn/no-static-only-class",
55
+ "unicorn/no-this-assignment",
56
+ "unicorn/no-typeof-undefined",
57
+ "unicorn/no-unreadable-iife",
58
+ "unicorn/no-useless-promise-resolve-reject",
59
+ "unicorn/no-useless-switch-case",
60
+ "unicorn/no-useless-undefined",
61
+ "unicorn/prefer-array-flat",
62
+ "unicorn/prefer-array-some",
63
+ "unicorn/prefer-blob-reading-methods",
64
+ "unicorn/prefer-code-point",
65
+ "unicorn/prefer-date-now",
66
+ "unicorn/prefer-dom-node-append",
67
+ "unicorn/prefer-dom-node-dataset",
68
+ "unicorn/prefer-dom-node-remove",
69
+ "unicorn/prefer-event-target",
70
+ "unicorn/prefer-math-min-max",
71
+ "unicorn/prefer-math-trunc",
72
+ "unicorn/prefer-native-coercion-functions",
73
+ "unicorn/prefer-prototype-methods",
74
+ "unicorn/prefer-query-selector",
75
+ "unicorn/prefer-regexp-test",
76
+ "unicorn/prefer-string-replace-all",
77
+ "unicorn/prefer-string-slice",
78
+ "unicorn/prefer-type-error",
79
+ "unicorn/require-number-to-fixed-digits-argument",
80
+ "@typescript-eslint/no-array-constructor",
81
+ "unicorn/no-negated-condition",
82
+ "@typescript-eslint/no-redeclare",
83
+ "import-x/max-dependencies",
84
+ "vitest/no-conditional-in-test"
85
+ ];
86
+ const nurseryRules = [
3
87
  "constructor-super",
88
+ "getter-return",
89
+ "no-undef",
90
+ "no-unreachable",
91
+ "import/export",
92
+ "import/named",
93
+ "promise/no-return-in-finally",
94
+ "react-hooks/exhaustive-deps",
95
+ "react/require-render-return",
96
+ "@typescript-eslint/consistent-type-imports",
97
+ "import-x/export",
98
+ "import-x/named"
99
+ ];
100
+ const styleRules = [
4
101
  "curly",
5
- "default-case",
6
102
  "default-case-last",
7
103
  "default-param-last",
8
- "eqeqeq",
9
- "for-direction",
10
104
  "func-style",
11
105
  "func-names",
12
- "getter-return",
13
106
  "grouped-accessor-pairs",
14
107
  "guard-for-in",
15
108
  "init-declarations",
16
- "max-nested-callbacks",
17
- "max-lines-per-function",
18
- "max-classes-per-file",
19
- "max-depth",
20
- "max-lines",
21
109
  "max-params",
22
110
  "new-cap",
23
- "no-useless-call",
24
- "no-unneeded-ternary",
25
111
  "no-extra-label",
26
112
  "no-multi-assign",
27
113
  "no-nested-ternary",
28
114
  "no-labels",
29
115
  "no-lone-blocks",
30
- "no-restricted-imports",
31
- "no-object-constructor",
32
116
  "no-duplicate-imports",
33
- "no-alert",
34
- "no-array-constructor",
35
- "no-async-promise-executor",
36
- "no-await-in-loop",
37
- "no-bitwise",
38
- "no-caller",
39
- "no-case-declarations",
40
- "no-class-assign",
41
- "no-compare-neg-zero",
42
- "no-cond-assign",
43
- "no-console",
44
- "no-const-assign",
45
- "no-constant-binary-expression",
46
- "no-constant-condition",
47
- "no-constructor-return",
48
117
  "no-continue",
49
- "no-control-regex",
50
- "no-debugger",
51
- "no-delete-var",
52
- "no-div-regex",
53
- "no-dupe-class-members",
54
- "no-dupe-else-if",
55
- "no-dupe-keys",
56
- "no-duplicate-case",
57
- "no-else-return",
58
- "no-empty-character-class",
59
- "no-empty-function",
60
- "no-empty-pattern",
61
- "no-empty-static-block",
62
- "no-empty",
63
- "no-eq-null",
64
- "no-eval",
65
- "no-ex-assign",
66
- "no-extend-native",
67
- "no-extra-boolean-cast",
68
- "no-fallthrough",
69
- "no-func-assign",
70
- "no-global-assign",
71
- "no-import-assign",
72
- "no-inner-declarations",
73
- "no-invalid-regexp",
74
- "no-irregular-whitespace",
75
- "no-iterator",
76
118
  "no-label-var",
77
- "no-loss-of-precision",
78
119
  "no-magic-numbers",
79
- "no-negated-condition",
80
120
  "no-multi-str",
81
121
  "no-new-func",
82
- "no-new-native-nonconstructor",
83
- "no-new-wrappers",
84
- "no-new",
85
- "no-nonoctal-decimal-escape",
86
- "no-obj-calls",
87
- "no-plusplus",
88
- "no-proto",
89
- "no-prototype-builtins",
90
- "no-redeclare",
91
- "no-regex-spaces",
92
- "no-restricted-globals",
93
122
  "no-return-assign",
94
123
  "no-script-url",
95
- "no-self-assign",
96
- "no-self-compare",
97
- "no-setter-return",
98
- "no-shadow-restricted-names",
99
- "no-sparse-arrays",
100
124
  "no-template-curly-in-string",
101
125
  "no-ternary",
102
- "no-this-before-super",
103
- "no-throw-literal",
104
- "no-undef",
105
- "no-undefined",
106
- "no-unexpected-multiline",
107
- "no-unreachable",
108
- "no-unsafe-finally",
109
- "no-unsafe-negation",
110
- "no-unsafe-optional-chaining",
111
- "no-unused-expressions",
112
- "no-unused-labels",
113
- "no-unused-private-class-members",
114
- "no-unused-vars",
115
- "no-useless-catch",
116
- "no-useless-concat",
117
- "no-useless-constructor",
118
- "no-useless-escape",
119
- "no-useless-rename",
120
- "no-var",
121
- "no-void",
122
- "no-with",
123
126
  "operator-assignment",
124
127
  "prefer-promise-reject-errors",
125
128
  "prefer-exponentiation-operator",
@@ -128,54 +131,24 @@ const rules = [
128
131
  "prefer-object-spread",
129
132
  "prefer-rest-params",
130
133
  "prefer-spread",
131
- "radix",
132
- "require-await",
133
- "require-yield",
134
134
  "sort-imports",
135
135
  "sort-keys",
136
- "sort-vars",
137
- "symbol-description",
138
- "unicode-bom",
139
- "use-isnan",
140
- "valid-typeof",
141
136
  "vars-on-top",
142
137
  "yoda",
143
- "import/default",
144
- "import/export",
138
+ "import/exports-last",
145
139
  "import/first",
146
- "import/no-absolute-path",
140
+ "import/no-anonymous-default-export",
147
141
  "import/no-mutable-exports",
148
142
  "import/no-named-default",
149
143
  "import/no-namespace",
150
- "import/max-dependencies",
151
- "import/named",
152
- "import/namespace",
153
- "import/no-amd",
154
- "import/no-commonjs",
155
- "import/no-cycle",
156
- "import/no-default-export",
157
- "import/no-duplicates",
158
- "import/no-dynamic-require",
159
- "import/no-named-as-default",
160
- "import/no-named-as-default-member",
161
- "import/no-self-import",
162
- "import/no-webpack-loader-syntax",
163
- "import/unambiguous",
164
144
  "jest/consistent-test-it",
165
- "jest/expect-expect",
166
145
  "jest/max-expects",
167
146
  "jest/max-nested-describe",
168
147
  "jest/no-alias-methods",
169
- "jest/no-commented-out-tests",
170
- "jest/no-conditional-expect",
171
- "jest/no-conditional-in-test",
172
148
  "jest/no-confusing-set-timeout",
173
149
  "jest/no-deprecated-functions",
174
- "jest/no-disabled-tests",
175
150
  "jest/no-done-callback",
176
151
  "jest/no-duplicate-hooks",
177
- "jest/no-export",
178
- "jest/no-focused-tests",
179
152
  "jest/no-hooks",
180
153
  "jest/no-identical-title",
181
154
  "jest/no-interpolation-in-snapshots",
@@ -184,7 +157,6 @@ const rules = [
184
157
  "jest/no-mocks-import",
185
158
  "jest/no-restricted-jest-methods",
186
159
  "jest/no-restricted-matchers",
187
- "jest/no-standalone-expect",
188
160
  "jest/no-test-prefixes",
189
161
  "jest/no-test-return-statement",
190
162
  "jest/no-untyped-mock-factory",
@@ -205,28 +177,239 @@ const rules = [
205
177
  "jest/prefer-to-have-length",
206
178
  "jest/prefer-todo",
207
179
  "jest/require-hook",
208
- "jest/require-to-throw-message",
209
180
  "jest/require-top-level-describe",
181
+ "node/no-exports-assign",
182
+ "promise/avoid-new",
183
+ "promise/no-return-wrap",
184
+ "promise/no-nesting",
185
+ "promise/param-names",
186
+ "promise/prefer-catch",
187
+ "promise/prefer-await-to-callbacks",
188
+ "promise/prefer-await-to-then",
189
+ "react/jsx-boolean-value",
190
+ "react/jsx-curly-brace-presence",
191
+ "react/no-set-state",
192
+ "react/prefer-es6-class",
193
+ "react/self-closing-comp",
194
+ "@typescript-eslint/adjacent-overload-signatures",
195
+ "@typescript-eslint/array-type",
196
+ "@typescript-eslint/ban-tslint-comment",
197
+ "@typescript-eslint/consistent-generic-constructors",
198
+ "@typescript-eslint/consistent-indexed-object-style",
199
+ "@typescript-eslint/consistent-type-definitions",
200
+ "@typescript-eslint/no-inferrable-types",
201
+ "@typescript-eslint/no-empty-interface",
202
+ "@typescript-eslint/prefer-for-of",
203
+ "@typescript-eslint/prefer-function-type",
204
+ "@typescript-eslint/prefer-namespace-keyword",
205
+ "unicorn/catch-error-name",
206
+ "unicorn/consistent-date-clone",
207
+ "unicorn/consistent-existence-index-check",
208
+ "unicorn/empty-brace-spaces",
209
+ "unicorn/error-message",
210
+ "unicorn/filename-case",
211
+ "unicorn/no-await-expression-member",
212
+ "unicorn/no-console-spaces",
213
+ "unicorn/no-null",
214
+ "unicorn/no-unreadable-array-destructuring",
215
+ "unicorn/no-zero-fractions",
216
+ "unicorn/number-literal-case",
217
+ "unicorn/numeric-separators-style",
218
+ "unicorn/prefer-spread",
219
+ "unicorn/prefer-array-flat-map",
220
+ "unicorn/prefer-dom-node-text-content",
221
+ "unicorn/prefer-includes",
222
+ "unicorn/prefer-logical-operator-over-ternary",
223
+ "unicorn/prefer-modern-dom-apis",
224
+ "unicorn/prefer-negative-index",
225
+ "unicorn/prefer-optional-catch-binding",
226
+ "unicorn/prefer-reflect-apply",
227
+ "unicorn/prefer-string-raw",
228
+ "unicorn/prefer-string-trim-start-end",
229
+ "unicorn/prefer-structured-clone",
230
+ "unicorn/require-array-join-separator",
231
+ "unicorn/switch-case-braces",
232
+ "unicorn/text-encoding-identifier-case",
233
+ "unicorn/throw-new-error",
234
+ "vitest/no-import-node-test",
235
+ "vitest/prefer-to-be-falsy",
236
+ "vitest/prefer-to-be-object",
237
+ "vitest/prefer-to-be-truthy",
238
+ "@typescript-eslint/default-param-last",
239
+ "@typescript-eslint/init-declarations",
240
+ "@typescript-eslint/max-params",
241
+ "@typescript-eslint/no-magic-numbers",
242
+ "import-x/exports-last",
243
+ "import-x/first",
244
+ "import-x/no-anonymous-default-export",
245
+ "import-x/no-mutable-exports",
246
+ "import-x/no-named-default",
247
+ "import-x/no-namespace",
248
+ "vitest/consistent-test-it",
249
+ "vitest/max-expects",
250
+ "vitest/max-nested-describe",
251
+ "vitest/no-alias-methods",
252
+ "vitest/no-duplicate-hooks",
253
+ "vitest/no-hooks",
254
+ "vitest/no-identical-title",
255
+ "vitest/no-interpolation-in-snapshots",
256
+ "vitest/no-restricted-jest-methods",
257
+ "vitest/no-restricted-matchers",
258
+ "vitest/no-test-prefixes",
259
+ "vitest/no-test-return-statement",
260
+ "vitest/prefer-each",
261
+ "vitest/prefer-comparison-matcher",
262
+ "vitest/prefer-equality-matcher",
263
+ "vitest/prefer-expect-resolves",
264
+ "vitest/prefer-hooks-in-order",
265
+ "vitest/prefer-hooks-on-top",
266
+ "vitest/prefer-lowercase-title",
267
+ "vitest/prefer-mock-promise-shorthand",
268
+ "vitest/prefer-strict-equal",
269
+ "vitest/prefer-to-have-length",
270
+ "vitest/prefer-todo",
271
+ "vitest/require-top-level-describe"
272
+ ];
273
+ const restrictionRules = [
274
+ "default-case",
275
+ "no-restricted-imports",
276
+ "no-alert",
277
+ "no-bitwise",
278
+ "no-console",
279
+ "no-div-regex",
280
+ "no-empty-function",
281
+ "no-empty",
282
+ "no-eq-null",
283
+ "no-iterator",
284
+ "no-plusplus",
285
+ "no-proto",
286
+ "no-regex-spaces",
287
+ "no-restricted-globals",
288
+ "no-undefined",
289
+ "no-unused-expressions",
290
+ "no-var",
291
+ "no-void",
292
+ "unicode-bom",
293
+ "import/no-amd",
294
+ "import/no-commonjs",
295
+ "import/no-cycle",
296
+ "import/no-default-export",
297
+ "import/no-dynamic-require",
298
+ "import/no-webpack-loader-syntax",
299
+ "import/unambiguous",
300
+ "jsdoc/check-access",
301
+ "jsdoc/empty-tags",
302
+ "jsx-a11y/anchor-ambiguous-text",
303
+ "node/no-new-require",
304
+ "promise/catch-or-return",
305
+ "promise/spec-only",
306
+ "react/button-has-type",
307
+ "react/jsx-filename-extension",
308
+ "react/no-danger",
309
+ "react/no-unknown-property",
310
+ "@typescript-eslint/explicit-function-return-type",
311
+ "@typescript-eslint/no-dynamic-delete",
312
+ "@typescript-eslint/no-empty-object-type",
313
+ "@typescript-eslint/no-explicit-any",
314
+ "@typescript-eslint/no-import-type-side-effects",
315
+ "@typescript-eslint/no-namespace",
316
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing",
317
+ "@typescript-eslint/no-non-null-assertion",
318
+ "@typescript-eslint/no-require-imports",
319
+ "@typescript-eslint/no-var-requires",
320
+ "@typescript-eslint/prefer-literal-enum-member",
321
+ "unicorn/no-abusive-eslint-disable",
322
+ "unicorn/no-anonymous-default-export",
323
+ "unicorn/no-array-for-each",
324
+ "unicorn/no-array-reduce",
325
+ "unicorn/no-length-as-slice-end",
326
+ "unicorn/no-magic-array-flat-depth",
327
+ "unicorn/no-nested-ternary",
328
+ "unicorn/no-process-exit",
329
+ "unicorn/prefer-modern-math-apis",
330
+ "unicorn/prefer-node-protocol",
331
+ "unicorn/prefer-number-properties",
332
+ "@typescript-eslint/no-restricted-imports",
333
+ "@typescript-eslint/no-empty-function",
334
+ "@typescript-eslint/no-unused-expressions",
335
+ "import-x/no-amd",
336
+ "import-x/no-commonjs",
337
+ "import-x/no-cycle",
338
+ "import-x/no-default-export",
339
+ "import-x/no-dynamic-require",
340
+ "import-x/no-webpack-loader-syntax",
341
+ "import-x/unambiguous"
342
+ ];
343
+ const correctnessRules = [
344
+ "for-direction",
345
+ "no-async-promise-executor",
346
+ "no-caller",
347
+ "no-class-assign",
348
+ "no-compare-neg-zero",
349
+ "no-cond-assign",
350
+ "no-const-assign",
351
+ "no-constant-binary-expression",
352
+ "no-constant-condition",
353
+ "no-control-regex",
354
+ "no-debugger",
355
+ "no-delete-var",
356
+ "no-dupe-class-members",
357
+ "no-dupe-else-if",
358
+ "no-dupe-keys",
359
+ "no-duplicate-case",
360
+ "no-empty-character-class",
361
+ "no-empty-pattern",
362
+ "no-empty-static-block",
363
+ "no-eval",
364
+ "no-ex-assign",
365
+ "no-extra-boolean-cast",
366
+ "no-func-assign",
367
+ "no-global-assign",
368
+ "no-import-assign",
369
+ "no-invalid-regexp",
370
+ "no-irregular-whitespace",
371
+ "no-loss-of-precision",
372
+ "no-new-native-nonconstructor",
373
+ "no-nonoctal-decimal-escape",
374
+ "no-obj-calls",
375
+ "no-self-assign",
376
+ "no-setter-return",
377
+ "no-shadow-restricted-names",
378
+ "no-sparse-arrays",
379
+ "no-this-before-super",
380
+ "no-unsafe-finally",
381
+ "no-unsafe-negation",
382
+ "no-unsafe-optional-chaining",
383
+ "no-unused-labels",
384
+ "no-unused-private-class-members",
385
+ "no-unused-vars",
386
+ "no-useless-catch",
387
+ "no-useless-escape",
388
+ "no-useless-rename",
389
+ "no-with",
390
+ "require-yield",
391
+ "use-isnan",
392
+ "valid-typeof",
393
+ "import/default",
394
+ "import/namespace",
395
+ "jest/expect-expect",
396
+ "jest/no-conditional-expect",
397
+ "jest/no-disabled-tests",
398
+ "jest/no-export",
399
+ "jest/no-focused-tests",
400
+ "jest/no-standalone-expect",
401
+ "jest/require-to-throw-message",
210
402
  "jest/valid-describe-callback",
211
403
  "jest/valid-expect",
212
404
  "jest/valid-title",
213
- "jsdoc/check-access",
214
405
  "jsdoc/check-property-names",
215
406
  "jsdoc/check-tag-names",
216
- "jsdoc/empty-tags",
217
407
  "jsdoc/implements-on-classes",
218
- "jsdoc/no-defaults",
219
- "jsdoc/require-param",
220
- "jsdoc/require-param-description",
221
- "jsdoc/require-param-name",
222
- "jsdoc/require-param-type",
408
+ "jsdoc/no-defaults",
223
409
  "jsdoc/require-property",
224
410
  "jsdoc/require-property-description",
225
411
  "jsdoc/require-property-name",
226
412
  "jsdoc/require-property-type",
227
- "jsdoc/require-returns",
228
- "jsdoc/require-returns-description",
229
- "jsdoc/require-returns-type",
230
413
  "jsdoc/require-yields",
231
414
  "jsx-a11y/alt-text",
232
415
  "jsx-a11y/anchor-has-content",
@@ -256,7 +439,6 @@ const rules = [
256
439
  "jsx-a11y/role-supports-aria-props",
257
440
  "jsx-a11y/scope",
258
441
  "jsx-a11y/tabindex-no-positive",
259
- "jsx-a11y/anchor-ambiguous-text",
260
442
  "@next/next/google-font-display",
261
443
  "@next/next/google-font-preconnect",
262
444
  "@next/next/inline-script-id",
@@ -277,309 +459,111 @@ const rules = [
277
459
  "@next/next/no-title-in-document-head",
278
460
  "@next/next/no-typos",
279
461
  "@next/next/no-unwanted-polyfillio",
280
- "node/no-exports-assign",
281
- "node/no-new-require",
282
- "oxc/approx-constant",
283
- "oxc/bad-array-method-on-arguments",
284
- "oxc/bad-bitwise-operator",
285
- "oxc/bad-char-at-comparison",
286
- "oxc/bad-comparison-sequence",
287
- "oxc/bad-min-max-func",
288
- "oxc/bad-object-literal-comparison",
289
- "oxc/bad-replace-all-arg",
290
- "oxc/const-comparisons",
291
- "oxc/double-comparisons",
292
- "oxc/erasing-op",
293
- "oxc/misrefactored-assign-op",
294
- "oxc/missing-throw",
295
- "oxc/no-accumulating-spread",
296
- "oxc/no-async-await",
297
- "oxc/no-async-endpoint-handlers",
298
- "oxc/no-barrel-file",
299
- "oxc/no-const-enum",
300
- "oxc/no-map-spread",
301
- "oxc/no-optional-chaining",
302
- "oxc/no-redundant-constructor-init",
303
- "oxc/no-rest-spread-properties",
304
- "oxc/number-arg-out-of-range",
305
- "oxc/only-used-in-recursion",
306
- "oxc/uninvoked-array-callback",
307
- "promise/avoid-new",
308
- "promise/catch-or-return",
309
- "promise/no-nesting",
310
- "promise/no-promise-in-callback",
311
462
  "promise/no-callback-in-promise",
312
463
  "promise/no-new-statics",
313
- "promise/no-return-in-finally",
314
- "promise/param-names",
315
- "promise/prefer-await-to-callbacks",
316
- "promise/prefer-await-to-then",
317
- "promise/spec-only",
318
464
  "promise/valid-params",
319
- "react/button-has-type",
320
- "react/checked-requires-onchange-or-readonly",
321
- "react-hooks/exhaustive-deps",
322
- "react/iframe-missing-sandbox",
323
- "react/jsx-boolean-value",
324
- "react/jsx-curly-brace-presence",
325
465
  "react/jsx-key",
326
- "react/jsx-no-comment-textnodes",
327
466
  "react/jsx-no-duplicate-props",
328
- "react/jsx-no-script-url",
329
467
  "react/jsx-no-target-blank",
330
468
  "react/jsx-no-undef",
331
- "react/jsx-no-useless-fragment",
332
469
  "react/jsx-props-no-spread-multi",
333
- "react/no-namespace",
334
- "react/no-array-index-key",
335
470
  "react/no-children-prop",
336
471
  "react/no-danger-with-children",
337
- "react/no-danger",
338
472
  "react/no-direct-mutation-state",
339
473
  "react/no-find-dom-node",
340
474
  "react/no-is-mounted",
341
475
  "react/no-render-return-value",
342
- "react/no-set-state",
343
476
  "react/no-string-refs",
344
- "react/no-unescaped-entities",
345
- "react/no-unknown-property",
346
- "react/prefer-es6-class",
347
- "react/react-in-jsx-scope",
348
- "react/require-render-return",
349
- "react-hooks/rules-of-hooks",
350
- "react/self-closing-comp",
351
- "react/style-prop-object",
352
477
  "react/void-dom-elements-no-children",
353
- "react-perf/jsx-no-jsx-as-prop",
354
- "react-perf/jsx-no-new-array-as-prop",
355
- "react-perf/jsx-no-new-function-as-prop",
356
- "react-perf/jsx-no-new-object-as-prop",
357
- "@typescript-eslint/adjacent-overload-signatures",
358
- "@typescript-eslint/array-type",
359
- "@typescript-eslint/ban-ts-comment",
360
- "@typescript-eslint/ban-tslint-comment",
361
- "@typescript-eslint/ban-types",
362
- "@typescript-eslint/consistent-generic-constructors",
363
- "@typescript-eslint/consistent-indexed-object-style",
364
- "@typescript-eslint/consistent-type-definitions",
365
- "@typescript-eslint/consistent-type-imports",
366
- "@typescript-eslint/explicit-function-return-type",
367
- "@typescript-eslint/no-inferrable-types",
368
- "@typescript-eslint/no-confusing-non-null-assertion",
369
478
  "@typescript-eslint/no-duplicate-enum-values",
370
- "@typescript-eslint/no-dynamic-delete",
371
- "@typescript-eslint/no-empty-interface",
372
- "@typescript-eslint/no-empty-object-type",
373
- "@typescript-eslint/no-explicit-any",
374
479
  "@typescript-eslint/no-extra-non-null-assertion",
375
- "@typescript-eslint/no-extraneous-class",
376
- "@typescript-eslint/no-import-type-side-effects",
377
480
  "@typescript-eslint/no-misused-new",
378
- "@typescript-eslint/no-namespace",
379
- "@typescript-eslint/no-non-null-asserted-nullish-coalescing",
380
481
  "@typescript-eslint/no-non-null-asserted-optional-chain",
381
- "@typescript-eslint/no-non-null-assertion",
382
- "@typescript-eslint/no-require-imports",
383
482
  "@typescript-eslint/no-this-alias",
384
- "@typescript-eslint/no-unnecessary-type-constraint",
385
483
  "@typescript-eslint/no-unsafe-declaration-merging",
386
- "@typescript-eslint/no-unsafe-function-type",
387
484
  "@typescript-eslint/no-useless-empty-export",
388
- "@typescript-eslint/no-var-requires",
389
485
  "@typescript-eslint/no-wrapper-object-types",
390
486
  "@typescript-eslint/prefer-as-const",
391
- "@typescript-eslint/prefer-enum-initializers",
392
- "@typescript-eslint/prefer-for-of",
393
- "@typescript-eslint/prefer-function-type",
394
- "@typescript-eslint/prefer-literal-enum-member",
395
- "@typescript-eslint/prefer-namespace-keyword",
396
- "@typescript-eslint/prefer-ts-expect-error",
397
487
  "@typescript-eslint/triple-slash-reference",
398
- "unicorn/catch-error-name",
399
- "unicorn/consistent-date-clone",
400
- "unicorn/consistent-empty-array-spread",
401
- "unicorn/consistent-existence-index-check",
402
- "unicorn/consistent-function-scoping",
403
- "unicorn/empty-brace-spaces",
404
- "unicorn/error-message",
405
- "unicorn/escape-case",
406
- "unicorn/explicit-length-check",
407
- "unicorn/filename-case",
408
- "unicorn/new-for-builtins",
409
488
  "unicorn/no-invalid-fetch-options",
410
- "unicorn/no-abusive-eslint-disable",
411
- "unicorn/no-anonymous-default-export",
412
- "unicorn/no-array-for-each",
413
- "unicorn/no-array-reduce",
414
- "unicorn/no-await-expression-member",
415
489
  "unicorn/no-await-in-promise-methods",
416
- "unicorn/no-console-spaces",
417
490
  "unicorn/no-document-cookie",
418
491
  "unicorn/no-empty-file",
419
- "unicorn/no-hex-escape",
420
- "unicorn/no-instanceof-array",
421
492
  "unicorn/no-invalid-remove-event-listener",
422
- "unicorn/no-length-as-slice-end",
423
- "unicorn/no-lonely-if",
424
- "unicorn/no-magic-array-flat-depth",
425
- "unicorn/no-negation-in-equality-check",
426
- "unicorn/no-nested-ternary",
427
493
  "unicorn/no-new-array",
428
- "unicorn/no-new-buffer",
429
- "unicorn/no-null",
430
- "unicorn/no-object-as-default-parameter",
431
- "unicorn/no-process-exit",
432
494
  "unicorn/no-single-promise-in-promise-methods",
433
- "unicorn/no-static-only-class",
434
495
  "unicorn/no-thenable",
435
- "unicorn/no-this-assignment",
436
- "unicorn/no-typeof-undefined",
437
496
  "unicorn/no-unnecessary-await",
438
- "unicorn/no-unreadable-array-destructuring",
439
- "unicorn/no-unreadable-iife",
440
497
  "unicorn/no-useless-fallback-in-spread",
441
498
  "unicorn/no-useless-length-check",
442
- "unicorn/no-useless-promise-resolve-reject",
443
499
  "unicorn/no-useless-spread",
444
- "unicorn/no-useless-switch-case",
445
- "unicorn/no-useless-undefined",
446
- "unicorn/no-zero-fractions",
447
- "unicorn/number-literal-case",
448
- "unicorn/numeric-separators-style",
449
- "unicorn/prefer-spread",
450
- "unicorn/prefer-add-event-listener",
451
- "unicorn/prefer-array-flat",
452
- "unicorn/prefer-array-flat-map",
453
- "unicorn/prefer-array-some",
454
- "unicorn/prefer-blob-reading-methods",
455
- "unicorn/prefer-code-point",
456
- "unicorn/prefer-date-now",
457
- "unicorn/prefer-dom-node-append",
458
- "unicorn/prefer-dom-node-dataset",
459
- "unicorn/prefer-dom-node-remove",
460
- "unicorn/prefer-dom-node-text-content",
461
- "unicorn/prefer-event-target",
462
- "unicorn/prefer-includes",
463
- "unicorn/prefer-logical-operator-over-ternary",
464
- "unicorn/prefer-math-min-max",
465
- "unicorn/prefer-math-trunc",
466
- "unicorn/prefer-modern-dom-apis",
467
- "unicorn/prefer-modern-math-apis",
468
- "unicorn/prefer-native-coercion-functions",
469
- "unicorn/prefer-negative-index",
470
- "unicorn/prefer-node-protocol",
471
- "unicorn/prefer-number-properties",
472
- "unicorn/prefer-optional-catch-binding",
473
- "unicorn/prefer-prototype-methods",
474
- "unicorn/prefer-query-selector",
475
- "unicorn/prefer-reflect-apply",
476
- "unicorn/prefer-regexp-test",
477
- "unicorn/prefer-set-has",
478
500
  "unicorn/prefer-set-size",
479
- "unicorn/prefer-string-raw",
480
- "unicorn/prefer-string-replace-all",
481
- "unicorn/prefer-string-slice",
482
501
  "unicorn/prefer-string-starts-ends-with",
483
- "unicorn/prefer-string-trim-start-end",
484
- "unicorn/prefer-structured-clone",
485
- "unicorn/prefer-type-error",
486
- "unicorn/require-array-join-separator",
487
- "unicorn/require-number-to-fixed-digits-argument",
488
- "unicorn/switch-case-braces",
489
- "unicorn/text-encoding-identifier-case",
490
- "unicorn/throw-new-error",
491
502
  "vitest/no-conditional-tests",
492
- "vitest/no-import-node-test",
493
- "vitest/prefer-to-be-falsy",
494
- "vitest/prefer-to-be-object",
495
- "vitest/prefer-to-be-truthy",
496
503
  "vitest/require-local-test-context-for-concurrent-snapshots",
497
- "@typescript-eslint/default-param-last",
498
- "@typescript-eslint/init-declarations",
499
- "@typescript-eslint/max-params",
500
- "@typescript-eslint/no-restricted-imports",
501
- "@typescript-eslint/no-array-constructor",
502
504
  "@typescript-eslint/no-dupe-class-members",
503
- "@typescript-eslint/no-empty-function",
504
505
  "@typescript-eslint/no-loss-of-precision",
505
- "@typescript-eslint/no-magic-numbers",
506
- "unicorn/no-negated-condition",
507
- "@typescript-eslint/no-redeclare",
508
- "@typescript-eslint/no-unused-expressions",
509
506
  "@typescript-eslint/no-unused-vars",
510
- "@typescript-eslint/no-useless-constructor",
511
507
  "import-x/default",
512
- "import-x/export",
513
- "import-x/first",
514
- "import-x/no-absolute-path",
515
- "import-x/no-mutable-exports",
516
- "import-x/no-named-default",
517
- "import-x/no-namespace",
518
- "import-x/max-dependencies",
519
- "import-x/named",
520
508
  "import-x/namespace",
521
- "import-x/no-amd",
522
- "import-x/no-commonjs",
523
- "import-x/no-cycle",
524
- "import-x/no-default-export",
525
- "import-x/no-duplicates",
526
- "import-x/no-dynamic-require",
527
- "import-x/no-named-as-default",
528
- "import-x/no-named-as-default-member",
529
- "import-x/no-self-import",
530
- "import-x/no-webpack-loader-syntax",
531
- "import-x/unambiguous",
532
- "vitest/consistent-test-it",
533
509
  "vitest/expect-expect",
534
- "vitest/max-expects",
535
- "vitest/max-nested-describe",
536
- "vitest/no-alias-methods",
537
- "vitest/no-commented-out-tests",
538
510
  "vitest/no-conditional-expect",
539
- "vitest/no-conditional-in-test",
540
511
  "vitest/no-disabled-tests",
541
- "vitest/no-duplicate-hooks",
542
512
  "vitest/no-focused-tests",
543
- "vitest/no-hooks",
544
- "vitest/no-identical-title",
545
- "vitest/no-interpolation-in-snapshots",
546
- "vitest/no-restricted-jest-methods",
547
- "vitest/no-restricted-matchers",
548
513
  "vitest/no-standalone-expect",
549
- "vitest/no-test-prefixes",
550
- "vitest/no-test-return-statement",
551
- "vitest/prefer-each",
552
- "vitest/prefer-comparison-matcher",
553
- "vitest/prefer-equality-matcher",
554
- "vitest/prefer-expect-resolves",
555
- "vitest/prefer-hooks-in-order",
556
- "vitest/prefer-hooks-on-top",
557
- "vitest/prefer-lowercase-title",
558
- "vitest/prefer-mock-promise-shorthand",
559
- "vitest/prefer-strict-equal",
560
- "vitest/prefer-to-have-length",
561
- "vitest/prefer-todo",
562
514
  "vitest/require-to-throw-message",
563
- "vitest/require-top-level-describe",
564
515
  "vitest/valid-describe-callback",
565
516
  "vitest/valid-expect"
566
517
  ];
567
- const nurseryRules = [
568
- "constructor-super",
569
- "getter-return",
570
- "no-undef",
571
- "no-unreachable",
572
- "import/export",
573
- "import/named",
574
- "oxc/no-map-spread",
575
- "promise/no-return-in-finally",
576
- "react-hooks/exhaustive-deps",
577
- "react/require-render-return",
578
- "@typescript-eslint/consistent-type-imports",
579
- "import-x/export",
580
- "import-x/named"
518
+ const perfRules = [
519
+ "no-useless-call",
520
+ "no-await-in-loop",
521
+ "react/no-array-index-key",
522
+ "react-perf/jsx-no-jsx-as-prop",
523
+ "react-perf/jsx-no-new-array-as-prop",
524
+ "react-perf/jsx-no-new-function-as-prop",
525
+ "react-perf/jsx-no-new-object-as-prop",
526
+ "unicorn/prefer-set-has"
527
+ ];
528
+ const suspiciousRules = [
529
+ "no-unneeded-ternary",
530
+ "no-extend-native",
531
+ "no-new",
532
+ "no-unexpected-multiline",
533
+ "no-useless-concat",
534
+ "no-useless-constructor",
535
+ "import/no-absolute-path",
536
+ "import/no-duplicates",
537
+ "import/no-named-as-default",
538
+ "import/no-named-as-default-member",
539
+ "import/no-self-import",
540
+ "jest/no-commented-out-tests",
541
+ "promise/no-promise-in-callback",
542
+ "react/iframe-missing-sandbox",
543
+ "react/jsx-no-comment-textnodes",
544
+ "react/jsx-no-script-url",
545
+ "react/no-namespace",
546
+ "react/react-in-jsx-scope",
547
+ "react/style-prop-object",
548
+ "@typescript-eslint/no-confusing-non-null-assertion",
549
+ "@typescript-eslint/no-extraneous-class",
550
+ "@typescript-eslint/no-unnecessary-type-constraint",
551
+ "unicorn/consistent-function-scoping",
552
+ "unicorn/prefer-add-event-listener",
553
+ "@typescript-eslint/no-useless-constructor",
554
+ "import-x/no-absolute-path",
555
+ "import-x/no-duplicates",
556
+ "import-x/no-named-as-default",
557
+ "import-x/no-named-as-default-member",
558
+ "import-x/no-self-import",
559
+ "vitest/no-commented-out-tests"
581
560
  ];
582
561
  export {
583
- rules as default,
584
- nurseryRules
562
+ correctnessRules,
563
+ nurseryRules,
564
+ pedanticRules,
565
+ perfRules,
566
+ restrictionRules,
567
+ styleRules,
568
+ suspiciousRules
585
569
  };
@@ -1,7 +1,38 @@
1
- import rules, { nurseryRules } from "./generated/rules.mjs";
1
+ import * as rules from "./generated/rules.mjs";
2
+ import { nurseryRules } from "./generated/rules.mjs";
2
3
  import { rulesPrefixesForPlugins, typescriptRulesExtendEslintRules } from "./constants.mjs";
4
+ const allRules = Object.values(rules).flat();
3
5
  const isValueInSet = (value, validSet) => validSet.includes(value) || Array.isArray(value) && validSet.includes(value[0]);
4
6
  const isActiveValue = (value) => isValueInSet(value, ["error", "warn", 1, 2]);
7
+ const isOffValue = (value) => isValueInSet(value, ["off", 0]);
8
+ const isErrorValue = (value) => isValueInSet(value, ["error", 1]);
9
+ const isWarnValue = (value) => isValueInSet(value, ["warn", 2]);
10
+ const normalizeSeverityValue = (value) => {
11
+ if (value === void 0) {
12
+ return value;
13
+ }
14
+ if (isWarnValue(value)) {
15
+ if (Array.isArray(value)) {
16
+ value[0] == "warn";
17
+ return value;
18
+ }
19
+ return "warn";
20
+ } else if (isErrorValue(value)) {
21
+ if (Array.isArray(value)) {
22
+ value[0] == "error";
23
+ return value;
24
+ }
25
+ return "error";
26
+ }
27
+ if (isOffValue(value)) {
28
+ if (Array.isArray(value)) {
29
+ value[0] == "off";
30
+ return value;
31
+ }
32
+ return "off";
33
+ }
34
+ return void 0;
35
+ };
5
36
  const transformRuleEntry = (eslintConfig, targetConfig, reporter) => {
6
37
  if (eslintConfig.rules === void 0) {
7
38
  return;
@@ -10,12 +41,12 @@ const transformRuleEntry = (eslintConfig, targetConfig, reporter) => {
10
41
  targetConfig.rules = {};
11
42
  }
12
43
  for (const [rule, config] of Object.entries(eslintConfig.rules)) {
13
- if (rules.includes(rule)) {
44
+ if (allRules.includes(rule)) {
14
45
  if (nurseryRules.includes(rule)) {
15
46
  reporter !== void 0 && reporter(`unsupported rule, but in development: ${rule}`);
16
47
  continue;
17
48
  }
18
- targetConfig.rules[rule] = config;
49
+ targetConfig.rules[rule] = normalizeSeverityValue(config);
19
50
  } else {
20
51
  if (isActiveValue(config)) {
21
52
  reporter !== void 0 && reporter(`unsupported rule: ${rule}`);
@@ -47,6 +78,9 @@ const detectNeededRulesPlugins = (targetConfig, reporter) => {
47
78
  reporter !== void 0 && reporter(`unsupported plugin for rule: ${rule}`);
48
79
  }
49
80
  }
81
+ if ("files" in targetConfig && targetConfig.plugins.length === 0) {
82
+ delete targetConfig.plugins;
83
+ }
50
84
  };
51
85
  const cleanUpUselessOverridesPlugins = (config) => {
52
86
  if (config.overrides === void 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxlint/migrate",
3
- "version": "0.15.13",
3
+ "version": "0.15.14",
4
4
  "description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,6 +15,7 @@
15
15
  "generate": "node --import @oxc-node/core/register ./scripts/generate.ts",
16
16
  "format": "npx prettier --write .",
17
17
  "type-check": "tsc --noEmit",
18
+ "lint": "oxlint",
18
19
  "test": "vitest",
19
20
  "build": "vite build",
20
21
  "manual-test": "pnpm build; chmod +x dist/bin/oxlint-migrate.mjs; npx ."
@@ -36,7 +37,7 @@
36
37
  "@eslint/eslintrc": "^3.3.0",
37
38
  "@eslint/js": "^9.20.0",
38
39
  "@logux/eslint-config": "^55.0.0",
39
- "@oxc-node/core": "^0.0.19",
40
+ "@oxc-node/core": "^0.0.20",
40
41
  "@stylistic/eslint-plugin": "^4.0.1",
41
42
  "@stylistic/eslint-plugin-ts": "^4.0.0",
42
43
  "@types/eslint-config-prettier": "^6.11.3",
@@ -56,7 +57,7 @@
56
57
  "eslint-plugin-unicorn": "^57.0.0",
57
58
  "husky": "^9.1.7",
58
59
  "lint-staged": "^15.4.3",
59
- "oxlint": "^0.15.13",
60
+ "oxlint": "^0.15.14",
60
61
  "prettier": "^3.5.1",
61
62
  "typescript": "^5.7.3",
62
63
  "typescript-eslint": "^8.24.0",
@@ -71,5 +72,5 @@
71
72
  "commander": "^13.1.0",
72
73
  "globals": "^16.0.0"
73
74
  },
74
- "packageManager": "pnpm@10.5.2"
75
+ "packageManager": "pnpm@10.6.1"
75
76
  }