@oxlint/migrate 1.49.0 → 1.51.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.
- package/README.md +14 -14
- package/dist/bin/oxlint-migrate.mjs +19 -7
- package/dist/{settings-Bb6227Gq.mjs → settings-R7dCJ7Y3.mjs} +126 -20
- package/dist/src/index.d.mts +85 -2649
- package/dist/src/index.mjs +10 -2
- package/package.json +14 -9
package/dist/src/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as cleanUpOxlintConfig, d as transformRuleEntry, g as
|
|
1
|
+
import { _ as transformEnvAndGlobals, c as cleanUpOxlintConfig, d as transformRuleEntry, g as detectEnvironmentByGlobals, h as typeAwareRules, i as fixForJsPlugins, l as detectNeededRulesPlugins, n as warnSettingsInOverride, o as detectSameOverride, r as processConfigFiles, s as transformIgnorePatterns, t as transformSettings } from "../settings-R7dCJ7Y3.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/index.ts
|
|
4
4
|
const buildConfig = (configs, oxlintConfig, options) => {
|
|
@@ -22,6 +22,8 @@ const buildConfig = (configs, oxlintConfig, options) => {
|
|
|
22
22
|
oxlintConfig.env.builtin = true;
|
|
23
23
|
}
|
|
24
24
|
const overrides = options?.merge ? oxlintConfig.overrides ?? [] : [];
|
|
25
|
+
const globalPlugins = {};
|
|
26
|
+
for (const config of configs) if (config.plugins) Object.assign(globalPlugins, config.plugins);
|
|
25
27
|
for (const config of configs) {
|
|
26
28
|
if (config.name?.startsWith("oxlint/")) continue;
|
|
27
29
|
let targetConfig;
|
|
@@ -34,7 +36,7 @@ const buildConfig = (configs, oxlintConfig, options) => {
|
|
|
34
36
|
if (push) overrides.push(result);
|
|
35
37
|
}
|
|
36
38
|
transformIgnorePatterns(config, targetConfig, options);
|
|
37
|
-
transformRuleEntry(config, targetConfig, config.files !== void 0 ? oxlintConfig : void 0, options, config.files === void 0 ? overrides : void 0);
|
|
39
|
+
transformRuleEntry(config, targetConfig, config.files !== void 0 ? oxlintConfig : void 0, options, config.files === void 0 ? overrides : void 0, globalPlugins);
|
|
38
40
|
transformEnvAndGlobals(config, targetConfig, options);
|
|
39
41
|
if (config.files === void 0) transformSettings(config, oxlintConfig, options);
|
|
40
42
|
else warnSettingsInOverride(config, options);
|
|
@@ -48,6 +50,12 @@ const buildConfig = (configs, oxlintConfig, options) => {
|
|
|
48
50
|
detectNeededRulesPlugins(oxlintConfig);
|
|
49
51
|
detectEnvironmentByGlobals(oxlintConfig);
|
|
50
52
|
cleanUpOxlintConfig(oxlintConfig);
|
|
53
|
+
if (options?.typeAware) {
|
|
54
|
+
if ([...Object.keys(oxlintConfig.rules ?? {}), ...(oxlintConfig.overrides ?? []).flatMap((o) => Object.keys(o.rules ?? {}))].some((rule) => typeAwareRules.includes(rule))) oxlintConfig.options = {
|
|
55
|
+
...oxlintConfig.options,
|
|
56
|
+
typeAware: true
|
|
57
|
+
};
|
|
58
|
+
}
|
|
51
59
|
return oxlintConfig;
|
|
52
60
|
};
|
|
53
61
|
const main = async (configs, oxlintConfig, options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxlint/migrate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.51.0",
|
|
4
4
|
"description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -41,22 +41,26 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"commander": "^14.0.0",
|
|
43
43
|
"globals": "^17.0.0",
|
|
44
|
-
"oxc-parser": "^0.
|
|
44
|
+
"oxc-parser": "^0.115.0",
|
|
45
45
|
"tinyglobby": "^0.2.14"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@antfu/eslint-config": "^7.0.0",
|
|
49
|
-
"@eslint
|
|
49
|
+
"@e18e/eslint-plugin": "^0.2.0",
|
|
50
|
+
"@eslint-react/eslint-plugin": "^2.13.0",
|
|
51
|
+
"@eslint/js": "^10.0.0",
|
|
50
52
|
"@logux/eslint-config": "^57.0.0",
|
|
51
53
|
"@oxc-node/core": "^0.0.35",
|
|
52
54
|
"@stylistic/eslint-plugin": "^5.0.0",
|
|
53
55
|
"@stylistic/eslint-plugin-ts": "^4.4.1",
|
|
56
|
+
"@tanstack/eslint-plugin-query": "^5.91.4",
|
|
57
|
+
"@tanstack/eslint-plugin-router": "^1.161.4",
|
|
54
58
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
55
59
|
"@types/node": "^25.0.0",
|
|
56
60
|
"@typescript-eslint/eslint-plugin": "^8.35.0",
|
|
57
61
|
"@typescript-eslint/parser": "^8.35.0",
|
|
58
62
|
"@vitest/coverage-v8": "^4.0.0",
|
|
59
|
-
"eslint": "^
|
|
63
|
+
"eslint": "^10.0.0",
|
|
60
64
|
"eslint-config-next": "^16.0.0",
|
|
61
65
|
"eslint-config-prettier": "^10.1.5",
|
|
62
66
|
"eslint-plugin-header": "^3.1.1",
|
|
@@ -72,15 +76,16 @@
|
|
|
72
76
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
73
77
|
"eslint-plugin-react-perf": "^3.3.3",
|
|
74
78
|
"eslint-plugin-react-refresh": "^0.5.0",
|
|
79
|
+
"eslint-plugin-react-web-api": "^2.13.0",
|
|
75
80
|
"eslint-plugin-regexp": "^3.0.0",
|
|
76
81
|
"eslint-plugin-tsdoc": "^0.5.0",
|
|
77
|
-
"eslint-plugin-unicorn": "^
|
|
82
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
78
83
|
"husky": "^9.1.7",
|
|
79
84
|
"lint-staged": "^16.1.2",
|
|
80
85
|
"next": "^16.0.0",
|
|
81
|
-
"oxfmt": "^0.
|
|
82
|
-
"oxlint": "^1.
|
|
83
|
-
"oxlint-tsgolint": "^0.
|
|
86
|
+
"oxfmt": "^0.35.0",
|
|
87
|
+
"oxlint": "^1.51.0",
|
|
88
|
+
"oxlint-tsgolint": "^0.15.0",
|
|
84
89
|
"tsdown": "^0.20.0",
|
|
85
90
|
"typescript-eslint": "^8.35.0",
|
|
86
91
|
"vitest": "^4.0.0"
|
|
@@ -88,5 +93,5 @@
|
|
|
88
93
|
"lint-staged": {
|
|
89
94
|
"*": "oxfmt --no-error-on-unmatched-pattern"
|
|
90
95
|
},
|
|
91
|
-
"packageManager": "pnpm@10.
|
|
96
|
+
"packageManager": "pnpm@10.30.3"
|
|
92
97
|
}
|