@oxlint/migrate 1.76.0 → 1.78.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 nurseryRules, i as buildUnsupportedRuleExplanations, n as preFixForJsPlugins, o as rules_exports, r as isOffValue, s as normalizeRuleToCanonical, t as main } from "../src-CMaVigSj.mjs";
2
+ import { a as nurseryRules, i as buildUnsupportedRuleExplanations, n as preFixForJsPlugins, o as rules_exports, r as isOffValue, s as normalizeRuleToCanonical, t as main } from "../src-Bn5kidka.mjs";
3
3
  import { program } from "commander";
4
4
  import { existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
5
5
  import path from "node:path";
@@ -30,7 +30,7 @@ const loadESLintConfig = async (filePath) => {
30
30
  };
31
31
  //#endregion
32
32
  //#region package.json
33
- var version = "1.76.0";
33
+ var version = "1.78.0";
34
34
  //#endregion
35
35
  //#region src/walker/comments/replaceRuleDirectiveComment.ts
36
36
  const allRulesSet = new Set(Object.values(rules_exports).flat());
@@ -10,7 +10,7 @@
10
10
  /**
11
11
  * What to enforce for `/// <reference types="..." />` references.
12
12
  */
13
- //#region node_modules/.pnpm/oxlint@1.76.0_oxlint-tsgolint@0.24.0/node_modules/oxlint/dist/index.d.ts
13
+ //#region node_modules/.pnpm/oxlint@1.78.0_oxlint-tsgolint@0.24.0/node_modules/oxlint/dist/index.d.ts
14
14
  //#region src-js/package/config.generated.d.ts
15
15
  type AllowWarnDeny = ("allow" | "off" | "warn" | "error" | "deny") | number;
16
16
  type GlobalValue = ("readonly" | "writable" | "off") | undefined;
@@ -163,6 +163,18 @@ type ExportsStyleMode = "module.exports" | "exports";
163
163
  type HandleCallbackErrConfig = string;
164
164
  type NoMixedRequiresConfig = boolean | NoMixedRequiresOptions;
165
165
  type ShorthandType = "always" | "methods" | "properties" | "consistent" | "consistent-as-needed" | "never";
166
+ /**
167
+ * Enforces consistent grouping of variable declarations.
168
+ */
169
+ type OneVar = OneVarConfig;
170
+ /**
171
+ * Configuration accepted by the `one-var` rule.
172
+ */
173
+ type OneVarConfig = OneVarMode | OneVarOptions;
174
+ /**
175
+ * Controls how variable declarators are grouped into declarations.
176
+ */
177
+ type OneVarMode = "always" | "never" | "consecutive";
166
178
  type Destructuring = "any" | "all";
167
179
  type PreferDestructuringOption = PreferDestructuringTargetOption | PreferDestructuringAssignmentConfig;
168
180
  type TerminationMethod = string | string[];
@@ -210,9 +222,7 @@ type ImportKind = "none" | "all" | "multiple" | "single";
210
222
  type SortOrder = "desc" | "asc";
211
223
  type ArrayOption = "array" | "array-simple" | "generic";
212
224
  type ReadonlyArrayOption = "array" | "array-simple" | "generic";
213
- type DirectiveConfigSchema = boolean | RequireDescription | {
214
- descriptionFormat?: string;
215
- };
225
+ type DirectiveConfigSchema = boolean | RequireDescription | DescriptionFormatConfig;
216
226
  type RequireDescription = "allow-with-description";
217
227
  type ClassLiteralPropertyStyleOption = "fields" | "getters";
218
228
  type PreferGenericType = "constructor" | "type-annotation";
@@ -955,6 +965,7 @@ interface DummyRuleMap {
955
965
  "jsdoc/check-tag-names"?: RuleNoConfig | [AllowWarnDeny, CheckTagNamesConfig];
956
966
  "jsdoc/empty-tags"?: RuleNoConfig | [AllowWarnDeny, EmptyTagsConfig];
957
967
  "jsdoc/implements-on-classes"?: RuleNoConfig;
968
+ "jsdoc/no-blank-blocks"?: RuleNoConfig | [AllowWarnDeny, NoBlankBlocks];
958
969
  "jsdoc/no-defaults"?: RuleNoConfig | [AllowWarnDeny, NoDefaultsConfig];
959
970
  "jsdoc/require-param"?: RuleNoConfig | [AllowWarnDeny, RequireParamConfig];
960
971
  "jsdoc/require-param-description"?: RuleNoConfig | [AllowWarnDeny, RequireParamDescriptionConfig];
@@ -974,7 +985,7 @@ interface DummyRuleMap {
974
985
  "jsdoc/require-yields-type"?: RuleNoConfig;
975
986
  "jsx-a11y/alt-text"?: RuleNoConfig | [AllowWarnDeny, AltTextConfigSchema];
976
987
  "jsx-a11y/anchor-ambiguous-text"?: RuleNoConfig | [AllowWarnDeny, AnchorAmbiguousTextConfig];
977
- "jsx-a11y/anchor-has-content"?: RuleNoConfig;
988
+ "jsx-a11y/anchor-has-content"?: RuleNoConfig | [AllowWarnDeny, AnchorHasContentConfig];
978
989
  "jsx-a11y/anchor-is-valid"?: RuleNoConfig | [AllowWarnDeny, AnchorIsValidConfig];
979
990
  "jsx-a11y/aria-activedescendant-has-tabindex"?: RuleNoConfig;
980
991
  "jsx-a11y/aria-props"?: RuleNoConfig;
@@ -1160,7 +1171,7 @@ interface DummyRuleMap {
1160
1171
  "no-useless-return"?: RuleNoConfig;
1161
1172
  "no-var"?: RuleNoConfig;
1162
1173
  "no-void"?: RuleNoConfig | [AllowWarnDeny, NoVoid];
1163
- "no-warning-comments"?: RuleNoConfig | [AllowWarnDeny, NoWarningCommentsConfigJson];
1174
+ "no-warning-comments"?: RuleNoConfig | [AllowWarnDeny, NoWarningCommentsConfig];
1164
1175
  "no-with"?: RuleNoConfig;
1165
1176
  "node/callback-return"?: RuleNoConfig | [AllowWarnDeny, CallbackReturn];
1166
1177
  "node/exports-style"?: RuleNoConfig | [AllowWarnDeny, ExportsStyleMode] | [AllowWarnDeny, ExportsStyleMode, ExportsStyleOptions];
@@ -1174,6 +1185,7 @@ interface DummyRuleMap {
1174
1185
  "node/no-sync"?: RuleNoConfig | [AllowWarnDeny, NoSyncConfig];
1175
1186
  "node/no-top-level-await"?: RuleNoConfig | [AllowWarnDeny, NoTopLevelAwaitConfig];
1176
1187
  "object-shorthand"?: RuleNoConfig | [AllowWarnDeny, ShorthandType] | [AllowWarnDeny, ShorthandType, ObjectShorthandOptions];
1188
+ "one-var"?: RuleNoConfig | [AllowWarnDeny, OneVar];
1177
1189
  "operator-assignment"?: RuleNoConfig | [AllowWarnDeny, AlwaysNever];
1178
1190
  "oxc/approx-constant"?: RuleNoConfig;
1179
1191
  "oxc/bad-array-method-on-arguments"?: RuleNoConfig;
@@ -2470,6 +2482,12 @@ interface EmptyTagsConfig {
2470
2482
  */
2471
2483
  tags?: string[];
2472
2484
  }
2485
+ interface NoBlankBlocks {
2486
+ /**
2487
+ * Whether to automatically remove blank JSDoc blocks.
2488
+ */
2489
+ enableFixer?: boolean;
2490
+ }
2473
2491
  interface NoDefaultsConfig {
2474
2492
  /**
2475
2493
  * If true, report the presence of optional param names (square brackets) on `@param` tags.
@@ -2612,6 +2630,12 @@ interface AnchorAmbiguousTextConfig {
2612
2630
  */
2613
2631
  words?: string[];
2614
2632
  }
2633
+ interface AnchorHasContentConfig {
2634
+ /**
2635
+ * Additional custom component names to treat as anchor elements.
2636
+ */
2637
+ components?: string[];
2638
+ }
2615
2639
  interface AnchorIsValidConfig {
2616
2640
  /**
2617
2641
  * Sub-rule aspects to run.
@@ -4069,9 +4093,20 @@ interface NoVoid {
4069
4093
  */
4070
4094
  allowAsStatement?: boolean;
4071
4095
  }
4072
- interface NoWarningCommentsConfigJson {
4096
+ interface NoWarningCommentsConfig {
4097
+ /**
4098
+ * An array of characters to ignore at the start of comments when `location` is `"start"`.
4099
+ *
4100
+ * Useful for ignoring common comment decorations like `*` in JSDoc-style comments.
4101
+ */
4073
4102
  decoration?: string[];
4103
+ /**
4104
+ * Where to check for the terms.
4105
+ */
4074
4106
  location?: Location;
4107
+ /**
4108
+ * An array of terms to match. The matching is case-insensitive.
4109
+ */
4075
4110
  terms?: string[];
4076
4111
  }
4077
4112
  interface ExportsStyleOptions {
@@ -4114,6 +4149,46 @@ interface ObjectShorthandOptions {
4114
4149
  ignoreConstructors?: boolean;
4115
4150
  methodsIgnorePattern?: string;
4116
4151
  }
4152
+ /**
4153
+ * Options for configuring declaration grouping by kind or initialization state.
4154
+ *
4155
+ * `initialized` and `uninitialized` take precedence over the per-kind option for the
4156
+ * corresponding declarators.
4157
+ */
4158
+ interface OneVarOptions {
4159
+ /**
4160
+ * Controls grouping for `await using` declarations.
4161
+ */
4162
+ awaitUsing?: OneVarMode;
4163
+ /**
4164
+ * Controls grouping for `const` declarations.
4165
+ */
4166
+ const?: OneVarMode;
4167
+ /**
4168
+ * Controls grouping for initialized declarators, overriding per-kind options.
4169
+ */
4170
+ initialized?: OneVarMode;
4171
+ /**
4172
+ * Controls grouping for `let` declarations.
4173
+ */
4174
+ let?: OneVarMode;
4175
+ /**
4176
+ * Keeps direct `require(...)` initializers separate from other initialized declarations.
4177
+ */
4178
+ separateRequires?: boolean;
4179
+ /**
4180
+ * Controls grouping for uninitialized declarators, overriding per-kind options.
4181
+ */
4182
+ uninitialized?: OneVarMode;
4183
+ /**
4184
+ * Controls grouping for `using` declarations.
4185
+ */
4186
+ using?: OneVarMode;
4187
+ /**
4188
+ * Controls grouping for `var` declarations.
4189
+ */
4190
+ var?: OneVarMode;
4191
+ }
4117
4192
  interface NoAsyncEndpointHandlersConfig {
4118
4193
  /**
4119
4194
  * An array of names that are allowed to be async.
@@ -5110,6 +5185,9 @@ interface BanTsCommentConfig {
5110
5185
  */
5111
5186
  "ts-nocheck"?: DirectiveConfigSchema;
5112
5187
  }
5188
+ interface DescriptionFormatConfig {
5189
+ descriptionFormat?: string;
5190
+ }
5113
5191
  interface ConsistentReturnConfig {
5114
5192
  /**
5115
5193
  * Treat explicit `return undefined` as equivalent to an unspecified return.
@@ -5662,12 +5740,30 @@ interface NoUnnecessaryBooleanLiteralCompareConfig {
5662
5740
  }
5663
5741
  interface NoUnnecessaryConditionConfig {
5664
5742
  /**
5665
- * Whether to allow constant loop conditions.
5666
- * `true` is treated as `"always"`, `false` as `"never"`.
5743
+ * Controls which constant conditions are allowed in `while`, `do...while`, and `for` loops.
5744
+ *
5745
+ * - `"never"` (or `false`) reports all constant loop conditions.
5746
+ * - `"always"` (or `true`) allows conditions whose type is the literal type `true`, such as
5747
+ * `while (true)` or `while (variable)` when `variable` has type `true`.
5748
+ * - `"only-allowed-literals"` allows only the literal expressions `true`, `false`, `0`, and
5749
+ * `1`. Variables whose types are those literal types are still reported.
5667
5750
  */
5668
5751
  allowConstantLoopConditions?: AllowConstantLoopConditions;
5669
5752
  /**
5670
- * Whether to check type predicate functions.
5753
+ * Whether to check arguments passed to type predicate and assertion functions.
5754
+ *
5755
+ * When enabled, the rule reports a call if the argument already satisfies the predicate or
5756
+ * if an assertion function receives an argument that is always truthy or always falsy.
5757
+ *
5758
+ * For example, `narrow(value)` is unnecessary because `value` already has type `true`:
5759
+ *
5760
+ * ```ts
5761
+ * declare const narrow: (value: unknown) => value is true;
5762
+ * const value = true;
5763
+ * if (narrow(value)) {
5764
+ * // ...
5765
+ * }
5766
+ * ```
5671
5767
  */
5672
5768
  checkTypePredicates?: boolean;
5673
5769
  }
@@ -1,2 +1,2 @@
1
- import { t as main } from "../src-CMaVigSj.mjs";
1
+ import { t as main } from "../src-Bn5kidka.mjs";
2
2
  export { main as default };
@@ -434,6 +434,7 @@ const pedanticRules = [
434
434
  "no-throw-literal",
435
435
  "no-useless-return",
436
436
  "no-warning-comments",
437
+ "prefer-promise-reject-errors",
437
438
  "radix",
438
439
  "require-await",
439
440
  "require-unicode-regexp",
@@ -572,6 +573,7 @@ const styleRules = [
572
573
  "no-ternary",
573
574
  "no-useless-computed-key",
574
575
  "object-shorthand",
576
+ "one-var",
575
577
  "operator-assignment",
576
578
  "prefer-arrow-callback",
577
579
  "prefer-const",
@@ -581,7 +583,6 @@ const styleRules = [
581
583
  "prefer-numeric-literals",
582
584
  "prefer-object-has-own",
583
585
  "prefer-object-spread",
584
- "prefer-promise-reject-errors",
585
586
  "prefer-regex-literals",
586
587
  "prefer-rest-params",
587
588
  "prefer-spread",
@@ -649,6 +650,7 @@ const styleRules = [
649
650
  "jest/prefer-todo",
650
651
  "jest/require-hook",
651
652
  "jest/require-top-level-describe",
653
+ "jsdoc/no-blank-blocks",
652
654
  "jsdoc/require-throws-description",
653
655
  "jsdoc/require-yields-description",
654
656
  "node/callback-return",
@@ -1334,6 +1336,8 @@ var unsupportedRules = {
1334
1336
  "unicorn/no-nonstandard-builtin-properties": "No need to implement, TypeScript type checking reports non-standard properties and invalid calls or constructions on built-ins.",
1335
1337
  "unicorn/no-boolean-sort-comparator": "No need to implement, TypeScript type checking requires array sort comparators to return numbers.",
1336
1338
  "unicorn/no-invalid-argument-count": "No need to implement, TypeScript type checking reports invalid argument counts for functions, constructors, and built-in APIs.",
1339
+ "unicorn/no-unsafe-promise-all-settled-values": "No need to implement, TypeScript type checking reports accessing `value` on `Promise.allSettled()` results that have not been narrowed to the fulfilled variant.",
1340
+ "unicorn/no-undeclared-class-members": "No need to implement, TypeScript type checking reports accesses to undeclared class members.",
1337
1341
  "unicorn/no-useless-template-literals": "No need to implement. `typescript/no-unnecessary-template-expression` covers static and already-string expressions, while `eslint/no-implicit-coercion` with `disallowTemplateShorthand` covers expression-only string coercions.",
1338
1342
  "unicorn/prefer-explicit-viewport-units": "Not currently possible, as full support requires parsing standalone CSS files.",
1339
1343
  "unicorn/require-frontmatter-fields": "Not currently possible, as it requires parsing YAML frontmatter in Markdown files.",
@@ -1347,7 +1351,10 @@ var unsupportedRules = {
1347
1351
  "unicorn/no-misrefactored-assignment": "No need to implement, already covered by `oxc/misrefactored-assign-op`.",
1348
1352
  "unicorn/no-constant-zero-expression": "No need to implement, already covered by `oxc/erasing-op`.",
1349
1353
  "unicorn/prefer-math-constants": "No need to implement, already covered by `oxc/approx-constant`.",
1354
+ "unicorn/no-invalid-character-comparison": "No need to implement, already covered by `oxc/bad-char-at-comparison`.",
1350
1355
  "unicorn/require-array-sort-compare": "No need to implement, already implemented by `typescript/require-array-sort-compare` via tsgolint.",
1356
+ "unicorn/no-barrel-files": "No need to implement separately; similar functionality is available via `oxc/no-barrel-file`",
1357
+ "unicorn/no-useless-concat": "No need to implement separately; `eslint/no-useless-concat` already covers the diagnostics and will implement the suggestion fixer.",
1351
1358
  "eslint/no-negated-in-lhs": "Replaced by `eslint/no-unsafe-negation`, which we support.",
1352
1359
  "eslint/no-catch-shadow": "Replaced by `eslint/no-shadow`.",
1353
1360
  "eslint/id-blacklist": "Replaced by `eslint/id-denylist`.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxlint/migrate",
3
- "version": "1.76.0",
3
+ "version": "1.78.0",
4
4
  "description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -73,7 +73,7 @@
73
73
  "lint-staged": "^17.0.0",
74
74
  "next": "^16.0.0",
75
75
  "oxfmt": "^0.58.0",
76
- "oxlint": "^1.76.0",
76
+ "oxlint": "^1.78.0",
77
77
  "oxlint-tsgolint": "^0.24.0",
78
78
  "tsdown": "^0.22.0",
79
79
  "typescript": "^6.0.0",