@oxlint/migrate 1.38.0 → 1.40.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-pmJg5CKN.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.40.0";
|
|
44
44
|
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/walker/comments/replaceRuleDirectiveComment.ts
|
package/dist/src/index.mjs
CHANGED
|
@@ -42,6 +42,7 @@ const OTHER_SUPPORTED_ENVS = [
|
|
|
42
42
|
"applescript",
|
|
43
43
|
"astro",
|
|
44
44
|
"atomtest",
|
|
45
|
+
"audioworklet",
|
|
45
46
|
"commonjs",
|
|
46
47
|
"embertest",
|
|
47
48
|
"greasemonkey",
|
|
@@ -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,8 +894,10 @@ 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",
|
|
900
|
+
"@typescript-eslint/prefer-optional-chain",
|
|
892
901
|
"import-x/export",
|
|
893
902
|
"import-x/named"
|
|
894
903
|
];
|
|
@@ -1455,6 +1464,24 @@ const preFixForJsPlugins = () => {
|
|
|
1455
1464
|
return fixForNextEslintConfig();
|
|
1456
1465
|
};
|
|
1457
1466
|
|
|
1467
|
+
//#endregion
|
|
1468
|
+
//#region src/files.ts
|
|
1469
|
+
/**
|
|
1470
|
+
* Process ESLint config files field, separating simple string patterns
|
|
1471
|
+
* from nested arrays (AND glob patterns which are unsupported in oxlint).
|
|
1472
|
+
*
|
|
1473
|
+
* @param files - The files field from ESLint config (can be string, array of strings, or array with nested arrays)
|
|
1474
|
+
* @param reporter - Optional reporter to report unsupported AND patterns
|
|
1475
|
+
* @returns Array of simple string patterns (valid files)
|
|
1476
|
+
*/
|
|
1477
|
+
function processConfigFiles(files, reporter) {
|
|
1478
|
+
const filesArray = Array.isArray(files) ? files : [files];
|
|
1479
|
+
const simpleFiles = [];
|
|
1480
|
+
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)}`);
|
|
1481
|
+
else simpleFiles.push(file);
|
|
1482
|
+
return simpleFiles;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1458
1485
|
//#endregion
|
|
1459
1486
|
//#region src/index.ts
|
|
1460
1487
|
const buildConfig = (configs, oxlintConfig, options) => {
|
|
@@ -1483,7 +1510,9 @@ const buildConfig = (configs, oxlintConfig, options) => {
|
|
|
1483
1510
|
let targetConfig;
|
|
1484
1511
|
if (config.files === void 0) targetConfig = oxlintConfig;
|
|
1485
1512
|
else {
|
|
1486
|
-
|
|
1513
|
+
const validFiles = processConfigFiles(config.files, options?.reporter);
|
|
1514
|
+
if (validFiles.length === 0) continue;
|
|
1515
|
+
targetConfig = { files: validFiles };
|
|
1487
1516
|
const [push, result] = detectSameOverride(oxlintConfig, targetConfig);
|
|
1488
1517
|
if (push) overrides.push(result);
|
|
1489
1518
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxlint/migrate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.40.0",
|
|
4
4
|
"description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"commander": "^14.0.0",
|
|
40
|
-
"globals": "^
|
|
41
|
-
"oxc-parser": "^0.
|
|
40
|
+
"globals": "^17.0.0",
|
|
41
|
+
"oxc-parser": "^0.108.0",
|
|
42
42
|
"tinyglobby": "^0.2.14"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"eslint-plugin-header": "^3.1.1",
|
|
60
60
|
"eslint-plugin-import": "^2.32.0",
|
|
61
61
|
"eslint-plugin-import-x": "^4.16.0",
|
|
62
|
-
"eslint-plugin-jsdoc": "^
|
|
62
|
+
"eslint-plugin-jsdoc": "^62.0.0",
|
|
63
63
|
"eslint-plugin-local": "^6.0.0",
|
|
64
64
|
"eslint-plugin-mocha": "^11.2.0",
|
|
65
65
|
"eslint-plugin-oxlint": "^1.3.0",
|
|
@@ -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.24.0",
|
|
78
|
+
"oxlint": "^1.40.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
|
},
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"lint-staged": {
|
|
88
88
|
"*": "oxfmt --no-error-on-unmatched-pattern"
|
|
89
89
|
},
|
|
90
|
-
"packageManager": "pnpm@10.
|
|
90
|
+
"packageManager": "pnpm@10.28.0"
|
|
91
91
|
}
|