@oxlint/migrate 1.46.0 → 1.48.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 { a as preFixForJsPlugins, f as nurseryRules, p as rules_exports, u as isOffValue } from "../settings-C8UlaScv.mjs";
2
+ import { a as preFixForJsPlugins, f as nurseryRules, p as rules_exports, u as isOffValue } from "../settings-DozKYNAk.mjs";
3
3
  import main from "../src/index.mjs";
4
4
  import { program } from "commander";
5
5
  import { existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
@@ -33,7 +33,7 @@ const loadESLintConfig = async (filePath) => {
33
33
 
34
34
  //#endregion
35
35
  //#region package.json
36
- var version = "1.46.0";
36
+ var version = "1.48.0";
37
37
 
38
38
  //#endregion
39
39
  //#region src/walker/comments/replaceRuleDirectiveComment.ts
@@ -425,6 +425,7 @@ const styleRules = [
425
425
  "@typescript-eslint/adjacent-overload-signatures",
426
426
  "@typescript-eslint/array-type",
427
427
  "@typescript-eslint/ban-tslint-comment",
428
+ "@typescript-eslint/class-literal-property-style",
428
429
  "@typescript-eslint/consistent-generic-constructors",
429
430
  "@typescript-eslint/consistent-indexed-object-style",
430
431
  "@typescript-eslint/consistent-type-assertions",
@@ -432,10 +433,12 @@ const styleRules = [
432
433
  "@typescript-eslint/consistent-type-imports",
433
434
  "@typescript-eslint/no-empty-interface",
434
435
  "@typescript-eslint/no-inferrable-types",
436
+ "@typescript-eslint/parameter-properties",
435
437
  "@typescript-eslint/prefer-for-of",
436
438
  "@typescript-eslint/prefer-function-type",
437
439
  "@typescript-eslint/prefer-reduce-type-parameter",
438
440
  "@typescript-eslint/prefer-return-this-type",
441
+ "@typescript-eslint/unified-signatures",
439
442
  "unicorn/catch-error-name",
440
443
  "unicorn/consistent-date-clone",
441
444
  "unicorn/consistent-existence-index-check",
@@ -548,7 +551,9 @@ const suspiciousRules = [
548
551
  "no-extend-native",
549
552
  "no-extra-bind",
550
553
  "no-new",
554
+ "no-shadow",
551
555
  "no-unexpected-multiline",
556
+ "no-unmodified-loop-condition",
552
557
  "no-unneeded-ternary",
553
558
  "no-useless-concat",
554
559
  "no-useless-constructor",
@@ -588,6 +593,7 @@ const suspiciousRules = [
588
593
  "unicorn/require-post-message-target-origin",
589
594
  "vue/no-required-prop-with-default",
590
595
  "vue/require-default-export",
596
+ "@typescript-eslint/no-shadow",
591
597
  "@typescript-eslint/no-useless-constructor",
592
598
  "import-x/no-absolute-path",
593
599
  "import-x/no-empty-named-blocks",
@@ -649,11 +655,13 @@ const restrictionRules = [
649
655
  "@typescript-eslint/no-empty-object-type",
650
656
  "@typescript-eslint/no-explicit-any",
651
657
  "@typescript-eslint/no-import-type-side-effects",
658
+ "@typescript-eslint/no-invalid-void-type",
652
659
  "@typescript-eslint/no-namespace",
653
660
  "@typescript-eslint/no-non-null-asserted-nullish-coalescing",
654
661
  "@typescript-eslint/no-non-null-assertion",
655
662
  "@typescript-eslint/no-require-imports",
656
663
  "@typescript-eslint/no-restricted-types",
664
+ "@typescript-eslint/no-use-before-define",
657
665
  "@typescript-eslint/no-var-requires",
658
666
  "@typescript-eslint/non-nullable-type-assertion-style",
659
667
  "@typescript-eslint/prefer-literal-enum-member",
@@ -791,6 +799,7 @@ const correctnessRules = [
791
799
  "jsx-a11y/no-distracting-elements",
792
800
  "jsx-a11y/no-noninteractive-tabindex",
793
801
  "jsx-a11y/no-redundant-roles",
802
+ "jsx-a11y/no-static-element-interactions",
794
803
  "jsx-a11y/prefer-tag-over-role",
795
804
  "jsx-a11y/role-has-required-aria-props",
796
805
  "jsx-a11y/role-supports-aria-props",
@@ -911,9 +920,9 @@ const nurseryRules = [
911
920
  "no-unreachable",
912
921
  "import/export",
913
922
  "import/named",
914
- "jsx-a11y/no-static-element-interactions",
915
923
  "promise/no-return-in-finally",
916
924
  "react/require-render-return",
925
+ "@typescript-eslint/no-unnecessary-condition",
917
926
  "@typescript-eslint/prefer-optional-chain",
918
927
  "import-x/export",
919
928
  "import-x/named"
@@ -921,6 +930,7 @@ const nurseryRules = [
921
930
  const perfRules = [
922
931
  "no-await-in-loop",
923
932
  "no-useless-call",
933
+ "react/jsx-no-constructed-context-values",
924
934
  "react/no-array-index-key",
925
935
  "react-perf/jsx-no-jsx-as-prop",
926
936
  "react-perf/jsx-no-new-array-as-prop",
@@ -946,6 +956,7 @@ const typeAwareRules = [
946
956
  "@typescript-eslint/no-mixed-enums",
947
957
  "@typescript-eslint/no-redundant-type-constituents",
948
958
  "@typescript-eslint/no-unnecessary-boolean-literal-compare",
959
+ "@typescript-eslint/no-unnecessary-condition",
949
960
  "@typescript-eslint/no-unnecessary-template-expression",
950
961
  "@typescript-eslint/no-unnecessary-type-arguments",
951
962
  "@typescript-eslint/no-unnecessary-type-assertion",
@@ -1103,6 +1114,11 @@ const normalizeSeverityValue = (value) => {
1103
1114
  return "off";
1104
1115
  }
1105
1116
  };
1117
+ const removePreviousOverrideRule = (rule, eslintConfig, overrides) => {
1118
+ if (eslintConfig.files === void 0 && overrides) {
1119
+ for (const override of overrides) if (override.rules?.[rule]) delete override.rules[rule];
1120
+ }
1121
+ };
1106
1122
  /**
1107
1123
  * Merges a new rule configuration with an existing one, preserving options when
1108
1124
  * the new config only specifies a severity level.
@@ -1128,11 +1144,12 @@ const mergeRuleConfig = (existingConfig, newConfig) => {
1128
1144
  if (Array.isArray(newConfig) && newConfig.length === 1 && existingIsArray && existingConfig.length > 1) return [newConfig[0], ...existingConfig.slice(1)];
1129
1145
  return newConfig;
1130
1146
  };
1131
- const transformRuleEntry = (eslintConfig, targetConfig, baseConfig, options) => {
1147
+ const transformRuleEntry = (eslintConfig, targetConfig, baseConfig, options, overrides) => {
1132
1148
  if (eslintConfig.rules === void 0) return;
1133
1149
  if (targetConfig.rules === void 0) targetConfig.rules = {};
1134
1150
  for (const [rule, config] of Object.entries(eslintConfig.rules)) {
1135
1151
  const normalizedConfig = normalizeSeverityValue(config);
1152
+ if (!options?.merge) removePreviousOverrideRule(rule, eslintConfig, overrides);
1136
1153
  if (allRules.includes(rule)) {
1137
1154
  if (!options?.withNursery && nurseryRules.includes(rule)) {
1138
1155
  options?.reporter?.markSkipped(rule, "nursery");
@@ -1,4 +1,4 @@
1
- import { c as cleanUpOxlintConfig, d as transformRuleEntry, h as transformEnvAndGlobals, i as fixForJsPlugins, l as detectNeededRulesPlugins, m as detectEnvironmentByGlobals, n as warnSettingsInOverride, o as detectSameOverride, r as processConfigFiles, s as transformIgnorePatterns, t as transformSettings } from "../settings-C8UlaScv.mjs";
1
+ import { c as cleanUpOxlintConfig, d as transformRuleEntry, h as transformEnvAndGlobals, i as fixForJsPlugins, l as detectNeededRulesPlugins, m as detectEnvironmentByGlobals, n as warnSettingsInOverride, o as detectSameOverride, r as processConfigFiles, s as transformIgnorePatterns, t as transformSettings } from "../settings-DozKYNAk.mjs";
2
2
 
3
3
  //#region src/index.ts
4
4
  const buildConfig = (configs, oxlintConfig, options) => {
@@ -34,7 +34,7 @@ const buildConfig = (configs, oxlintConfig, options) => {
34
34
  if (push) overrides.push(result);
35
35
  }
36
36
  transformIgnorePatterns(config, targetConfig, options);
37
- transformRuleEntry(config, targetConfig, config.files !== void 0 ? oxlintConfig : void 0, options);
37
+ transformRuleEntry(config, targetConfig, config.files !== void 0 ? oxlintConfig : void 0, options, config.files === void 0 ? overrides : void 0);
38
38
  transformEnvAndGlobals(config, targetConfig, options);
39
39
  if (config.files === void 0) transformSettings(config, oxlintConfig, options);
40
40
  else warnSettingsInOverride(config, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxlint/migrate",
3
- "version": "1.46.0",
3
+ "version": "1.48.0",
4
4
  "description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -76,7 +76,7 @@
76
76
  "lint-staged": "^16.1.2",
77
77
  "next": "^16.0.0",
78
78
  "oxfmt": "^0.28.0",
79
- "oxlint": "^1.46.0",
79
+ "oxlint": "^1.48.0",
80
80
  "oxlint-tsgolint": "^0.11.3",
81
81
  "tsdown": "^0.20.0",
82
82
  "typescript-eslint": "^8.35.0",