@oxlint/migrate 1.26.0 → 1.29.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
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@oxlint/migrate)
|
|
5
5
|
[](https://www.npmjs.com/package/@oxlint/migrate)
|
|
6
6
|
|
|
7
|
-
Generates a `.oxlintrc.json` from
|
|
7
|
+
Generates a `.oxlintrc.json` from an existing eslint flat config.
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
package/dist/package.json.mjs
CHANGED
package/dist/src/env_globals.mjs
CHANGED
|
@@ -93,12 +93,13 @@ const detectEnvironmentByGlobals = (config) => {
|
|
|
93
93
|
let search = Object.keys(entries);
|
|
94
94
|
let matches = search.filter(
|
|
95
95
|
(entry) => (
|
|
96
|
-
// @ts-
|
|
97
|
-
entry in config.globals && // @ts-
|
|
96
|
+
// @ts-expect-error -- we already checked for undefined
|
|
97
|
+
entry in config.globals && // @ts-expect-error -- filtering makes the key to any
|
|
98
98
|
normalizeGlobValue(config.globals[entry]) === entries[entry]
|
|
99
99
|
)
|
|
100
100
|
);
|
|
101
|
-
|
|
101
|
+
const useThreshold = env === "browser" || env === "node";
|
|
102
|
+
if (useThreshold && matches.length / search.length >= 0.97 || !useThreshold && matches.length === search.length) {
|
|
102
103
|
if (config.env === void 0) {
|
|
103
104
|
config.env = {};
|
|
104
105
|
}
|
|
@@ -108,11 +109,11 @@ const detectEnvironmentByGlobals = (config) => {
|
|
|
108
109
|
};
|
|
109
110
|
const transformEnvAndGlobals = (eslintConfig, targetConfig, options) => {
|
|
110
111
|
if (eslintConfig.languageOptions?.parser !== void 0 && eslintConfig.languageOptions?.parser !== null && typeof eslintConfig.languageOptions.parser === "object" && "meta" in eslintConfig.languageOptions.parser && !SUPPORTED_ESLINT_PARSERS.includes(
|
|
111
|
-
// @ts-
|
|
112
|
+
// @ts-expect-error
|
|
112
113
|
eslintConfig.languageOptions.parser.meta?.name
|
|
113
114
|
)) {
|
|
114
115
|
options?.reporter?.report(
|
|
115
|
-
"special parser detected: " + // @ts-
|
|
116
|
+
"special parser detected: " + // @ts-expect-error
|
|
116
117
|
eslintConfig.languageOptions.parser.meta?.name
|
|
117
118
|
);
|
|
118
119
|
}
|
|
@@ -53,6 +53,7 @@ const pedanticRules = [
|
|
|
53
53
|
"@typescript-eslint/no-unsafe-return",
|
|
54
54
|
"@typescript-eslint/only-throw-error",
|
|
55
55
|
"@typescript-eslint/prefer-enum-initializers",
|
|
56
|
+
"@typescript-eslint/prefer-includes",
|
|
56
57
|
"@typescript-eslint/prefer-promise-reject-errors",
|
|
57
58
|
"@typescript-eslint/prefer-ts-expect-error",
|
|
58
59
|
"@typescript-eslint/related-getter-setter-pairs",
|
|
@@ -239,6 +240,7 @@ const styleRules = [
|
|
|
239
240
|
"unicorn/empty-brace-spaces",
|
|
240
241
|
"unicorn/error-message",
|
|
241
242
|
"unicorn/filename-case",
|
|
243
|
+
"unicorn/no-useless-collection-argument",
|
|
242
244
|
"unicorn/no-array-method-this-argument",
|
|
243
245
|
"unicorn/no-await-expression-member",
|
|
244
246
|
"unicorn/no-console-spaces",
|
|
@@ -250,6 +252,7 @@ const styleRules = [
|
|
|
250
252
|
"unicorn/numeric-separators-style",
|
|
251
253
|
"unicorn/prefer-classlist-toggle",
|
|
252
254
|
"unicorn/prefer-class-fields",
|
|
255
|
+
"unicorn/prefer-response-static-json",
|
|
253
256
|
"unicorn/prefer-global-this",
|
|
254
257
|
"unicorn/prefer-object-from-entries",
|
|
255
258
|
"unicorn/prefer-array-index-of",
|
|
@@ -6,8 +6,8 @@ const allRules = Object.values(rules).flat();
|
|
|
6
6
|
const isValueInSet = (value, validSet) => validSet.includes(value) || Array.isArray(value) && validSet.includes(value[0]);
|
|
7
7
|
const isActiveValue = (value) => isValueInSet(value, ["error", "warn", 1, 2]);
|
|
8
8
|
const isOffValue = (value) => isValueInSet(value, ["off", 0]);
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const isWarnValue = (value) => isValueInSet(value, ["warn", 1]);
|
|
10
|
+
const isErrorValue = (value) => isValueInSet(value, ["error", 2]);
|
|
11
11
|
const normalizeSeverityValue = (value) => {
|
|
12
12
|
if (value === void 0) {
|
|
13
13
|
return value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxlint/migrate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
4
4
|
"description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@antfu/eslint-config": "^6.0.0",
|
|
41
41
|
"@eslint/js": "^9.29.0",
|
|
42
42
|
"@logux/eslint-config": "^57.0.0",
|
|
43
|
-
"@oxc-node/core": "^0.0.
|
|
43
|
+
"@oxc-node/core": "^0.0.34",
|
|
44
44
|
"@stylistic/eslint-plugin": "^5.0.0",
|
|
45
45
|
"@stylistic/eslint-plugin-ts": "^4.4.1",
|
|
46
46
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
64
64
|
"eslint-plugin-react-perf": "^3.3.3",
|
|
65
65
|
"eslint-plugin-regexp": "^2.9.0",
|
|
66
|
-
"eslint-plugin-tsdoc": "^0.
|
|
66
|
+
"eslint-plugin-tsdoc": "^0.5.0",
|
|
67
67
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
68
68
|
"husky": "^9.1.7",
|
|
69
69
|
"jiti": "^2.4.2",
|
|
70
70
|
"lint-staged": "^16.1.2",
|
|
71
71
|
"next": "^16.0.0",
|
|
72
|
-
"oxlint": "^1.
|
|
73
|
-
"oxlint-tsgolint": "^0.
|
|
72
|
+
"oxlint": "^1.29.0",
|
|
73
|
+
"oxlint-tsgolint": "^0.5.1",
|
|
74
74
|
"prettier": "^3.6.1",
|
|
75
75
|
"typescript": "^5.8.3",
|
|
76
76
|
"typescript-eslint": "^8.35.0",
|
|
@@ -84,11 +84,11 @@
|
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"commander": "^14.0.0",
|
|
86
86
|
"globals": "^16.3.0",
|
|
87
|
-
"oxc-parser": "^0.
|
|
87
|
+
"oxc-parser": "^0.97.0",
|
|
88
88
|
"tinyglobby": "^0.2.14"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"jiti": "*"
|
|
92
92
|
},
|
|
93
|
-
"packageManager": "pnpm@10.
|
|
93
|
+
"packageManager": "pnpm@10.22.0"
|
|
94
94
|
}
|