@oxlint/migrate 1.38.0 → 1.39.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 { i as rules_exports, n as preFixForJsPlugins, r as nurseryRules, t as src_default } from "../src-
|
|
2
|
+
import { i as rules_exports, n as preFixForJsPlugins, r as nurseryRules, t as src_default } from "../src-Ckg1XOR4.mjs";
|
|
3
3
|
import { program } from "commander";
|
|
4
4
|
import { existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -40,7 +40,7 @@ const loadESLintConfig = async (filePath) => {
|
|
|
40
40
|
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region package.json
|
|
43
|
-
var version = "1.
|
|
43
|
+
var version = "1.39.0";
|
|
44
44
|
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/walker/comments/replaceRuleDirectiveComment.ts
|
package/dist/src/index.mjs
CHANGED
|
@@ -428,6 +428,7 @@ const styleRules = [
|
|
|
428
428
|
"@typescript-eslint/prefer-for-of",
|
|
429
429
|
"@typescript-eslint/prefer-function-type",
|
|
430
430
|
"@typescript-eslint/prefer-namespace-keyword",
|
|
431
|
+
"@typescript-eslint/prefer-optional-chain",
|
|
431
432
|
"@typescript-eslint/prefer-reduce-type-parameter",
|
|
432
433
|
"@typescript-eslint/prefer-return-this-type",
|
|
433
434
|
"unicorn/catch-error-name",
|
|
@@ -474,7 +475,10 @@ const styleRules = [
|
|
|
474
475
|
"vitest/consistent-test-filename",
|
|
475
476
|
"vitest/consistent-vitest-vi",
|
|
476
477
|
"vitest/no-import-node-test",
|
|
478
|
+
"vitest/no-unneeded-async-expect-function",
|
|
479
|
+
"vitest/prefer-called-once",
|
|
477
480
|
"vitest/prefer-called-times",
|
|
481
|
+
"vitest/prefer-describe-function-title",
|
|
478
482
|
"vitest/prefer-to-be-falsy",
|
|
479
483
|
"vitest/prefer-to-be-object",
|
|
480
484
|
"vitest/prefer-to-be-truthy",
|
|
@@ -765,7 +769,6 @@ const correctnessRules = [
|
|
|
765
769
|
"jsx-a11y/media-has-caption",
|
|
766
770
|
"jsx-a11y/mouse-events-have-key-events",
|
|
767
771
|
"jsx-a11y/no-noninteractive-tabindex",
|
|
768
|
-
"jsx-a11y/no-static-element-interactions",
|
|
769
772
|
"jsx-a11y/no-access-key",
|
|
770
773
|
"jsx-a11y/no-aria-hidden-on-focusable",
|
|
771
774
|
"jsx-a11y/no-autofocus",
|
|
@@ -856,11 +859,15 @@ const correctnessRules = [
|
|
|
856
859
|
"unicorn/no-useless-spread",
|
|
857
860
|
"unicorn/prefer-set-size",
|
|
858
861
|
"unicorn/prefer-string-starts-ends-with",
|
|
862
|
+
"vitest/consistent-each-for",
|
|
863
|
+
"vitest/hoisted-apis-on-top",
|
|
859
864
|
"vitest/no-conditional-tests",
|
|
860
865
|
"vitest/require-local-test-context-for-concurrent-snapshots",
|
|
861
866
|
"vitest/warn-todo",
|
|
867
|
+
"vue/no-arrow-functions-in-watch",
|
|
862
868
|
"vue/no-deprecated-destroyed-lifecycle",
|
|
863
869
|
"vue/no-export-in-script-setup",
|
|
870
|
+
"vue/no-lifecycle-after-await",
|
|
864
871
|
"vue/no-this-in-before-route-enter",
|
|
865
872
|
"vue/prefer-import-from-vue",
|
|
866
873
|
"vue/valid-define-emits",
|
|
@@ -887,6 +894,7 @@ const nurseryRules = [
|
|
|
887
894
|
"no-unreachable",
|
|
888
895
|
"import/export",
|
|
889
896
|
"import/named",
|
|
897
|
+
"jsx-a11y/no-static-element-interactions",
|
|
890
898
|
"promise/no-return-in-finally",
|
|
891
899
|
"react/require-render-return",
|
|
892
900
|
"import-x/export",
|
|
@@ -1455,6 +1463,24 @@ const preFixForJsPlugins = () => {
|
|
|
1455
1463
|
return fixForNextEslintConfig();
|
|
1456
1464
|
};
|
|
1457
1465
|
|
|
1466
|
+
//#endregion
|
|
1467
|
+
//#region src/files.ts
|
|
1468
|
+
/**
|
|
1469
|
+
* Process ESLint config files field, separating simple string patterns
|
|
1470
|
+
* from nested arrays (AND glob patterns which are unsupported in oxlint).
|
|
1471
|
+
*
|
|
1472
|
+
* @param files - The files field from ESLint config (can be string, array of strings, or array with nested arrays)
|
|
1473
|
+
* @param reporter - Optional reporter to report unsupported AND patterns
|
|
1474
|
+
* @returns Array of simple string patterns (valid files)
|
|
1475
|
+
*/
|
|
1476
|
+
function processConfigFiles(files, reporter) {
|
|
1477
|
+
const filesArray = Array.isArray(files) ? files : [files];
|
|
1478
|
+
const simpleFiles = [];
|
|
1479
|
+
for (const file of filesArray) if (Array.isArray(file)) reporter?.report(`ESLint AND glob patterns (nested arrays in files) are not supported in oxlint: ${JSON.stringify(file)}`);
|
|
1480
|
+
else simpleFiles.push(file);
|
|
1481
|
+
return simpleFiles;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1458
1484
|
//#endregion
|
|
1459
1485
|
//#region src/index.ts
|
|
1460
1486
|
const buildConfig = (configs, oxlintConfig, options) => {
|
|
@@ -1483,7 +1509,9 @@ const buildConfig = (configs, oxlintConfig, options) => {
|
|
|
1483
1509
|
let targetConfig;
|
|
1484
1510
|
if (config.files === void 0) targetConfig = oxlintConfig;
|
|
1485
1511
|
else {
|
|
1486
|
-
|
|
1512
|
+
const validFiles = processConfigFiles(config.files, options?.reporter);
|
|
1513
|
+
if (validFiles.length === 0) continue;
|
|
1514
|
+
targetConfig = { files: validFiles };
|
|
1487
1515
|
const [push, result] = detectSameOverride(oxlintConfig, targetConfig);
|
|
1488
1516
|
if (push) overrides.push(result);
|
|
1489
1517
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxlint/migrate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.39.0",
|
|
4
4
|
"description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
"jiti": "^2.4.2",
|
|
75
75
|
"lint-staged": "^16.1.2",
|
|
76
76
|
"next": "^16.0.0",
|
|
77
|
-
"oxfmt": "^0.
|
|
78
|
-
"oxlint": "^1.
|
|
77
|
+
"oxfmt": "^0.23.0",
|
|
78
|
+
"oxlint": "^1.39.0",
|
|
79
79
|
"oxlint-tsgolint": "^0.8.3",
|
|
80
|
-
"tsdown": "^0.
|
|
80
|
+
"tsdown": "^0.19.0",
|
|
81
81
|
"typescript-eslint": "^8.35.0",
|
|
82
82
|
"vitest": "^4.0.0"
|
|
83
83
|
},
|