@oxlint/migrate 1.13.0 → 1.15.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.
@@ -8,6 +8,7 @@ import packageJson from "../package.json.mjs";
8
8
  import { walkAndReplaceProjectFiles } from "../src/walker/index.mjs";
9
9
  import { getAllProjectFiles } from "./project-loader.mjs";
10
10
  import { writeFile } from "node:fs/promises";
11
+ import { preFixForJsPlugins } from "../src/js_plugin_fixes.mjs";
11
12
  const cwd = process.cwd();
12
13
  const getFileContent = (absoluteFilePath) => {
13
14
  try {
@@ -60,7 +61,9 @@ program.name("oxlint-migrate").version(packageJson.version).argument("[eslint-co
60
61
  if (filePath === void 0) {
61
62
  program.error(`could not autodetect eslint config file`);
62
63
  }
64
+ const resetPreFix = await preFixForJsPlugins();
63
65
  const eslintConfigs = await loadESLintConfig(filePath);
66
+ resetPreFix();
64
67
  let config;
65
68
  if (options.merge && existsSync(oxlintFilePath)) {
66
69
  config = JSON.parse(
@@ -1,4 +1,4 @@
1
- const version = "1.13.0";
1
+ const version = "1.15.0";
2
2
  const packageJson = {
3
3
  version
4
4
  };
@@ -25,14 +25,11 @@ const cleanUpDefaultTypeScriptOverridesForEslint = (config) => {
25
25
  if (config.overrides === void 0) {
26
26
  return;
27
27
  }
28
- const indexesToDelete = [];
29
- for (const index in config.overrides) {
30
- const override = config.overrides[index];
28
+ for (const [index, override] of config.overrides.entries()) {
31
29
  if (isEqualDeep(override, TS_ESLINT_DEFAULT_OVERRIDE)) {
32
- indexesToDelete.push(index);
30
+ delete config.overrides[index];
33
31
  }
34
32
  }
35
- indexesToDelete.forEach((index) => delete config.overrides[index]);
36
33
  config.overrides = config.overrides.filter(
37
34
  (overrides) => Object.keys(overrides).length > 0
38
35
  );
@@ -48,8 +45,8 @@ const cleanUpUselessOverridesEntries = (config) => {
48
45
  if (config.overrides === void 0) {
49
46
  return;
50
47
  }
51
- for (const overrideIndex in config.overrides) {
52
- if (Object.keys(config.overrides[overrideIndex]).length === 1) {
48
+ for (const [overrideIndex, override] of config.overrides.entries()) {
49
+ if (Object.keys(override).length === 1) {
53
50
  delete config.overrides[overrideIndex];
54
51
  }
55
52
  }
@@ -13,7 +13,8 @@ const rulesPrefixesForPlugins = {
13
13
  "react-hooks": "react",
14
14
  "@typescript-eslint": "typescript",
15
15
  unicorn: "unicorn",
16
- vitest: "vitest"
16
+ vitest: "vitest",
17
+ vue: "vue"
17
18
  };
18
19
  const typescriptRulesExtendEslintRules = [
19
20
  "class-methods-use-this",
@@ -40,6 +40,7 @@ const pedanticRules = [
40
40
  "@typescript-eslint/ban-ts-comment",
41
41
  "@typescript-eslint/ban-types",
42
42
  "@typescript-eslint/no-misused-promises",
43
+ "@typescript-eslint/no-confusing-void-expression",
43
44
  "@typescript-eslint/no-mixed-enums",
44
45
  "@typescript-eslint/no-unsafe-argument",
45
46
  "@typescript-eslint/no-unsafe-assignment",
@@ -257,6 +258,8 @@ const styleRules = [
257
258
  "vitest/prefer-to-be-falsy",
258
259
  "vitest/prefer-to-be-object",
259
260
  "vitest/prefer-to-be-truthy",
261
+ "vue/define-emits-declaration",
262
+ "vue/define-props-declaration",
260
263
  "@typescript-eslint/default-param-last",
261
264
  "@typescript-eslint/init-declarations",
262
265
  "@typescript-eslint/max-params",
@@ -330,6 +333,7 @@ const suspiciousRules = [
330
333
  "@typescript-eslint/no-unsafe-enum-comparison",
331
334
  "@typescript-eslint/no-unsafe-type-assertion",
332
335
  "unicorn/consistent-function-scoping",
336
+ "unicorn/no-array-reverse",
333
337
  "unicorn/no-instanceof-builtins",
334
338
  "unicorn/no-accessor-recursion",
335
339
  "unicorn/prefer-add-event-listener",
@@ -408,6 +412,7 @@ const restrictionRules = [
408
412
  "unicorn/prefer-modern-math-apis",
409
413
  "unicorn/prefer-node-protocol",
410
414
  "unicorn/prefer-number-properties",
415
+ "vue/no-multiple-slot-args",
411
416
  "@typescript-eslint/no-restricted-imports",
412
417
  "@typescript-eslint/no-empty-function",
413
418
  "@typescript-eslint/no-unused-expressions",
@@ -564,7 +569,6 @@ const correctnessRules = [
564
569
  "@typescript-eslint/no-floating-promises",
565
570
  "@typescript-eslint/no-array-delete",
566
571
  "@typescript-eslint/no-base-to-string",
567
- "@typescript-eslint/no-confusing-void-expression",
568
572
  "@typescript-eslint/no-duplicate-enum-values",
569
573
  "@typescript-eslint/no-duplicate-type-constituents",
570
574
  "@typescript-eslint/no-extra-non-null-assertion",
@@ -601,6 +605,8 @@ const correctnessRules = [
601
605
  "unicorn/prefer-string-starts-ends-with",
602
606
  "vitest/no-conditional-tests",
603
607
  "vitest/require-local-test-context-for-concurrent-snapshots",
608
+ "vue/valid-define-emits",
609
+ "vue/valid-define-props",
604
610
  "@typescript-eslint/no-dupe-class-members",
605
611
  "@typescript-eslint/no-loss-of-precision",
606
612
  "@typescript-eslint/no-unused-vars",
@@ -14,11 +14,6 @@ const transformIgnorePatterns = (eslintConfig, targetConfig, options) => {
14
14
  targetConfig.ignorePatterns.push(ignores);
15
15
  }
16
16
  }
17
- eslintConfig.ignores.filter((ignore) => ignore.startsWith("!")).forEach(
18
- (ignore) => options?.reporter !== void 0 && options.reporter(
19
- `ignore allow list is currently not supported: ${ignore}`
20
- )
21
- );
22
17
  };
23
18
  export {
24
19
  transformIgnorePatterns
@@ -1,4 +1,5 @@
1
1
  import { Linter } from 'eslint';
2
2
  type PossibleConfigs = Linter.Config | Linter.Config[] | Promise<Linter.Config> | Promise<Linter.Config[]>;
3
3
  export default function fixForJsPlugins(configs: PossibleConfigs): PossibleConfigs;
4
+ export declare const preFixForJsPlugins: () => Promise<() => void>;
4
5
  export {};
@@ -8,9 +8,31 @@ const fixForAntfuEslintConfig = (config) => {
8
8
  }
9
9
  return config;
10
10
  };
11
+ const fixForNextEslintConfig = async () => {
12
+ if ("Deno" in globalThis || "Bun" in globalThis) {
13
+ return () => {
14
+ };
15
+ }
16
+ const Module = await import("module");
17
+ const mod = Module.default || Module;
18
+ const originalLoad = mod._load;
19
+ mod._load = function(request, ...args) {
20
+ if (request && request.includes("@rushstack/eslint-patch")) {
21
+ return {};
22
+ }
23
+ return originalLoad.apply(mod, [request, ...args]);
24
+ };
25
+ return () => {
26
+ mod._load = originalLoad;
27
+ };
28
+ };
11
29
  function fixForJsPlugins(configs) {
12
30
  return fixForAntfuEslintConfig(configs);
13
31
  }
32
+ const preFixForJsPlugins = () => {
33
+ return fixForNextEslintConfig();
34
+ };
14
35
  export {
15
- fixForJsPlugins as default
36
+ fixForJsPlugins as default,
37
+ preFixForJsPlugins
16
38
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxlint/migrate",
3
- "version": "1.13.0",
3
+ "version": "1.15.0",
4
4
  "description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
5
5
  "type": "module",
6
6
  "bin": {
@@ -50,6 +50,7 @@
50
50
  "@typescript-eslint/parser": "^8.35.0",
51
51
  "@vitest/coverage-v8": "^3.2.4",
52
52
  "eslint": "^9.29.0",
53
+ "eslint-config-next": "^15.5.0",
53
54
  "eslint-config-prettier": "^10.1.5",
54
55
  "eslint-plugin-header": "^3.1.1",
55
56
  "eslint-plugin-import": "^2.32.0",
@@ -61,11 +62,13 @@
61
62
  "eslint-plugin-react-hooks": "^5.2.0",
62
63
  "eslint-plugin-react-perf": "^3.3.3",
63
64
  "eslint-plugin-regexp": "^2.9.0",
64
- "eslint-plugin-unicorn": "^60.0.0",
65
+ "eslint-plugin-unicorn": "^61.0.0",
65
66
  "husky": "^9.1.7",
66
67
  "jiti": "^2.4.2",
67
68
  "lint-staged": "^16.1.2",
68
- "oxlint": "^1.13.0",
69
+ "next": "^15.5.0",
70
+ "oxlint": "^1.15.0",
71
+ "oxlint-tsgolint": "^0.1.5",
69
72
  "prettier": "^3.6.1",
70
73
  "typescript": "^5.8.3",
71
74
  "typescript-eslint": "^8.35.0",
@@ -78,12 +81,12 @@
78
81
  },
79
82
  "dependencies": {
80
83
  "commander": "^14.0.0",
81
- "oxc-parser": "^0.82.0",
84
+ "globals": "^16.3.0",
85
+ "oxc-parser": "^0.87.0",
82
86
  "tinyglobby": "^0.2.14"
83
87
  },
84
88
  "peerDependencies": {
85
- "globals": "^14.0.0 || ^15.0.0 || ^16.0.0",
86
89
  "jiti": "*"
87
90
  },
88
- "packageManager": "pnpm@10.15.0"
91
+ "packageManager": "pnpm@10.15.1"
89
92
  }