@oxlint/migrate 1.48.0 → 1.50.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as preFixForJsPlugins, f as
|
|
2
|
+
import { a as preFixForJsPlugins, f as buildUnsupportedRuleExplanations, m as rules_exports, p as nurseryRules, u as isOffValue } from "../settings-D8R7axmT.mjs";
|
|
3
3
|
import main from "../src/index.mjs";
|
|
4
4
|
import { program } from "commander";
|
|
5
5
|
import { existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
@@ -33,7 +33,7 @@ const loadESLintConfig = async (filePath) => {
|
|
|
33
33
|
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region package.json
|
|
36
|
-
var version = "1.
|
|
36
|
+
var version = "1.50.0";
|
|
37
37
|
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/walker/comments/replaceRuleDirectiveComment.ts
|
|
@@ -278,6 +278,7 @@ var DefaultReporter = class {
|
|
|
278
278
|
skippedRules = new Map([
|
|
279
279
|
["nursery", /* @__PURE__ */ new Set()],
|
|
280
280
|
["type-aware", /* @__PURE__ */ new Set()],
|
|
281
|
+
["not-implemented", /* @__PURE__ */ new Set()],
|
|
281
282
|
["unsupported", /* @__PURE__ */ new Set()],
|
|
282
283
|
["js-plugins", /* @__PURE__ */ new Set()]
|
|
283
284
|
]);
|
|
@@ -297,6 +298,7 @@ var DefaultReporter = class {
|
|
|
297
298
|
const result = {
|
|
298
299
|
nursery: [],
|
|
299
300
|
"type-aware": [],
|
|
301
|
+
"not-implemented": [],
|
|
300
302
|
"js-plugins": [],
|
|
301
303
|
unsupported: []
|
|
302
304
|
};
|
|
@@ -307,6 +309,7 @@ var DefaultReporter = class {
|
|
|
307
309
|
|
|
308
310
|
//#endregion
|
|
309
311
|
//#region bin/output-formatter.ts
|
|
312
|
+
const unsupportedRuleExplanations = buildUnsupportedRuleExplanations();
|
|
310
313
|
const CATEGORY_METADATA = {
|
|
311
314
|
nursery: {
|
|
312
315
|
label: "Nursery",
|
|
@@ -320,7 +323,14 @@ const CATEGORY_METADATA = {
|
|
|
320
323
|
label: "JS Plugins",
|
|
321
324
|
description: "Requires JS plugins:"
|
|
322
325
|
},
|
|
323
|
-
|
|
326
|
+
"not-implemented": {
|
|
327
|
+
label: "Not Implemented",
|
|
328
|
+
description: "Not yet in oxlint:"
|
|
329
|
+
},
|
|
330
|
+
unsupported: {
|
|
331
|
+
label: "Unsupported",
|
|
332
|
+
description: "Won't be implemented:"
|
|
333
|
+
}
|
|
324
334
|
};
|
|
325
335
|
const MAX_LABEL_LENGTH = Math.max(...Object.values(CATEGORY_METADATA).map((meta) => meta.label.length));
|
|
326
336
|
/**
|
|
@@ -336,7 +346,8 @@ function formatCategorySummary(count, category, rules, showAll) {
|
|
|
336
346
|
return ` - ${String(count).padStart(3)} ${meta.label.padEnd(MAX_LABEL_LENGTH)} (${prefix}${exampleList}${suffix})\n`;
|
|
337
347
|
}
|
|
338
348
|
let output = ` - ${count} ${meta.label}\n`;
|
|
339
|
-
for (const rule of rules) output += ` - ${rule}\n`;
|
|
349
|
+
for (const rule of rules) if (category === "unsupported" && unsupportedRuleExplanations[rule]) output += ` - ${rule}: ${unsupportedRuleExplanations[rule]}\n`;
|
|
350
|
+
else output += ` - ${rule}\n`;
|
|
340
351
|
return output;
|
|
341
352
|
}
|
|
342
353
|
/**
|
|
@@ -360,18 +371,20 @@ function formatMigrationOutput(data) {
|
|
|
360
371
|
const byCategory = data.skippedRulesByCategory;
|
|
361
372
|
const nurseryCount = byCategory.nursery.length;
|
|
362
373
|
const typeAwareCount = byCategory["type-aware"].length;
|
|
374
|
+
const notImplementedCount = byCategory["not-implemented"].length;
|
|
363
375
|
const unsupportedCount = byCategory.unsupported.length;
|
|
364
376
|
const jsPluginsCount = byCategory["js-plugins"].length;
|
|
365
|
-
const totalSkipped = nurseryCount + typeAwareCount + unsupportedCount + jsPluginsCount;
|
|
377
|
+
const totalSkipped = nurseryCount + typeAwareCount + notImplementedCount + unsupportedCount + jsPluginsCount;
|
|
366
378
|
if (totalSkipped > 0) {
|
|
367
379
|
output += `\n Skipped ${totalSkipped} rules:\n`;
|
|
368
380
|
if (nurseryCount > 0) output += formatCategorySummary(nurseryCount, "nursery", byCategory.nursery, showAll);
|
|
369
381
|
if (typeAwareCount > 0) output += formatCategorySummary(typeAwareCount, "type-aware", byCategory["type-aware"], showAll);
|
|
370
382
|
if (jsPluginsCount > 0) output += formatCategorySummary(jsPluginsCount, "js-plugins", byCategory["js-plugins"], showAll);
|
|
383
|
+
if (notImplementedCount > 0) output += formatCategorySummary(notImplementedCount, "not-implemented", byCategory["not-implemented"], showAll);
|
|
371
384
|
if (unsupportedCount > 0) output += formatCategorySummary(unsupportedCount, "unsupported", byCategory.unsupported, showAll);
|
|
372
385
|
if (!showAll) {
|
|
373
386
|
const maxExamples = 3;
|
|
374
|
-
if (nurseryCount > maxExamples || typeAwareCount > maxExamples || unsupportedCount > maxExamples || jsPluginsCount > maxExamples) output += `\n Tip: Use --details to see the full list.\n`;
|
|
387
|
+
if (nurseryCount > maxExamples || typeAwareCount > maxExamples || notImplementedCount > maxExamples || unsupportedCount > maxExamples || jsPluginsCount > maxExamples) output += `\n Tip: Use --details to see the full list.\n`;
|
|
375
388
|
}
|
|
376
389
|
const missingFlags = detectMissingFlags(byCategory, data.cliOptions);
|
|
377
390
|
if (missingFlags.length > 0) {
|
|
@@ -391,6 +391,7 @@ const styleRules = [
|
|
|
391
391
|
"jest/prefer-jest-mocked",
|
|
392
392
|
"jest/prefer-lowercase-title",
|
|
393
393
|
"jest/prefer-mock-promise-shorthand",
|
|
394
|
+
"jest/prefer-mock-return-shorthand",
|
|
394
395
|
"jest/prefer-spy-on",
|
|
395
396
|
"jest/prefer-strict-equal",
|
|
396
397
|
"jest/prefer-to-be",
|
|
@@ -475,6 +476,7 @@ const styleRules = [
|
|
|
475
476
|
"unicorn/prefer-string-raw",
|
|
476
477
|
"unicorn/prefer-string-trim-start-end",
|
|
477
478
|
"unicorn/prefer-structured-clone",
|
|
479
|
+
"unicorn/prefer-ternary",
|
|
478
480
|
"unicorn/relative-url-style",
|
|
479
481
|
"unicorn/require-array-join-separator",
|
|
480
482
|
"unicorn/require-module-attributes",
|
|
@@ -484,10 +486,12 @@ const styleRules = [
|
|
|
484
486
|
"vitest/consistent-test-filename",
|
|
485
487
|
"vitest/consistent-vitest-vi",
|
|
486
488
|
"vitest/no-import-node-test",
|
|
489
|
+
"vitest/no-importing-vitest-globals",
|
|
487
490
|
"vitest/prefer-called-once",
|
|
488
491
|
"vitest/prefer-called-times",
|
|
489
492
|
"vitest/prefer-describe-function-title",
|
|
490
493
|
"vitest/prefer-expect-type-of",
|
|
494
|
+
"vitest/prefer-import-in-mock",
|
|
491
495
|
"vitest/prefer-to-be-falsy",
|
|
492
496
|
"vitest/prefer-to-be-object",
|
|
493
497
|
"vitest/prefer-to-be-truthy",
|
|
@@ -535,6 +539,7 @@ const styleRules = [
|
|
|
535
539
|
"vitest/prefer-hooks-on-top",
|
|
536
540
|
"vitest/prefer-lowercase-title",
|
|
537
541
|
"vitest/prefer-mock-promise-shorthand",
|
|
542
|
+
"vitest/prefer-mock-return-shorthand",
|
|
538
543
|
"vitest/prefer-spy-on",
|
|
539
544
|
"vitest/prefer-strict-equal",
|
|
540
545
|
"vitest/prefer-to-be",
|
|
@@ -622,6 +627,7 @@ const restrictionRules = [
|
|
|
622
627
|
"no-restricted-imports",
|
|
623
628
|
"no-sequences",
|
|
624
629
|
"no-undefined",
|
|
630
|
+
"no-use-before-define",
|
|
625
631
|
"no-var",
|
|
626
632
|
"no-void",
|
|
627
633
|
"unicode-bom",
|
|
@@ -638,6 +644,7 @@ const restrictionRules = [
|
|
|
638
644
|
"jsdoc/empty-tags",
|
|
639
645
|
"jsx-a11y/anchor-ambiguous-text",
|
|
640
646
|
"node/no-new-require",
|
|
647
|
+
"node/no-path-concat",
|
|
641
648
|
"node/no-process-env",
|
|
642
649
|
"promise/catch-or-return",
|
|
643
650
|
"promise/spec-only",
|
|
@@ -661,7 +668,6 @@ const restrictionRules = [
|
|
|
661
668
|
"@typescript-eslint/no-non-null-assertion",
|
|
662
669
|
"@typescript-eslint/no-require-imports",
|
|
663
670
|
"@typescript-eslint/no-restricted-types",
|
|
664
|
-
"@typescript-eslint/no-use-before-define",
|
|
665
671
|
"@typescript-eslint/no-var-requires",
|
|
666
672
|
"@typescript-eslint/non-nullable-type-assertion-style",
|
|
667
673
|
"@typescript-eslint/prefer-literal-enum-member",
|
|
@@ -677,6 +683,7 @@ const restrictionRules = [
|
|
|
677
683
|
"unicorn/no-process-exit",
|
|
678
684
|
"unicorn/no-useless-error-capture-stack-trace",
|
|
679
685
|
"unicorn/prefer-modern-math-apis",
|
|
686
|
+
"unicorn/prefer-module",
|
|
680
687
|
"unicorn/prefer-node-protocol",
|
|
681
688
|
"unicorn/prefer-number-properties",
|
|
682
689
|
"vue/max-props",
|
|
@@ -685,6 +692,7 @@ const restrictionRules = [
|
|
|
685
692
|
"@typescript-eslint/class-methods-use-this",
|
|
686
693
|
"@typescript-eslint/no-empty-function",
|
|
687
694
|
"@typescript-eslint/no-restricted-imports",
|
|
695
|
+
"@typescript-eslint/no-use-before-define",
|
|
688
696
|
"import-x/extensions",
|
|
689
697
|
"import-x/no-amd",
|
|
690
698
|
"import-x/no-commonjs",
|
|
@@ -695,6 +703,7 @@ const restrictionRules = [
|
|
|
695
703
|
"import-x/no-webpack-loader-syntax",
|
|
696
704
|
"import-x/unambiguous",
|
|
697
705
|
"n/no-new-require",
|
|
706
|
+
"n/no-path-concat",
|
|
698
707
|
"n/no-process-env",
|
|
699
708
|
"react-refresh/only-export-components"
|
|
700
709
|
];
|
|
@@ -922,8 +931,20 @@ const nurseryRules = [
|
|
|
922
931
|
"import/named",
|
|
923
932
|
"promise/no-return-in-finally",
|
|
924
933
|
"react/require-render-return",
|
|
934
|
+
"@typescript-eslint/consistent-return",
|
|
935
|
+
"@typescript-eslint/consistent-type-exports",
|
|
936
|
+
"@typescript-eslint/dot-notation",
|
|
925
937
|
"@typescript-eslint/no-unnecessary-condition",
|
|
938
|
+
"@typescript-eslint/no-unnecessary-qualifier",
|
|
939
|
+
"@typescript-eslint/no-unnecessary-type-parameters",
|
|
940
|
+
"@typescript-eslint/no-useless-default-assignment",
|
|
941
|
+
"@typescript-eslint/prefer-find",
|
|
926
942
|
"@typescript-eslint/prefer-optional-chain",
|
|
943
|
+
"@typescript-eslint/prefer-readonly",
|
|
944
|
+
"@typescript-eslint/prefer-readonly-parameter-types",
|
|
945
|
+
"@typescript-eslint/prefer-regexp-exec",
|
|
946
|
+
"@typescript-eslint/prefer-string-starts-ends-with",
|
|
947
|
+
"@typescript-eslint/strict-void-return",
|
|
927
948
|
"import-x/export",
|
|
928
949
|
"import-x/named"
|
|
929
950
|
];
|
|
@@ -942,6 +963,9 @@ const perfRules = [
|
|
|
942
963
|
];
|
|
943
964
|
const typeAwareRules = [
|
|
944
965
|
"@typescript-eslint/await-thenable",
|
|
966
|
+
"@typescript-eslint/consistent-return",
|
|
967
|
+
"@typescript-eslint/consistent-type-exports",
|
|
968
|
+
"@typescript-eslint/dot-notation",
|
|
945
969
|
"@typescript-eslint/no-array-delete",
|
|
946
970
|
"@typescript-eslint/no-base-to-string",
|
|
947
971
|
"@typescript-eslint/no-confusing-void-expression",
|
|
@@ -957,9 +981,11 @@ const typeAwareRules = [
|
|
|
957
981
|
"@typescript-eslint/no-redundant-type-constituents",
|
|
958
982
|
"@typescript-eslint/no-unnecessary-boolean-literal-compare",
|
|
959
983
|
"@typescript-eslint/no-unnecessary-condition",
|
|
984
|
+
"@typescript-eslint/no-unnecessary-qualifier",
|
|
960
985
|
"@typescript-eslint/no-unnecessary-template-expression",
|
|
961
986
|
"@typescript-eslint/no-unnecessary-type-arguments",
|
|
962
987
|
"@typescript-eslint/no-unnecessary-type-assertion",
|
|
988
|
+
"@typescript-eslint/no-unnecessary-type-parameters",
|
|
963
989
|
"@typescript-eslint/no-unsafe-argument",
|
|
964
990
|
"@typescript-eslint/no-unsafe-assignment",
|
|
965
991
|
"@typescript-eslint/no-unsafe-call",
|
|
@@ -968,14 +994,20 @@ const typeAwareRules = [
|
|
|
968
994
|
"@typescript-eslint/no-unsafe-return",
|
|
969
995
|
"@typescript-eslint/no-unsafe-type-assertion",
|
|
970
996
|
"@typescript-eslint/no-unsafe-unary-minus",
|
|
997
|
+
"@typescript-eslint/no-useless-default-assignment",
|
|
971
998
|
"@typescript-eslint/non-nullable-type-assertion-style",
|
|
972
999
|
"@typescript-eslint/only-throw-error",
|
|
1000
|
+
"@typescript-eslint/prefer-find",
|
|
973
1001
|
"@typescript-eslint/prefer-includes",
|
|
974
1002
|
"@typescript-eslint/prefer-nullish-coalescing",
|
|
975
1003
|
"@typescript-eslint/prefer-optional-chain",
|
|
976
1004
|
"@typescript-eslint/prefer-promise-reject-errors",
|
|
1005
|
+
"@typescript-eslint/prefer-readonly",
|
|
1006
|
+
"@typescript-eslint/prefer-readonly-parameter-types",
|
|
977
1007
|
"@typescript-eslint/prefer-reduce-type-parameter",
|
|
1008
|
+
"@typescript-eslint/prefer-regexp-exec",
|
|
978
1009
|
"@typescript-eslint/prefer-return-this-type",
|
|
1010
|
+
"@typescript-eslint/prefer-string-starts-ends-with",
|
|
979
1011
|
"@typescript-eslint/promise-function-async",
|
|
980
1012
|
"@typescript-eslint/related-getter-setter-pairs",
|
|
981
1013
|
"@typescript-eslint/require-array-sort-compare",
|
|
@@ -984,6 +1016,7 @@ const typeAwareRules = [
|
|
|
984
1016
|
"@typescript-eslint/restrict-template-expressions",
|
|
985
1017
|
"@typescript-eslint/return-await",
|
|
986
1018
|
"@typescript-eslint/strict-boolean-expressions",
|
|
1019
|
+
"@typescript-eslint/strict-void-return",
|
|
987
1020
|
"@typescript-eslint/switch-exhaustiveness-check",
|
|
988
1021
|
"@typescript-eslint/unbound-method",
|
|
989
1022
|
"@typescript-eslint/use-unknown-in-catch-callback-variable"
|
|
@@ -1072,9 +1105,403 @@ const enableJsPluginRule = (targetConfig, rule, ruleEntry) => {
|
|
|
1072
1105
|
return true;
|
|
1073
1106
|
};
|
|
1074
1107
|
|
|
1108
|
+
//#endregion
|
|
1109
|
+
//#region src/generated/unsupported-rules.json
|
|
1110
|
+
var unsupportedRules = {
|
|
1111
|
+
"eslint/no-dupe-args": "Superseded by strict mode.",
|
|
1112
|
+
"eslint/no-octal": "Superseded by strict mode.",
|
|
1113
|
+
"eslint/no-octal-escape": "Superseded by strict mode.",
|
|
1114
|
+
"eslint/no-new-symbol": "Deprecated as of ESLint v9, but for a while disable manually.",
|
|
1115
|
+
"eslint/no-undef-init": "#6456, `unicorn/no-useless-undefined` covers this case.",
|
|
1116
|
+
"import/no-unresolved": "Will always contain false positives due to module resolution complexity.",
|
|
1117
|
+
"promise/no-native": "Handled by `eslint/no-undef`.",
|
|
1118
|
+
"unicorn/no-for-loop": "This rule suggests using `Array.prototype.entries` which is slow https://github.com/oxc-project/oxc/issues/11311, furthermore, `typescript/prefer-for-of` covers most cases.",
|
|
1119
|
+
"eslint/no-negated-in-lhs": "Replaced by `eslint/no-unsafe-negation`, which we support.",
|
|
1120
|
+
"eslint/no-catch-shadow": "Replaced by `eslint/no-shadow`.",
|
|
1121
|
+
"eslint/id-blacklist": "Replaced by `eslint/id-denylist`.",
|
|
1122
|
+
"eslint/no-new-object": "Replaced by `eslint/no-object-constructor`, which we support.",
|
|
1123
|
+
"eslint/no-native-reassign": "Replaced by `eslint/no-global-assign`, which we support.",
|
|
1124
|
+
"n/shebang": "Replaced by `node/hashbang`.",
|
|
1125
|
+
"n/no-hide-core-modules": "This rule is deprecated in eslint-plugin-n for being inherently incorrect, no need for us to implement it.",
|
|
1126
|
+
"unicorn/no-array-push-push": "Replaced by `unicorn/prefer-single-call`.",
|
|
1127
|
+
"import/imports-first": "Replaced by `import/first`, which we support.",
|
|
1128
|
+
"eslint/dot-notation": "Use `typescript/dot-notation` instead, which we support as a type-aware rule.",
|
|
1129
|
+
"eslint/consistent-return": "Use `typescript/consistent-return` instead, which we support as a type-aware rule.",
|
|
1130
|
+
"eslint/no-useless-default-assignment": "Use `typescript/no-useless-default-assignment` instead, which will be supported as a type-aware rule.",
|
|
1131
|
+
"react/jsx-sort-default-props": "Replaced by `react/sort-default-props`.",
|
|
1132
|
+
"vitest/no-done-callback": "[Deprecated in eslint-plugin-vitest](https://github.com/vitest-dev/eslint-plugin-vitest/issues/158).",
|
|
1133
|
+
"eslint/no-return-await": "Deprecated, not recommended anymore by ESLint.",
|
|
1134
|
+
"eslint/prefer-reflect": "Deprecated, not recommended anymore by ESLint.",
|
|
1135
|
+
"jsx-a11y/accessible-emoji": "Deprecated.",
|
|
1136
|
+
"jsx-a11y/label-has-for": "Deprecated, replaced by `jsx-a11y/label-has-associated-control`.",
|
|
1137
|
+
"jsx-a11y/no-onchange": "Deprecated, based on behavior of very old browsers, and so no longer necessary.",
|
|
1138
|
+
"eslint/camelcase": "Superseded by `@typescript-eslint/naming-convention`, which accomplishes the same behavior with more flexibility.",
|
|
1139
|
+
"eslint/no-invalid-this": "Superseded by TypeScript's [`noImplicitThis`](https://www.typescriptlang.org/tsconfig/#noImplicitThis) compiler option (enabled by `strict` mode).",
|
|
1140
|
+
"react/jsx-uses-react": "It is unnecessary to import React for JSX/TSX files with React 17+ when using the new JSX transform. This rule is also not easy to implement in Oxlint as it modifies the behavior of another rule.",
|
|
1141
|
+
"import/no-internal-modules": "Not necessary to implement this rule as we already have `eslint/no-restricted-imports`, which is able to cover the same use-cases.",
|
|
1142
|
+
"n/prefer-node-protocol": "No need to implement, already implemented by `unicorn/prefer-node-protocol`.",
|
|
1143
|
+
"n/no-process-exit": "No need to implement, already implemented by `unicorn/no-process-exit`.",
|
|
1144
|
+
"n/file-extension-in-import": "No need to implement, already implemented by `import/extensions`.",
|
|
1145
|
+
"import/enforce-node-protocol-usage": "No need to implement, already implemented by `unicorn/prefer-node-protocol`.",
|
|
1146
|
+
"import/no-deprecated": "No need to implement, already implemented by `typescript/no-deprecated` via tsgolint.",
|
|
1147
|
+
"n/no-restricted-import": "No need to implement, already implemented by `no-restricted-imports` rule.",
|
|
1148
|
+
"n/no-restricted-require": "No need to implement, already implemented by `no-restricted-imports` rule.",
|
|
1149
|
+
"jsdoc/type-formatting": "Experimental rule in the original plugin, may reconsider once stable.",
|
|
1150
|
+
"jsdoc/convert-to-jsdoc-comments": "Experimental rule in the original plugin, may reconsider once stable.",
|
|
1151
|
+
"jsdoc/check-examples": "Deprecated.",
|
|
1152
|
+
"jest/no-unnecessary-assertion": "Requires type information. Not currently possible to implement in oxlint.",
|
|
1153
|
+
"jest/unbound-method": "Requires type information. Not currently possible to implement in oxlint.",
|
|
1154
|
+
"jest/no-error-equal": "Requires type information. Not currently possible to implement in oxlint.",
|
|
1155
|
+
"vitest/unbound-method": "Requires type information. Not currently possible to implement in oxlint.",
|
|
1156
|
+
"vitest/prefer-vi-mocked": "Requires type information. Not currently possible to implement in oxlint.",
|
|
1157
|
+
"eslint/no-process-env": "Deprecated, replaced by `node/no-process-env`, which we already support.",
|
|
1158
|
+
"eslint/no-new-require": "Deprecated, replaced by `node/no-new-require`, which we already support.",
|
|
1159
|
+
"eslint/no-buffer-constructor": "Replaced by `node/no-deprecated-api`.",
|
|
1160
|
+
"eslint/no-path-concat": "Deprecated, replaced by `node/no-path-concat`.",
|
|
1161
|
+
"eslint/no-sync": "Deprecated, replaced by `node/no-sync`.",
|
|
1162
|
+
"eslint/no-process-exit": "Deprecated, replaced by `node/no-process-exit`.",
|
|
1163
|
+
"eslint/no-restricted-modules": "Deprecated, replaced by `node/no-restricted-require`.",
|
|
1164
|
+
"eslint/no-mixed-requires": "Deprecated, replaced by `node/no-mixed-requires`.",
|
|
1165
|
+
"eslint/global-require": "Deprecated, replaced by `node/global-require`.",
|
|
1166
|
+
"eslint/handle-callback-err": "Deprecated, replaced by `node/handle-callback-err`.",
|
|
1167
|
+
"eslint/callback-return": "Deprecated, replaced by `node/callback-return`.",
|
|
1168
|
+
"react/jsx-equals-spacing": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1169
|
+
"react/jsx-curly-spacing": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1170
|
+
"react/jsx-indent": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1171
|
+
"react/jsx-indent-props": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1172
|
+
"react/jsx-newline": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1173
|
+
"react/jsx-wrap-multilines": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1174
|
+
"react/jsx-props-no-multi-spaces": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1175
|
+
"react/jsx-tag-spacing": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1176
|
+
"react/jsx-space-before-closing": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1177
|
+
"react/jsx-closing-tag-location": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1178
|
+
"react/jsx-closing-bracket-location": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1179
|
+
"react/jsx-first-prop-new-line": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1180
|
+
"react/jsx-max-props-per-line": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1181
|
+
"react/jsx-curly-newline": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1182
|
+
"react/jsx-child-element-spacing": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1183
|
+
"react/jsx-one-expression-per-line": "Stylistic rule from eslint-plugin-react. Should use Oxfmt for stylistic rules, or use JS Plugins to enable this rule.",
|
|
1184
|
+
"react/config": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1185
|
+
"react/error-boundaries": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1186
|
+
"react/component-hook-factories": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1187
|
+
"react/gating": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1188
|
+
"react/globals": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1189
|
+
"react/immutability": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1190
|
+
"react/preserve-manual-memoization": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1191
|
+
"react/purity": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1192
|
+
"react/refs": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1193
|
+
"react/set-state-in-effect": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1194
|
+
"react/set-state-in-render": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1195
|
+
"react/static-components": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1196
|
+
"react/unsupported-syntax": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1197
|
+
"react/use-memo": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1198
|
+
"react/incompatible-library": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1199
|
+
"react/automatic-effect-dependencies": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1200
|
+
"react/capitalized-calls": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1201
|
+
"react/fbt": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1202
|
+
"react/fire": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1203
|
+
"react/invariant": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1204
|
+
"react/hooks": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1205
|
+
"react/memoized-effect-dependencies": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1206
|
+
"react/no-deriving-state-in-effects": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1207
|
+
"react/rule-suppression": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1208
|
+
"react/syntax": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1209
|
+
"react/todo": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1210
|
+
"react/void-use-memo": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
|
|
1211
|
+
"react/default-props-match-prop-types": "This rule only applies to legacy class components, which are not widely used in modern React. Also stylistic.",
|
|
1212
|
+
"react/forbid-foreign-prop-types": "PropTypes are ignored in React 19, and this rule is only relevant for very specific use-cases involving it.",
|
|
1213
|
+
"react/forbid-prop-types": "PropTypes are ignored in React 19, and this rule is only relevant if you use the PropTypes package.",
|
|
1214
|
+
"react/no-access-state-in-setstate": "This rule only applies to legacy class components, which are not widely used in modern React.",
|
|
1215
|
+
"react/no-unused-class-component-methods": "This rule only applies to legacy class components, which are not widely used in modern React. It is also complex to implement.",
|
|
1216
|
+
"react/no-unused-state": "This rule only applies to legacy class components, which are not widely used in modern React. It is also complex to implement.",
|
|
1217
|
+
"react/no-unused-prop-types": "PropTypes are ignored in React 19, and TypeScript + the `no-unused-vars` rule already catches unused props in most cases.",
|
|
1218
|
+
"react/prefer-exact-props": "This rule is not relevant for TypeScript code, and PropTypes are ignored in React 19.",
|
|
1219
|
+
"react/sort-comp": "This rule only applies to legacy class components, which are not widely used in modern React. Also stylistic.",
|
|
1220
|
+
"react/sort-default-props": "`defaultProps` is removed entirely in React 19, this rule is no longer relevant. Also stylistic.",
|
|
1221
|
+
"react/sort-prop-types": "PropTypes are ignored in React 19, and this rule is only relevant if you use the PropTypes package. Also stylistic.",
|
|
1222
|
+
"react/static-property-placement": "This rule only applies to legacy class components, which are not widely used in modern React.",
|
|
1223
|
+
"typescript/sort-type-constituents": "Deprecated, replaced by `perfectionist/sort-intersection-types` and `perfectionist/sort-union-types` rules.",
|
|
1224
|
+
"typescript/no-type-alias": "Deprecated, replaced by `typescript-eslint/consistent-type-definitions` rule.",
|
|
1225
|
+
"typescript/typedef": "Deprecated.",
|
|
1226
|
+
"typescript/no-invalid-this": "This rule is checked by the TypeScript compiler when the `noImplicitThis` compiler option is enabled. In TypeScript versions prior to 6.0, this compiler option is not enabled by default, however it is a best practice to enable it.",
|
|
1227
|
+
"eslint/array-bracket-newline": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1228
|
+
"eslint/array-bracket-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1229
|
+
"eslint/array-element-newline": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1230
|
+
"eslint/arrow-parens": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1231
|
+
"eslint/arrow-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1232
|
+
"eslint/block-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1233
|
+
"eslint/brace-style": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1234
|
+
"eslint/comma-dangle": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1235
|
+
"eslint/comma-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1236
|
+
"eslint/comma-style": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1237
|
+
"eslint/computed-property-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1238
|
+
"eslint/dot-location": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1239
|
+
"eslint/eol-last": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1240
|
+
"eslint/func-call-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1241
|
+
"eslint/function-call-argument-newline": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1242
|
+
"eslint/function-paren-newline": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1243
|
+
"eslint/generator-star-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1244
|
+
"eslint/implicit-arrow-linebreak": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1245
|
+
"eslint/indent-legacy": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1246
|
+
"eslint/indent": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1247
|
+
"eslint/jsx-quotes": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1248
|
+
"eslint/key-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1249
|
+
"eslint/keyword-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1250
|
+
"eslint/line-comment-position": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1251
|
+
"eslint/linebreak-style": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1252
|
+
"eslint/lines-around-comment": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1253
|
+
"eslint/lines-around-directive": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1254
|
+
"eslint/lines-between-class-members": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1255
|
+
"eslint/max-len": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1256
|
+
"eslint/max-statements-per-line": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1257
|
+
"eslint/multiline-comment-style": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1258
|
+
"eslint/multiline-ternary": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1259
|
+
"eslint/new-parens": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1260
|
+
"eslint/newline-after-var": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1261
|
+
"eslint/newline-before-return": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1262
|
+
"eslint/newline-per-chained-call": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1263
|
+
"eslint/no-confusing-arrow": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1264
|
+
"eslint/no-extra-parens": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1265
|
+
"eslint/no-extra-semi": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1266
|
+
"eslint/no-floating-decimal": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1267
|
+
"eslint/no-mixed-operators": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1268
|
+
"eslint/no-mixed-spaces-and-tabs": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1269
|
+
"eslint/no-multi-spaces": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1270
|
+
"eslint/no-multiple-empty-lines": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1271
|
+
"eslint/no-spaced-func": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1272
|
+
"eslint/no-tabs": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1273
|
+
"eslint/no-trailing-spaces": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1274
|
+
"eslint/no-whitespace-before-property": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1275
|
+
"eslint/nonblock-statement-body-position": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1276
|
+
"eslint/object-curly-newline": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1277
|
+
"eslint/object-curly-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1278
|
+
"eslint/object-property-newline": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1279
|
+
"eslint/one-var-declaration-per-line": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1280
|
+
"eslint/operator-linebreak": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1281
|
+
"eslint/padded-blocks": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1282
|
+
"eslint/padding-line-between-statements": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1283
|
+
"eslint/quote-props": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1284
|
+
"eslint/quotes": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1285
|
+
"eslint/rest-spread-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1286
|
+
"eslint/semi-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1287
|
+
"eslint/semi-style": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1288
|
+
"eslint/semi": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1289
|
+
"eslint/space-before-blocks": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1290
|
+
"eslint/space-before-function-paren": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1291
|
+
"eslint/space-in-parens": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1292
|
+
"eslint/space-infix-ops": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1293
|
+
"eslint/space-unary-ops": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1294
|
+
"eslint/spaced-comment": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1295
|
+
"eslint/switch-colon-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1296
|
+
"eslint/template-curly-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1297
|
+
"eslint/template-tag-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1298
|
+
"eslint/wrap-iife": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1299
|
+
"eslint/wrap-regex": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1300
|
+
"eslint/yield-star-spacing": "Deprecated stylistic rule, can be used via the stylistic eslint plugin as a JS Plugin if necessary.",
|
|
1301
|
+
"react/jsx-uses-vars": "Handled by `eslint/no-unused-vars`, which already evaluates whether vars are used in JSX.",
|
|
1302
|
+
"unicorn/no-named-default": "Implemented via `import/no-named-default`.",
|
|
1303
|
+
"vue/no-lone-template": "Not currently possible, as it requires Vue template parsing.",
|
|
1304
|
+
"vue/no-v-html": "Not currently possible, as it requires Vue template parsing.",
|
|
1305
|
+
"vue/this-in-template": "Not currently possible, as it requires Vue template parsing.",
|
|
1306
|
+
"vue/array-bracket-newline": "Stylistic rule.",
|
|
1307
|
+
"vue/array-bracket-spacing": "Stylistic rule.",
|
|
1308
|
+
"vue/array-element-newline": "Stylistic rule.",
|
|
1309
|
+
"vue/arrow-spacing": "Stylistic rule.",
|
|
1310
|
+
"vue/attribute-hyphenation": "Not currently possible, as it requires Vue template parsing.",
|
|
1311
|
+
"vue/attributes-order": "Not currently possible, as it requires Vue template parsing.",
|
|
1312
|
+
"vue/block-lang": "Not currently possible, as it requires Vue template parsing.",
|
|
1313
|
+
"vue/block-order": "Not currently possible, as it requires Vue template parsing.",
|
|
1314
|
+
"vue/block-spacing": "Stylistic rule.",
|
|
1315
|
+
"vue/block-tag-newline": "Stylistic rule.",
|
|
1316
|
+
"vue/brace-style": "Stylistic rule.",
|
|
1317
|
+
"vue/camelcase": "Not currently possible, as it requires Vue template parsing.",
|
|
1318
|
+
"vue/comma-dangle": "Stylistic rule.",
|
|
1319
|
+
"vue/comma-spacing": "Stylistic rule.",
|
|
1320
|
+
"vue/comma-style": "Stylistic rule.",
|
|
1321
|
+
"vue/comment-directive": "Not currently possible, as it requires Vue template parsing. Also possibly unnecessary as its own rule, as oxlint directives should be implemented at the same time as Vue template parsing.",
|
|
1322
|
+
"vue/component-name-in-template-casing": "Not currently possible, as it requires Vue template parsing.",
|
|
1323
|
+
"vue/custom-event-name-casing": "Not currently possible, as it requires Vue template parsing.",
|
|
1324
|
+
"vue/define-macros-order": "Stylistic rule.",
|
|
1325
|
+
"vue/dot-location": "Not currently possible, as it requires Vue template parsing.",
|
|
1326
|
+
"vue/dot-notation": "Not currently possible, as it requires Vue template parsing.",
|
|
1327
|
+
"vue/enforce-style-attribute": "Not currently possible, as it requires Vue template parsing.",
|
|
1328
|
+
"vue/eqeqeq": "Not currently possible, as it requires Vue template parsing.",
|
|
1329
|
+
"vue/first-attribute-linebreak": "Stylistic rule.",
|
|
1330
|
+
"vue/func-call-spacing": "Stylistic rule.",
|
|
1331
|
+
"vue/html-button-has-type": "Not currently possible, as it requires Vue template parsing.",
|
|
1332
|
+
"vue/html-closing-bracket-newline": "Stylistic rule.",
|
|
1333
|
+
"vue/html-closing-bracket-spacing": "Stylistic rule.",
|
|
1334
|
+
"vue/html-comment-content-newline": "Stylistic rule.",
|
|
1335
|
+
"vue/html-comment-content-spacing": "Stylistic rule.",
|
|
1336
|
+
"vue/html-comment-indent": "Stylistic rule.",
|
|
1337
|
+
"vue/html-end-tags": "Not currently possible, as it requires Vue template parsing.",
|
|
1338
|
+
"vue/html-indent": "Stylistic rule.",
|
|
1339
|
+
"vue/html-quotes": "Stylistic rule.",
|
|
1340
|
+
"vue/html-self-closing": "Not currently possible, as it requires Vue template parsing.",
|
|
1341
|
+
"vue/key-spacing": "Stylistic rule.",
|
|
1342
|
+
"vue/keyword-spacing": "Stylistic rule.",
|
|
1343
|
+
"vue/max-attributes-per-line": "Stylistic rule.",
|
|
1344
|
+
"vue/max-len": "Not currently possible, as it requires Vue template parsing.",
|
|
1345
|
+
"vue/max-lines-per-block": "Not currently possible, as it requires Vue template parsing.",
|
|
1346
|
+
"vue/max-template-depth": "Not currently possible, as it requires Vue template parsing.",
|
|
1347
|
+
"vue/multiline-html-element-content-newline": "Not currently possible, as it requires Vue template parsing.",
|
|
1348
|
+
"vue/multiline-ternary": "Stylistic rule. Also not currently possible, as it requires Vue template parsing.",
|
|
1349
|
+
"vue/mustache-interpolation-spacing": "Stylistic rule.",
|
|
1350
|
+
"vue/new-line-between-multi-line-property": "Stylistic rule.",
|
|
1351
|
+
"vue/no-bare-strings-in-template": "Not currently possible, as it requires Vue template parsing.",
|
|
1352
|
+
"vue/no-child-content": "Not currently possible, as it requires Vue template parsing.",
|
|
1353
|
+
"vue/no-console": "Not currently possible, as it requires Vue template parsing.",
|
|
1354
|
+
"vue/no-constant-condition": "Not currently possible, as it requires Vue template parsing.",
|
|
1355
|
+
"vue/no-custom-modifiers-on-v-model": "Not currently possible, as it requires Vue template parsing.",
|
|
1356
|
+
"vue/no-deprecated-filter": "Not currently possible, as it requires Vue template parsing.",
|
|
1357
|
+
"vue/no-deprecated-functional-template": "Not currently possible, as it requires Vue template parsing.",
|
|
1358
|
+
"vue/no-deprecated-html-element-is": "Not currently possible, as it requires Vue template parsing.",
|
|
1359
|
+
"vue/no-deprecated-inline-template": "Not currently possible, as it requires Vue template parsing.",
|
|
1360
|
+
"vue/no-deprecated-router-link-tag-prop": "Not currently possible, as it requires Vue template parsing.",
|
|
1361
|
+
"vue/no-deprecated-scope-attribute": "Not currently possible, as it requires Vue template parsing.",
|
|
1362
|
+
"vue/no-deprecated-slot-attribute": "Not currently possible, as it requires Vue template parsing.",
|
|
1363
|
+
"vue/no-deprecated-slot-scope-attribute": "Not currently possible, as it requires Vue template parsing.",
|
|
1364
|
+
"vue/no-deprecated-v-bind-sync": "Not currently possible, as it requires Vue template parsing.",
|
|
1365
|
+
"vue/no-deprecated-v-is": "Not currently possible, as it requires Vue template parsing.",
|
|
1366
|
+
"vue/no-deprecated-v-on-native-modifier": "Not currently possible, as it requires Vue template parsing.",
|
|
1367
|
+
"vue/no-deprecated-v-on-number-modifiers": "Not currently possible, as it requires Vue template parsing.",
|
|
1368
|
+
"vue/no-dupe-v-else-if": "Not currently possible, as it requires Vue template parsing.",
|
|
1369
|
+
"vue/no-duplicate-attr-inheritance": "Not currently possible, as it requires Vue template parsing.",
|
|
1370
|
+
"vue/no-duplicate-attributes": "Not currently possible, as it requires Vue template parsing.",
|
|
1371
|
+
"vue/no-duplicate-class-names": "Not currently possible, as it requires Vue template parsing.",
|
|
1372
|
+
"vue/no-empty-component-block": "Not currently possible, as it requires Vue template and style parsing.",
|
|
1373
|
+
"vue/no-empty-pattern": "Not currently possible, as it requires Vue template parsing.",
|
|
1374
|
+
"vue/no-extra-parens": "Stylistic rule, and requires template parsing.",
|
|
1375
|
+
"vue/no-implicit-coercion": "Not currently possible, as it requires Vue template parsing.",
|
|
1376
|
+
"vue/no-literals-in-template": "Not currently possible, as it requires Vue template parsing.",
|
|
1377
|
+
"vue/no-loss-of-precision": "Not currently possible, as it requires Vue template parsing.",
|
|
1378
|
+
"vue/no-multi-spaces": "Stylistic rule.",
|
|
1379
|
+
"vue/no-multiple-objects-in-class": "Not currently possible, as it requires Vue template parsing.",
|
|
1380
|
+
"vue/no-multiple-template-root": "Not currently possible, as it requires Vue template parsing.",
|
|
1381
|
+
"vue/no-negated-condition": "Not currently possible, as it requires Vue template parsing.",
|
|
1382
|
+
"vue/no-negated-v-if-condition": "Not currently possible, as it requires Vue template parsing.",
|
|
1383
|
+
"vue/no-parsing-error": "Not currently possible, as it requires Vue template parsing.",
|
|
1384
|
+
"vue/no-restricted-block": "Not currently possible, as it requires Vue template parsing.",
|
|
1385
|
+
"vue/no-restricted-class": "Not currently possible, as it requires Vue template parsing.",
|
|
1386
|
+
"vue/no-restricted-html-elements": "Not currently possible, as it requires Vue template parsing.",
|
|
1387
|
+
"vue/no-restricted-static-attribute": "Not currently possible, as it requires Vue template parsing.",
|
|
1388
|
+
"vue/no-restricted-syntax": "Not currently possible, as it requires Vue template parsing.",
|
|
1389
|
+
"vue/no-restricted-v-bind": "Not currently possible, as it requires Vue template parsing.",
|
|
1390
|
+
"vue/no-restricted-v-on": "Not currently possible, as it requires Vue template parsing.",
|
|
1391
|
+
"vue/no-root-v-if": "Not currently possible, as it requires Vue template parsing.",
|
|
1392
|
+
"vue/no-spaces-around-equal-signs-in-attribute": "Stylistic rule.",
|
|
1393
|
+
"vue/no-sparse-arrays": "Not currently possible, as it requires Vue template parsing.",
|
|
1394
|
+
"vue/no-static-inline-styles": "Not currently possible, as it requires Vue template parsing.",
|
|
1395
|
+
"vue/no-template-key": "Not currently possible, as it requires Vue template parsing.",
|
|
1396
|
+
"vue/no-template-shadow": "Not currently possible, as it requires Vue template parsing.",
|
|
1397
|
+
"vue/no-template-target-blank": "Not currently possible, as it requires Vue template parsing.",
|
|
1398
|
+
"vue/no-textarea-mustache": "Not currently possible, as it requires Vue template parsing.",
|
|
1399
|
+
"vue/no-undef-components": "Not currently possible, as it requires Vue template parsing.",
|
|
1400
|
+
"vue/no-undef-directives": "Not currently possible, as it requires Vue template parsing.",
|
|
1401
|
+
"vue/no-undef-properties": "Not currently possible, as it requires Vue template parsing.",
|
|
1402
|
+
"vue/no-unsupported-features": "Cannot be kept up-to-date with Vue versions + requires template parsing.",
|
|
1403
|
+
"vue/no-unused-components": "Not currently possible, as it requires Vue template parsing.",
|
|
1404
|
+
"vue/no-unused-properties": "Not currently possible, as it requires Vue template parsing.",
|
|
1405
|
+
"vue/no-unused-refs": "Not currently possible, as it requires Vue template parsing.",
|
|
1406
|
+
"vue/no-unused-vars": "Not currently possible, as it requires Vue template parsing. May also prefer to cover this via the core no-unused-vars rule.",
|
|
1407
|
+
"vue/no-use-v-else-with-v-for": "Not currently possible, as it requires Vue template parsing.",
|
|
1408
|
+
"vue/no-use-v-if-with-v-for": "Not currently possible, as it requires Vue template parsing.",
|
|
1409
|
+
"vue/no-useless-concat": "Not currently possible, as it requires Vue template parsing.",
|
|
1410
|
+
"vue/no-useless-mustaches": "Not currently possible, as it requires Vue template parsing.",
|
|
1411
|
+
"vue/no-useless-template-attributes": "Not currently possible, as it requires Vue template parsing.",
|
|
1412
|
+
"vue/no-useless-v-bind": "Not currently possible, as it requires Vue template parsing.",
|
|
1413
|
+
"vue/no-v-text-v-html-on-component": "Not currently possible, as it requires Vue template parsing.",
|
|
1414
|
+
"vue/no-v-text": "Not currently possible, as it requires Vue template parsing.",
|
|
1415
|
+
"vue/no-v-for-template-key": "Not currently possible, as it requires Vue template parsing.",
|
|
1416
|
+
"vue/object-curly-newline": "Stylistic rule.",
|
|
1417
|
+
"vue/object-curly-spacing": "Stylistic rule.",
|
|
1418
|
+
"vue/object-property-newline": "Stylistic rule.",
|
|
1419
|
+
"vue/object-shorthand": "Not currently possible, as it requires Vue template parsing.",
|
|
1420
|
+
"vue/operator-linebreak": "Stylistic rule.",
|
|
1421
|
+
"vue/padding-line-between-blocks": "Stylistic rule.",
|
|
1422
|
+
"vue/padding-line-between-tags": "Stylistic rule.",
|
|
1423
|
+
"vue/padding-lines-in-component-definition": "Stylistic rule.",
|
|
1424
|
+
"vue/prefer-separate-static-class": "Not currently possible, as it requires Vue template parsing.",
|
|
1425
|
+
"vue/prefer-template": "Not currently possible, as it requires Vue template parsing.",
|
|
1426
|
+
"vue/prefer-true-attribute-shorthand": "Not currently possible, as it requires Vue template parsing.",
|
|
1427
|
+
"vue/quote-props": "Stylistic rule.",
|
|
1428
|
+
"vue/require-component-is": "Not currently possible, as it requires Vue template parsing.",
|
|
1429
|
+
"vue/require-explicit-emits": "Not currently possible, as it requires Vue template parsing.",
|
|
1430
|
+
"vue/require-explicit-slots": "Not currently possible, as it requires Vue template parsing.",
|
|
1431
|
+
"vue/require-toggle-inside-transition": "Not currently possible, as it requires Vue template parsing.",
|
|
1432
|
+
"vue/require-v-for-key": "Not currently possible, as it requires Vue template parsing.",
|
|
1433
|
+
"vue/restricted-component-names": "Not currently possible, as it requires Vue template parsing.",
|
|
1434
|
+
"vue/singleline-html-element-content-newline": "Not currently possible, as it requires Vue template parsing.",
|
|
1435
|
+
"vue/slot-name-casing": "Not currently possible, as it requires Vue template parsing.",
|
|
1436
|
+
"vue/space-in-parens": "Stylistic rule.",
|
|
1437
|
+
"vue/space-infix-ops": "Stylistic rule.",
|
|
1438
|
+
"vue/space-unary-ops": "Stylistic rule.",
|
|
1439
|
+
"vue/static-class-names-order": "Not currently possible, as it requires Vue template parsing.",
|
|
1440
|
+
"vue/template-curly-spacing": "Stylistic rule.",
|
|
1441
|
+
"vue/use-v-on-exact": "Not currently possible, as it requires Vue template parsing.",
|
|
1442
|
+
"vue/v-bind-style": "Not currently possible, as it requires Vue template parsing.",
|
|
1443
|
+
"vue/v-for-delimiter-style": "Not currently possible, as it requires Vue template parsing.",
|
|
1444
|
+
"vue/v-if-else-key": "Not currently possible, as it requires Vue template parsing.",
|
|
1445
|
+
"vue/v-on-event-hyphenation": "Not currently possible, as it requires Vue template parsing.",
|
|
1446
|
+
"vue/v-on-handler-style": "Not currently possible, as it requires Vue template parsing.",
|
|
1447
|
+
"vue/v-on-style": "Not currently possible, as it requires Vue template parsing.",
|
|
1448
|
+
"vue/v-slot-style": "Not currently possible, as it requires Vue template parsing.",
|
|
1449
|
+
"vue/valid-attribute-name": "Not currently possible, as it requires Vue template parsing.",
|
|
1450
|
+
"vue/valid-template-root": "Not currently possible, as it requires Vue template parsing.",
|
|
1451
|
+
"vue/valid-v-bind": "Not currently possible, as it requires Vue template parsing.",
|
|
1452
|
+
"vue/valid-v-cloak": "Not currently possible, as it requires Vue template parsing.",
|
|
1453
|
+
"vue/valid-v-else-if": "Not currently possible, as it requires Vue template parsing.",
|
|
1454
|
+
"vue/valid-v-else": "Not currently possible, as it requires Vue template parsing.",
|
|
1455
|
+
"vue/valid-v-for": "Not currently possible, as it requires Vue template parsing.",
|
|
1456
|
+
"vue/valid-v-html": "Not currently possible, as it requires Vue template parsing.",
|
|
1457
|
+
"vue/valid-v-if": "Not currently possible, as it requires Vue template parsing.",
|
|
1458
|
+
"vue/valid-v-is": "Not currently possible, as it requires Vue template parsing.",
|
|
1459
|
+
"vue/valid-v-memo": "Not currently possible, as it requires Vue template parsing.",
|
|
1460
|
+
"vue/valid-v-model": "Not currently possible, as it requires Vue template parsing.",
|
|
1461
|
+
"vue/valid-v-on": "Not currently possible, as it requires Vue template parsing.",
|
|
1462
|
+
"vue/valid-v-once": "Not currently possible, as it requires Vue template parsing.",
|
|
1463
|
+
"vue/valid-v-pre": "Not currently possible, as it requires Vue template parsing.",
|
|
1464
|
+
"vue/valid-v-show": "Not currently possible, as it requires Vue template parsing.",
|
|
1465
|
+
"vue/valid-v-slot": "Not currently possible, as it requires Vue template parsing.",
|
|
1466
|
+
"vue/valid-v-text": "Not currently possible, as it requires Vue template parsing.",
|
|
1467
|
+
"vue/no-v-for-template-key-on-child": "Deprecated.",
|
|
1468
|
+
"vue/no-v-model-argument": "Deprecated.",
|
|
1469
|
+
"vue/valid-v-bind-sync": "Deprecated.",
|
|
1470
|
+
"vue/valid-model-definition": "Deprecated."
|
|
1471
|
+
};
|
|
1472
|
+
|
|
1473
|
+
//#endregion
|
|
1474
|
+
//#region src/utilities.ts
|
|
1475
|
+
const isEqualDeep = (a, b) => {
|
|
1476
|
+
if (a === b) return true;
|
|
1477
|
+
const bothAreObjects = a && b && typeof a === "object" && typeof b === "object";
|
|
1478
|
+
return Boolean(bothAreObjects && Object.keys(a).length === Object.keys(b).length && Object.entries(a).every(([k, v]) => isEqualDeep(v, b[k])));
|
|
1479
|
+
};
|
|
1480
|
+
/**
|
|
1481
|
+
* Builds a lookup map of unsupported rule explanations.
|
|
1482
|
+
* Converts oxc-style rule keys (e.g. "eslint/no-dupe-args", "react/immutability")
|
|
1483
|
+
* to all matching ESLint-style keys, using rulesPrefixesForPlugins for aliases
|
|
1484
|
+
* (e.g. react → react-hooks/react-refresh, import → import-x, node → n).
|
|
1485
|
+
*/
|
|
1486
|
+
function buildUnsupportedRuleExplanations() {
|
|
1487
|
+
const explanations = {};
|
|
1488
|
+
for (const [key, value] of Object.entries(unsupportedRules)) {
|
|
1489
|
+
const slashIdx = key.indexOf("/");
|
|
1490
|
+
const oxlintPlugin = key.slice(0, slashIdx);
|
|
1491
|
+
const ruleName = key.slice(slashIdx + 1);
|
|
1492
|
+
if (oxlintPlugin === "eslint") {
|
|
1493
|
+
explanations[ruleName] = value;
|
|
1494
|
+
continue;
|
|
1495
|
+
}
|
|
1496
|
+
for (const [eslintPrefix, plugin] of Object.entries(rulesPrefixesForPlugins)) if (plugin === oxlintPlugin) explanations[`${eslintPrefix}/${ruleName}`] = value;
|
|
1497
|
+
}
|
|
1498
|
+
return explanations;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1075
1501
|
//#endregion
|
|
1076
1502
|
//#region src/plugins_rules.ts
|
|
1077
1503
|
const allRules = Object.values(rules_exports).flat();
|
|
1504
|
+
const unsupportedRuleExplanations = buildUnsupportedRuleExplanations();
|
|
1078
1505
|
/**
|
|
1079
1506
|
* checks if value is validSet, or if validSet is an array, check if value is first value of it
|
|
1080
1507
|
*/
|
|
@@ -1172,23 +1599,31 @@ const transformRuleEntry = (eslintConfig, targetConfig, baseConfig, options, ove
|
|
|
1172
1599
|
else if (!isIgnoredPluginRule(rule)) targetConfig.rules[rule] = normalizedConfig;
|
|
1173
1600
|
if (eslintConfig.files === void 0) {
|
|
1174
1601
|
options?.reporter?.removeSkipped(rule, "js-plugins");
|
|
1602
|
+
options?.reporter?.removeSkipped(rule, "not-implemented");
|
|
1175
1603
|
options?.reporter?.removeSkipped(rule, "unsupported");
|
|
1176
1604
|
}
|
|
1177
1605
|
continue;
|
|
1178
1606
|
}
|
|
1179
|
-
if (!enableJsPluginRule(targetConfig, rule, normalizedConfig))
|
|
1607
|
+
if (!enableJsPluginRule(targetConfig, rule, normalizedConfig)) {
|
|
1608
|
+
const category = unsupportedRuleExplanations[rule] ? "unsupported" : "not-implemented";
|
|
1609
|
+
options?.reporter?.markSkipped(rule, category);
|
|
1610
|
+
}
|
|
1180
1611
|
continue;
|
|
1181
1612
|
}
|
|
1182
1613
|
if (!isActiveValue(normalizedConfig)) {
|
|
1183
1614
|
if (isOffValue(normalizedConfig)) delete targetConfig.rules[rule];
|
|
1184
|
-
if (eslintConfig.files === void 0)
|
|
1615
|
+
if (eslintConfig.files === void 0) {
|
|
1616
|
+
options?.reporter?.removeSkipped(rule, "not-implemented");
|
|
1617
|
+
options?.reporter?.removeSkipped(rule, "unsupported");
|
|
1618
|
+
}
|
|
1185
1619
|
continue;
|
|
1186
1620
|
}
|
|
1187
1621
|
if (!options?.jsPlugins && !isIgnoredPluginRule(rule)) {
|
|
1188
1622
|
options?.reporter?.markSkipped(rule, "js-plugins");
|
|
1189
1623
|
continue;
|
|
1190
1624
|
}
|
|
1191
|
-
|
|
1625
|
+
const category = unsupportedRuleExplanations[rule] ? "unsupported" : "not-implemented";
|
|
1626
|
+
options?.reporter?.markSkipped(rule, category);
|
|
1192
1627
|
}
|
|
1193
1628
|
}
|
|
1194
1629
|
};
|
|
@@ -1210,31 +1645,54 @@ const cleanUpUselessOverridesPlugins = (config) => {
|
|
|
1210
1645
|
}
|
|
1211
1646
|
};
|
|
1212
1647
|
const cleanUpUselessOverridesRules = (config) => {
|
|
1213
|
-
if (config.
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
if (
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
};
|
|
1225
|
-
filesPatternMap.set(filesKey, entry);
|
|
1226
|
-
} else entry.indicesToRemove.push(i);
|
|
1227
|
-
if (override.rules) Object.assign(entry.finalRules, override.rules);
|
|
1228
|
-
}
|
|
1229
|
-
for (const entry of filesPatternMap.values()) {
|
|
1230
|
-
const firstOverride = config.overrides[entry.firstIndex];
|
|
1231
|
-
firstOverride.rules = entry.finalRules;
|
|
1232
|
-
if (firstOverride.rules) {
|
|
1233
|
-
for (const [rule, settings] of Object.entries(firstOverride.rules)) if (config.rules[rule] === settings) delete firstOverride.rules[rule];
|
|
1234
|
-
if (Object.keys(firstOverride.rules).length === 0) delete firstOverride.rules;
|
|
1648
|
+
if (config.overrides === void 0) return;
|
|
1649
|
+
for (let i = 0; i < config.overrides.length; i++) {
|
|
1650
|
+
const current = config.overrides[i];
|
|
1651
|
+
if (i > 0) {
|
|
1652
|
+
const previous = config.overrides[i - 1];
|
|
1653
|
+
if (isEqualDeep(previous.files, current.files)) {
|
|
1654
|
+
mergeOverrideProperties(previous, current);
|
|
1655
|
+
config.overrides.splice(i, 1);
|
|
1656
|
+
i -= 2;
|
|
1657
|
+
continue;
|
|
1658
|
+
}
|
|
1235
1659
|
}
|
|
1236
|
-
|
|
1660
|
+
removeRootMatchingRules(config, i);
|
|
1661
|
+
}
|
|
1662
|
+
};
|
|
1663
|
+
/** Merge all properties from `source` into `target` (same-files overrides). */
|
|
1664
|
+
const mergeOverrideProperties = (target, source) => {
|
|
1665
|
+
if (source.rules) target.rules = {
|
|
1666
|
+
...target.rules,
|
|
1667
|
+
...source.rules
|
|
1668
|
+
};
|
|
1669
|
+
if (source.plugins) target.plugins = [...new Set([...target.plugins ?? [], ...source.plugins])];
|
|
1670
|
+
if (source.jsPlugins) target.jsPlugins = [...new Set([...target.jsPlugins ?? [], ...source.jsPlugins])];
|
|
1671
|
+
if (source.env) target.env = {
|
|
1672
|
+
...target.env,
|
|
1673
|
+
...source.env
|
|
1674
|
+
};
|
|
1675
|
+
if (source.globals) target.globals = {
|
|
1676
|
+
...target.globals,
|
|
1677
|
+
...source.globals
|
|
1678
|
+
};
|
|
1679
|
+
if (source.categories) target.categories = {
|
|
1680
|
+
...target.categories,
|
|
1681
|
+
...source.categories
|
|
1682
|
+
};
|
|
1683
|
+
};
|
|
1684
|
+
/**
|
|
1685
|
+
* Remove rules from `config.overrides[overrideIndex]` that match root config,
|
|
1686
|
+
* unless a previous override also has the rule (meaning it overrides root with
|
|
1687
|
+
* a different value — same-as-root rules are removed earlier in the loop).
|
|
1688
|
+
*/
|
|
1689
|
+
const removeRootMatchingRules = (config, overrideIndex) => {
|
|
1690
|
+
const override = config.overrides[overrideIndex];
|
|
1691
|
+
if (!override.rules || !config.rules) return;
|
|
1692
|
+
for (const [rule, settings] of Object.entries(override.rules)) if (config.rules[rule] === settings) {
|
|
1693
|
+
if (!config.overrides.slice(0, overrideIndex).some((prev) => prev.rules?.[rule] !== void 0)) delete override.rules[rule];
|
|
1237
1694
|
}
|
|
1695
|
+
if (Object.keys(override.rules).length === 0) delete override.rules;
|
|
1238
1696
|
};
|
|
1239
1697
|
const cleanUpRulesWhichAreCoveredByCategory = (config) => {
|
|
1240
1698
|
if (config.rules === void 0 || config.categories === void 0) return;
|
|
@@ -1295,14 +1753,6 @@ const replaceReactRefreshPluginName = (config) => {
|
|
|
1295
1753
|
}
|
|
1296
1754
|
};
|
|
1297
1755
|
|
|
1298
|
-
//#endregion
|
|
1299
|
-
//#region src/utilities.ts
|
|
1300
|
-
const isEqualDeep = (a, b) => {
|
|
1301
|
-
if (a === b) return true;
|
|
1302
|
-
const bothAreObjects = a && b && typeof a === "object" && typeof b === "object";
|
|
1303
|
-
return Boolean(bothAreObjects && Object.keys(a).length === Object.keys(b).length && Object.entries(a).every(([k, v]) => isEqualDeep(v, b[k])));
|
|
1304
|
-
};
|
|
1305
|
-
|
|
1306
1756
|
//#endregion
|
|
1307
1757
|
//#region src/cleanup.ts
|
|
1308
1758
|
const TS_ESLINT_DEFAULT_OVERRIDE = {
|
|
@@ -1345,7 +1795,6 @@ const cleanUpUselessOverridesEntries = (config) => {
|
|
|
1345
1795
|
if (config.overrides === void 0) return;
|
|
1346
1796
|
for (const [overrideIndex, override] of config.overrides.entries()) if (Object.keys(override).length === 1) delete config.overrides[overrideIndex];
|
|
1347
1797
|
config.overrides = config.overrides.filter((overrides) => Object.keys(overrides).length > 0);
|
|
1348
|
-
mergeConsecutiveIdenticalOverrides(config);
|
|
1349
1798
|
mergeConsecutiveOverridesWithDifferingFiles(config);
|
|
1350
1799
|
if (config.overrides.length === 0) delete config.overrides;
|
|
1351
1800
|
};
|
|
@@ -1371,51 +1820,6 @@ const cleanUpOxlintConfig = (config) => {
|
|
|
1371
1820
|
}
|
|
1372
1821
|
};
|
|
1373
1822
|
/**
|
|
1374
|
-
* Merges consecutive identical overrides in the config's overrides array
|
|
1375
|
-
* Merges only if the overrides are directly next to each other
|
|
1376
|
-
* (otherwise they could be overriden in between one another).
|
|
1377
|
-
*
|
|
1378
|
-
* Example:
|
|
1379
|
-
*
|
|
1380
|
-
* ```json
|
|
1381
|
-
* overrides: [
|
|
1382
|
-
* {
|
|
1383
|
-
* "files": [
|
|
1384
|
-
* "*.ts",
|
|
1385
|
-
* "*.tsx",
|
|
1386
|
-
* ],
|
|
1387
|
-
* "plugins": [
|
|
1388
|
-
* "typescript",
|
|
1389
|
-
* ],
|
|
1390
|
-
* },
|
|
1391
|
-
* {
|
|
1392
|
-
* "files": [
|
|
1393
|
-
* "*.ts",
|
|
1394
|
-
* "*.tsx",
|
|
1395
|
-
* ],
|
|
1396
|
-
* "plugins": [
|
|
1397
|
-
* "typescript",
|
|
1398
|
-
* ],
|
|
1399
|
-
* },
|
|
1400
|
-
* ]
|
|
1401
|
-
* ```
|
|
1402
|
-
*/
|
|
1403
|
-
function mergeConsecutiveIdenticalOverrides(config) {
|
|
1404
|
-
if (config.overrides === void 0) return;
|
|
1405
|
-
if (config.overrides.length <= 1) return;
|
|
1406
|
-
const mergedOverrides = [];
|
|
1407
|
-
let i = 0;
|
|
1408
|
-
while (i < config.overrides.length) {
|
|
1409
|
-
const current = config.overrides[i];
|
|
1410
|
-
if (i + 1 < config.overrides.length && isEqualDeep(current, config.overrides[i + 1])) {
|
|
1411
|
-
mergedOverrides.push(current);
|
|
1412
|
-
while (i + 1 < config.overrides.length && isEqualDeep(current, config.overrides[i + 1])) i++;
|
|
1413
|
-
} else mergedOverrides.push(current);
|
|
1414
|
-
i++;
|
|
1415
|
-
}
|
|
1416
|
-
config.overrides = mergedOverrides;
|
|
1417
|
-
}
|
|
1418
|
-
/**
|
|
1419
1823
|
* Merge consecutive overrides that have differing files but everything else is identical.
|
|
1420
1824
|
*
|
|
1421
1825
|
* ```json
|
|
@@ -1547,8 +1951,15 @@ const preFixForJsPlugins = () => {
|
|
|
1547
1951
|
function processConfigFiles(files, reporter) {
|
|
1548
1952
|
const filesArray = Array.isArray(files) ? files : [files];
|
|
1549
1953
|
const simpleFiles = [];
|
|
1550
|
-
for (const file of filesArray) if (Array.isArray(file))
|
|
1551
|
-
|
|
1954
|
+
for (const file of filesArray) if (Array.isArray(file)) {
|
|
1955
|
+
const filesSet = new Set(file);
|
|
1956
|
+
if (filesSet.size === 0) continue;
|
|
1957
|
+
if (filesSet.size > 1) {
|
|
1958
|
+
reporter?.addWarning(`ESLint AND glob patterns (nested arrays in files) are not supported in oxlint: ${JSON.stringify(file)}`);
|
|
1959
|
+
continue;
|
|
1960
|
+
}
|
|
1961
|
+
simpleFiles.push(file[0]);
|
|
1962
|
+
} else simpleFiles.push(file);
|
|
1552
1963
|
return simpleFiles;
|
|
1553
1964
|
}
|
|
1554
1965
|
|
|
@@ -1654,4 +2065,4 @@ const warnSettingsInOverride = (eslintConfig, options) => {
|
|
|
1654
2065
|
};
|
|
1655
2066
|
|
|
1656
2067
|
//#endregion
|
|
1657
|
-
export { preFixForJsPlugins as a, cleanUpOxlintConfig as c, transformRuleEntry as d,
|
|
2068
|
+
export { preFixForJsPlugins as a, cleanUpOxlintConfig as c, transformRuleEntry as d, buildUnsupportedRuleExplanations as f, transformEnvAndGlobals as g, detectEnvironmentByGlobals as h, fixForJsPlugins as i, detectNeededRulesPlugins as l, rules_exports as m, warnSettingsInOverride as n, detectSameOverride as o, nurseryRules as p, processConfigFiles as r, transformIgnorePatterns as s, transformSettings as t, isOffValue as u };
|
package/dist/src/index.d.mts
CHANGED
|
@@ -2694,7 +2694,7 @@ type OxlintConfig = {
|
|
|
2694
2694
|
ignorePatterns?: OxlintConfigIgnorePatterns;
|
|
2695
2695
|
settings?: OxlintSettings;
|
|
2696
2696
|
};
|
|
2697
|
-
type RuleSkippedCategory = 'nursery' | 'type-aware' | 'unsupported' | 'js-plugins';
|
|
2697
|
+
type RuleSkippedCategory = 'nursery' | 'type-aware' | 'not-implemented' | 'unsupported' | 'js-plugins';
|
|
2698
2698
|
type SkippedCategoryGroup = Record<RuleSkippedCategory, string[]>;
|
|
2699
2699
|
type Reporter = {
|
|
2700
2700
|
addWarning(message: string): void;
|
package/dist/src/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as cleanUpOxlintConfig, d as transformRuleEntry,
|
|
1
|
+
import { c as cleanUpOxlintConfig, d as transformRuleEntry, g as transformEnvAndGlobals, h as detectEnvironmentByGlobals, i as fixForJsPlugins, l as detectNeededRulesPlugins, n as warnSettingsInOverride, o as detectSameOverride, r as processConfigFiles, s as transformIgnorePatterns, t as transformSettings } from "../settings-D8R7axmT.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/index.ts
|
|
4
4
|
const buildConfig = (configs, oxlintConfig, options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxlint/migrate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.50.0",
|
|
4
4
|
"description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -28,7 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"prepare": "husky",
|
|
31
|
-
"generate": "node --import @oxc-node/core/register ./scripts/generate
|
|
31
|
+
"generate": "node --import @oxc-node/core/register ./scripts/generate.ts",
|
|
32
|
+
"generate:vitest": "node --import @oxc-node/core/register ./scripts/generate-vitest-rules.ts",
|
|
33
|
+
"generate:unsupported": "node --import @oxc-node/core/register ./scripts/fetch-unsupported-rules.ts",
|
|
34
|
+
"generate:all": "pnpm generate:vitest && pnpm generate && pnpm generate:unsupported && pnpm format",
|
|
32
35
|
"format": "oxfmt",
|
|
33
36
|
"lint": "oxlint --type-aware --type-check",
|
|
34
37
|
"test": "vitest",
|
|
@@ -38,11 +41,12 @@
|
|
|
38
41
|
"dependencies": {
|
|
39
42
|
"commander": "^14.0.0",
|
|
40
43
|
"globals": "^17.0.0",
|
|
41
|
-
"oxc-parser": "^0.
|
|
44
|
+
"oxc-parser": "^0.114.0",
|
|
42
45
|
"tinyglobby": "^0.2.14"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
45
48
|
"@antfu/eslint-config": "^7.0.0",
|
|
49
|
+
"@eslint-react/eslint-plugin": "^2.13.0",
|
|
46
50
|
"@eslint/js": "^9.29.0",
|
|
47
51
|
"@logux/eslint-config": "^57.0.0",
|
|
48
52
|
"@oxc-node/core": "^0.0.35",
|
|
@@ -69,15 +73,16 @@
|
|
|
69
73
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
70
74
|
"eslint-plugin-react-perf": "^3.3.3",
|
|
71
75
|
"eslint-plugin-react-refresh": "^0.5.0",
|
|
76
|
+
"eslint-plugin-react-web-api": "^2.13.0",
|
|
72
77
|
"eslint-plugin-regexp": "^3.0.0",
|
|
73
78
|
"eslint-plugin-tsdoc": "^0.5.0",
|
|
74
79
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
75
80
|
"husky": "^9.1.7",
|
|
76
81
|
"lint-staged": "^16.1.2",
|
|
77
82
|
"next": "^16.0.0",
|
|
78
|
-
"oxfmt": "^0.
|
|
79
|
-
"oxlint": "^1.
|
|
80
|
-
"oxlint-tsgolint": "^0.
|
|
83
|
+
"oxfmt": "^0.34.0",
|
|
84
|
+
"oxlint": "^1.50.0",
|
|
85
|
+
"oxlint-tsgolint": "^0.14.0",
|
|
81
86
|
"tsdown": "^0.20.0",
|
|
82
87
|
"typescript-eslint": "^8.35.0",
|
|
83
88
|
"vitest": "^4.0.0"
|
|
@@ -85,5 +90,5 @@
|
|
|
85
90
|
"lint-staged": {
|
|
86
91
|
"*": "oxfmt --no-error-on-unmatched-pattern"
|
|
87
92
|
},
|
|
88
|
-
"packageManager": "pnpm@10.
|
|
93
|
+
"packageManager": "pnpm@10.30.0"
|
|
89
94
|
}
|