@oxlint/migrate 0.15.13 → 0.15.15

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.15";
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,129 @@
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
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment",
98
+ "import-x/export",
99
+ "import-x/named"
100
+ ];
101
+ const styleRules = [
4
102
  "curly",
5
- "default-case",
6
103
  "default-case-last",
7
104
  "default-param-last",
8
- "eqeqeq",
9
- "for-direction",
10
105
  "func-style",
11
106
  "func-names",
12
- "getter-return",
13
107
  "grouped-accessor-pairs",
14
108
  "guard-for-in",
15
109
  "init-declarations",
16
- "max-nested-callbacks",
17
- "max-lines-per-function",
18
- "max-classes-per-file",
19
- "max-depth",
20
- "max-lines",
21
110
  "max-params",
22
111
  "new-cap",
23
- "no-useless-call",
24
- "no-unneeded-ternary",
25
112
  "no-extra-label",
26
113
  "no-multi-assign",
27
114
  "no-nested-ternary",
28
115
  "no-labels",
29
116
  "no-lone-blocks",
30
- "no-restricted-imports",
31
- "no-object-constructor",
32
117
  "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
118
  "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
119
  "no-label-var",
77
- "no-loss-of-precision",
78
120
  "no-magic-numbers",
79
- "no-negated-condition",
80
121
  "no-multi-str",
81
122
  "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
123
  "no-return-assign",
94
124
  "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
125
  "no-template-curly-in-string",
101
126
  "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
127
  "operator-assignment",
124
128
  "prefer-promise-reject-errors",
125
129
  "prefer-exponentiation-operator",
@@ -128,54 +132,24 @@ const rules = [
128
132
  "prefer-object-spread",
129
133
  "prefer-rest-params",
130
134
  "prefer-spread",
131
- "radix",
132
- "require-await",
133
- "require-yield",
134
135
  "sort-imports",
135
136
  "sort-keys",
136
- "sort-vars",
137
- "symbol-description",
138
- "unicode-bom",
139
- "use-isnan",
140
- "valid-typeof",
141
137
  "vars-on-top",
142
138
  "yoda",
143
- "import/default",
144
- "import/export",
139
+ "import/exports-last",
145
140
  "import/first",
146
- "import/no-absolute-path",
141
+ "import/no-anonymous-default-export",
147
142
  "import/no-mutable-exports",
148
143
  "import/no-named-default",
149
144
  "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
145
  "jest/consistent-test-it",
165
- "jest/expect-expect",
166
146
  "jest/max-expects",
167
147
  "jest/max-nested-describe",
168
148
  "jest/no-alias-methods",
169
- "jest/no-commented-out-tests",
170
- "jest/no-conditional-expect",
171
- "jest/no-conditional-in-test",
172
149
  "jest/no-confusing-set-timeout",
173
150
  "jest/no-deprecated-functions",
174
- "jest/no-disabled-tests",
175
151
  "jest/no-done-callback",
176
152
  "jest/no-duplicate-hooks",
177
- "jest/no-export",
178
- "jest/no-focused-tests",
179
153
  "jest/no-hooks",
180
154
  "jest/no-identical-title",
181
155
  "jest/no-interpolation-in-snapshots",
@@ -184,7 +158,6 @@ const rules = [
184
158
  "jest/no-mocks-import",
185
159
  "jest/no-restricted-jest-methods",
186
160
  "jest/no-restricted-matchers",
187
- "jest/no-standalone-expect",
188
161
  "jest/no-test-prefixes",
189
162
  "jest/no-test-return-statement",
190
163
  "jest/no-untyped-mock-factory",
@@ -205,28 +178,239 @@ const rules = [
205
178
  "jest/prefer-to-have-length",
206
179
  "jest/prefer-todo",
207
180
  "jest/require-hook",
208
- "jest/require-to-throw-message",
209
181
  "jest/require-top-level-describe",
182
+ "node/no-exports-assign",
183
+ "promise/avoid-new",
184
+ "promise/no-return-wrap",
185
+ "promise/no-nesting",
186
+ "promise/param-names",
187
+ "promise/prefer-catch",
188
+ "promise/prefer-await-to-callbacks",
189
+ "promise/prefer-await-to-then",
190
+ "react/jsx-boolean-value",
191
+ "react/jsx-curly-brace-presence",
192
+ "react/no-set-state",
193
+ "react/prefer-es6-class",
194
+ "react/self-closing-comp",
195
+ "@typescript-eslint/adjacent-overload-signatures",
196
+ "@typescript-eslint/array-type",
197
+ "@typescript-eslint/ban-tslint-comment",
198
+ "@typescript-eslint/consistent-generic-constructors",
199
+ "@typescript-eslint/consistent-indexed-object-style",
200
+ "@typescript-eslint/consistent-type-definitions",
201
+ "@typescript-eslint/no-inferrable-types",
202
+ "@typescript-eslint/no-empty-interface",
203
+ "@typescript-eslint/prefer-for-of",
204
+ "@typescript-eslint/prefer-function-type",
205
+ "@typescript-eslint/prefer-namespace-keyword",
206
+ "unicorn/catch-error-name",
207
+ "unicorn/consistent-date-clone",
208
+ "unicorn/consistent-existence-index-check",
209
+ "unicorn/empty-brace-spaces",
210
+ "unicorn/error-message",
211
+ "unicorn/filename-case",
212
+ "unicorn/no-await-expression-member",
213
+ "unicorn/no-console-spaces",
214
+ "unicorn/no-null",
215
+ "unicorn/no-unreadable-array-destructuring",
216
+ "unicorn/no-zero-fractions",
217
+ "unicorn/number-literal-case",
218
+ "unicorn/numeric-separators-style",
219
+ "unicorn/prefer-spread",
220
+ "unicorn/prefer-array-flat-map",
221
+ "unicorn/prefer-dom-node-text-content",
222
+ "unicorn/prefer-includes",
223
+ "unicorn/prefer-logical-operator-over-ternary",
224
+ "unicorn/prefer-modern-dom-apis",
225
+ "unicorn/prefer-negative-index",
226
+ "unicorn/prefer-optional-catch-binding",
227
+ "unicorn/prefer-reflect-apply",
228
+ "unicorn/prefer-string-raw",
229
+ "unicorn/prefer-string-trim-start-end",
230
+ "unicorn/prefer-structured-clone",
231
+ "unicorn/require-array-join-separator",
232
+ "unicorn/switch-case-braces",
233
+ "unicorn/text-encoding-identifier-case",
234
+ "unicorn/throw-new-error",
235
+ "vitest/no-import-node-test",
236
+ "vitest/prefer-to-be-falsy",
237
+ "vitest/prefer-to-be-object",
238
+ "vitest/prefer-to-be-truthy",
239
+ "@typescript-eslint/default-param-last",
240
+ "@typescript-eslint/init-declarations",
241
+ "@typescript-eslint/max-params",
242
+ "@typescript-eslint/no-magic-numbers",
243
+ "import-x/exports-last",
244
+ "import-x/first",
245
+ "import-x/no-anonymous-default-export",
246
+ "import-x/no-mutable-exports",
247
+ "import-x/no-named-default",
248
+ "import-x/no-namespace",
249
+ "vitest/consistent-test-it",
250
+ "vitest/max-expects",
251
+ "vitest/max-nested-describe",
252
+ "vitest/no-alias-methods",
253
+ "vitest/no-duplicate-hooks",
254
+ "vitest/no-hooks",
255
+ "vitest/no-identical-title",
256
+ "vitest/no-interpolation-in-snapshots",
257
+ "vitest/no-restricted-jest-methods",
258
+ "vitest/no-restricted-matchers",
259
+ "vitest/no-test-prefixes",
260
+ "vitest/no-test-return-statement",
261
+ "vitest/prefer-each",
262
+ "vitest/prefer-comparison-matcher",
263
+ "vitest/prefer-equality-matcher",
264
+ "vitest/prefer-expect-resolves",
265
+ "vitest/prefer-hooks-in-order",
266
+ "vitest/prefer-hooks-on-top",
267
+ "vitest/prefer-lowercase-title",
268
+ "vitest/prefer-mock-promise-shorthand",
269
+ "vitest/prefer-strict-equal",
270
+ "vitest/prefer-to-have-length",
271
+ "vitest/prefer-todo",
272
+ "vitest/require-top-level-describe"
273
+ ];
274
+ const restrictionRules = [
275
+ "default-case",
276
+ "no-restricted-imports",
277
+ "no-alert",
278
+ "no-bitwise",
279
+ "no-console",
280
+ "no-div-regex",
281
+ "no-empty-function",
282
+ "no-empty",
283
+ "no-eq-null",
284
+ "no-iterator",
285
+ "no-plusplus",
286
+ "no-proto",
287
+ "no-regex-spaces",
288
+ "no-restricted-globals",
289
+ "no-undefined",
290
+ "no-unused-expressions",
291
+ "no-var",
292
+ "no-void",
293
+ "unicode-bom",
294
+ "import/no-amd",
295
+ "import/no-commonjs",
296
+ "import/no-cycle",
297
+ "import/no-default-export",
298
+ "import/no-dynamic-require",
299
+ "import/no-webpack-loader-syntax",
300
+ "import/unambiguous",
301
+ "jsdoc/check-access",
302
+ "jsdoc/empty-tags",
303
+ "jsx-a11y/anchor-ambiguous-text",
304
+ "node/no-new-require",
305
+ "promise/catch-or-return",
306
+ "promise/spec-only",
307
+ "react/button-has-type",
308
+ "react/jsx-filename-extension",
309
+ "react/no-danger",
310
+ "react/no-unknown-property",
311
+ "@typescript-eslint/explicit-function-return-type",
312
+ "@typescript-eslint/no-dynamic-delete",
313
+ "@typescript-eslint/no-empty-object-type",
314
+ "@typescript-eslint/no-explicit-any",
315
+ "@typescript-eslint/no-import-type-side-effects",
316
+ "@typescript-eslint/no-namespace",
317
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing",
318
+ "@typescript-eslint/no-non-null-assertion",
319
+ "@typescript-eslint/no-require-imports",
320
+ "@typescript-eslint/no-var-requires",
321
+ "@typescript-eslint/prefer-literal-enum-member",
322
+ "unicorn/no-abusive-eslint-disable",
323
+ "unicorn/no-anonymous-default-export",
324
+ "unicorn/no-array-for-each",
325
+ "unicorn/no-array-reduce",
326
+ "unicorn/no-length-as-slice-end",
327
+ "unicorn/no-magic-array-flat-depth",
328
+ "unicorn/no-nested-ternary",
329
+ "unicorn/no-process-exit",
330
+ "unicorn/prefer-modern-math-apis",
331
+ "unicorn/prefer-node-protocol",
332
+ "unicorn/prefer-number-properties",
333
+ "@typescript-eslint/no-restricted-imports",
334
+ "@typescript-eslint/no-empty-function",
335
+ "@typescript-eslint/no-unused-expressions",
336
+ "import-x/no-amd",
337
+ "import-x/no-commonjs",
338
+ "import-x/no-cycle",
339
+ "import-x/no-default-export",
340
+ "import-x/no-dynamic-require",
341
+ "import-x/no-webpack-loader-syntax",
342
+ "import-x/unambiguous"
343
+ ];
344
+ const correctnessRules = [
345
+ "for-direction",
346
+ "no-async-promise-executor",
347
+ "no-caller",
348
+ "no-class-assign",
349
+ "no-compare-neg-zero",
350
+ "no-cond-assign",
351
+ "no-const-assign",
352
+ "no-constant-binary-expression",
353
+ "no-constant-condition",
354
+ "no-control-regex",
355
+ "no-debugger",
356
+ "no-delete-var",
357
+ "no-dupe-class-members",
358
+ "no-dupe-else-if",
359
+ "no-dupe-keys",
360
+ "no-duplicate-case",
361
+ "no-empty-character-class",
362
+ "no-empty-pattern",
363
+ "no-empty-static-block",
364
+ "no-eval",
365
+ "no-ex-assign",
366
+ "no-extra-boolean-cast",
367
+ "no-func-assign",
368
+ "no-global-assign",
369
+ "no-import-assign",
370
+ "no-invalid-regexp",
371
+ "no-irregular-whitespace",
372
+ "no-loss-of-precision",
373
+ "no-new-native-nonconstructor",
374
+ "no-nonoctal-decimal-escape",
375
+ "no-obj-calls",
376
+ "no-self-assign",
377
+ "no-setter-return",
378
+ "no-shadow-restricted-names",
379
+ "no-sparse-arrays",
380
+ "no-this-before-super",
381
+ "no-unsafe-finally",
382
+ "no-unsafe-negation",
383
+ "no-unsafe-optional-chaining",
384
+ "no-unused-labels",
385
+ "no-unused-private-class-members",
386
+ "no-unused-vars",
387
+ "no-useless-catch",
388
+ "no-useless-escape",
389
+ "no-useless-rename",
390
+ "no-with",
391
+ "require-yield",
392
+ "use-isnan",
393
+ "valid-typeof",
394
+ "import/default",
395
+ "import/namespace",
396
+ "jest/expect-expect",
397
+ "jest/no-conditional-expect",
398
+ "jest/no-disabled-tests",
399
+ "jest/no-export",
400
+ "jest/no-focused-tests",
401
+ "jest/no-standalone-expect",
402
+ "jest/require-to-throw-message",
210
403
  "jest/valid-describe-callback",
211
404
  "jest/valid-expect",
212
405
  "jest/valid-title",
213
- "jsdoc/check-access",
214
406
  "jsdoc/check-property-names",
215
407
  "jsdoc/check-tag-names",
216
- "jsdoc/empty-tags",
217
408
  "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",
409
+ "jsdoc/no-defaults",
223
410
  "jsdoc/require-property",
224
411
  "jsdoc/require-property-description",
225
412
  "jsdoc/require-property-name",
226
413
  "jsdoc/require-property-type",
227
- "jsdoc/require-returns",
228
- "jsdoc/require-returns-description",
229
- "jsdoc/require-returns-type",
230
414
  "jsdoc/require-yields",
231
415
  "jsx-a11y/alt-text",
232
416
  "jsx-a11y/anchor-has-content",
@@ -256,7 +440,6 @@ const rules = [
256
440
  "jsx-a11y/role-supports-aria-props",
257
441
  "jsx-a11y/scope",
258
442
  "jsx-a11y/tabindex-no-positive",
259
- "jsx-a11y/anchor-ambiguous-text",
260
443
  "@next/next/google-font-display",
261
444
  "@next/next/google-font-preconnect",
262
445
  "@next/next/inline-script-id",
@@ -277,309 +460,112 @@ const rules = [
277
460
  "@next/next/no-title-in-document-head",
278
461
  "@next/next/no-typos",
279
462
  "@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
463
  "promise/no-callback-in-promise",
312
464
  "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
465
  "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
466
  "react/jsx-key",
326
- "react/jsx-no-comment-textnodes",
327
467
  "react/jsx-no-duplicate-props",
328
- "react/jsx-no-script-url",
329
468
  "react/jsx-no-target-blank",
330
469
  "react/jsx-no-undef",
331
- "react/jsx-no-useless-fragment",
332
470
  "react/jsx-props-no-spread-multi",
333
- "react/no-namespace",
334
- "react/no-array-index-key",
335
471
  "react/no-children-prop",
336
472
  "react/no-danger-with-children",
337
- "react/no-danger",
338
473
  "react/no-direct-mutation-state",
339
474
  "react/no-find-dom-node",
340
475
  "react/no-is-mounted",
341
476
  "react/no-render-return-value",
342
- "react/no-set-state",
343
477
  "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
478
  "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
479
  "@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
480
  "@typescript-eslint/no-extra-non-null-assertion",
375
- "@typescript-eslint/no-extraneous-class",
376
- "@typescript-eslint/no-import-type-side-effects",
377
481
  "@typescript-eslint/no-misused-new",
378
- "@typescript-eslint/no-namespace",
379
- "@typescript-eslint/no-non-null-asserted-nullish-coalescing",
380
482
  "@typescript-eslint/no-non-null-asserted-optional-chain",
381
- "@typescript-eslint/no-non-null-assertion",
382
- "@typescript-eslint/no-require-imports",
383
483
  "@typescript-eslint/no-this-alias",
384
- "@typescript-eslint/no-unnecessary-type-constraint",
385
484
  "@typescript-eslint/no-unsafe-declaration-merging",
386
- "@typescript-eslint/no-unsafe-function-type",
387
485
  "@typescript-eslint/no-useless-empty-export",
388
- "@typescript-eslint/no-var-requires",
389
486
  "@typescript-eslint/no-wrapper-object-types",
390
487
  "@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
488
  "@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
489
  "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
490
  "unicorn/no-await-in-promise-methods",
416
- "unicorn/no-console-spaces",
417
491
  "unicorn/no-document-cookie",
418
492
  "unicorn/no-empty-file",
419
- "unicorn/no-hex-escape",
420
- "unicorn/no-instanceof-array",
421
493
  "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
494
  "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
495
  "unicorn/no-single-promise-in-promise-methods",
433
- "unicorn/no-static-only-class",
434
496
  "unicorn/no-thenable",
435
- "unicorn/no-this-assignment",
436
- "unicorn/no-typeof-undefined",
437
497
  "unicorn/no-unnecessary-await",
438
- "unicorn/no-unreadable-array-destructuring",
439
- "unicorn/no-unreadable-iife",
440
498
  "unicorn/no-useless-fallback-in-spread",
441
499
  "unicorn/no-useless-length-check",
442
- "unicorn/no-useless-promise-resolve-reject",
443
500
  "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
501
  "unicorn/prefer-set-size",
479
- "unicorn/prefer-string-raw",
480
- "unicorn/prefer-string-replace-all",
481
- "unicorn/prefer-string-slice",
482
502
  "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
503
  "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
504
  "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
505
  "@typescript-eslint/no-dupe-class-members",
503
- "@typescript-eslint/no-empty-function",
504
506
  "@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
507
  "@typescript-eslint/no-unused-vars",
510
- "@typescript-eslint/no-useless-constructor",
511
508
  "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
509
  "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
510
  "vitest/expect-expect",
534
- "vitest/max-expects",
535
- "vitest/max-nested-describe",
536
- "vitest/no-alias-methods",
537
- "vitest/no-commented-out-tests",
538
511
  "vitest/no-conditional-expect",
539
- "vitest/no-conditional-in-test",
540
512
  "vitest/no-disabled-tests",
541
- "vitest/no-duplicate-hooks",
542
513
  "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
514
  "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
515
  "vitest/require-to-throw-message",
563
- "vitest/require-top-level-describe",
564
516
  "vitest/valid-describe-callback",
565
517
  "vitest/valid-expect"
566
518
  ];
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"
519
+ const perfRules = [
520
+ "no-useless-call",
521
+ "no-await-in-loop",
522
+ "react/no-array-index-key",
523
+ "react-perf/jsx-no-jsx-as-prop",
524
+ "react-perf/jsx-no-new-array-as-prop",
525
+ "react-perf/jsx-no-new-function-as-prop",
526
+ "react-perf/jsx-no-new-object-as-prop",
527
+ "unicorn/prefer-set-has"
528
+ ];
529
+ const suspiciousRules = [
530
+ "no-unneeded-ternary",
531
+ "no-extend-native",
532
+ "no-new",
533
+ "no-unexpected-multiline",
534
+ "no-useless-concat",
535
+ "no-useless-constructor",
536
+ "import/no-absolute-path",
537
+ "import/no-duplicates",
538
+ "import/no-named-as-default",
539
+ "import/no-named-as-default-member",
540
+ "import/no-self-import",
541
+ "jest/no-commented-out-tests",
542
+ "promise/no-promise-in-callback",
543
+ "react/iframe-missing-sandbox",
544
+ "react/jsx-no-comment-textnodes",
545
+ "react/jsx-no-script-url",
546
+ "react/no-namespace",
547
+ "react/react-in-jsx-scope",
548
+ "react/style-prop-object",
549
+ "@typescript-eslint/no-confusing-non-null-assertion",
550
+ "@typescript-eslint/no-extraneous-class",
551
+ "@typescript-eslint/no-unnecessary-type-constraint",
552
+ "unicorn/consistent-function-scoping",
553
+ "unicorn/prefer-add-event-listener",
554
+ "unicorn/require-post-message-target-origin",
555
+ "@typescript-eslint/no-useless-constructor",
556
+ "import-x/no-absolute-path",
557
+ "import-x/no-duplicates",
558
+ "import-x/no-named-as-default",
559
+ "import-x/no-named-as-default-member",
560
+ "import-x/no-self-import",
561
+ "vitest/no-commented-out-tests"
581
562
  ];
582
563
  export {
583
- rules as default,
584
- nurseryRules
564
+ correctnessRules,
565
+ nurseryRules,
566
+ pedanticRules,
567
+ perfRules,
568
+ restrictionRules,
569
+ styleRules,
570
+ suspiciousRules
585
571
  };
@@ -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.15",
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.15",
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
  }