@oxlint/migrate 1.76.0 → 1.77.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-C1jP736q.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.77.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.77.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;
@@ -1160,7 +1160,7 @@ interface DummyRuleMap {
1160
1160
  "no-useless-return"?: RuleNoConfig;
1161
1161
  "no-var"?: RuleNoConfig;
1162
1162
  "no-void"?: RuleNoConfig | [AllowWarnDeny, NoVoid];
1163
- "no-warning-comments"?: RuleNoConfig | [AllowWarnDeny, NoWarningCommentsConfigJson];
1163
+ "no-warning-comments"?: RuleNoConfig | [AllowWarnDeny, NoWarningCommentsConfig];
1164
1164
  "no-with"?: RuleNoConfig;
1165
1165
  "node/callback-return"?: RuleNoConfig | [AllowWarnDeny, CallbackReturn];
1166
1166
  "node/exports-style"?: RuleNoConfig | [AllowWarnDeny, ExportsStyleMode] | [AllowWarnDeny, ExportsStyleMode, ExportsStyleOptions];
@@ -4069,9 +4069,20 @@ interface NoVoid {
4069
4069
  */
4070
4070
  allowAsStatement?: boolean;
4071
4071
  }
4072
- interface NoWarningCommentsConfigJson {
4072
+ interface NoWarningCommentsConfig {
4073
+ /**
4074
+ * An array of characters to ignore at the start of comments when `location` is `"start"`.
4075
+ *
4076
+ * Useful for ignoring common comment decorations like `*` in JSDoc-style comments.
4077
+ */
4073
4078
  decoration?: string[];
4079
+ /**
4080
+ * Where to check for the terms.
4081
+ */
4074
4082
  location?: Location;
4083
+ /**
4084
+ * An array of terms to match. The matching is case-insensitive.
4085
+ */
4075
4086
  terms?: string[];
4076
4087
  }
4077
4088
  interface ExportsStyleOptions {
@@ -5662,12 +5673,30 @@ interface NoUnnecessaryBooleanLiteralCompareConfig {
5662
5673
  }
5663
5674
  interface NoUnnecessaryConditionConfig {
5664
5675
  /**
5665
- * Whether to allow constant loop conditions.
5666
- * `true` is treated as `"always"`, `false` as `"never"`.
5676
+ * Controls which constant conditions are allowed in `while`, `do...while`, and `for` loops.
5677
+ *
5678
+ * - `"never"` (or `false`) reports all constant loop conditions.
5679
+ * - `"always"` (or `true`) allows conditions whose type is the literal type `true`, such as
5680
+ * `while (true)` or `while (variable)` when `variable` has type `true`.
5681
+ * - `"only-allowed-literals"` allows only the literal expressions `true`, `false`, `0`, and
5682
+ * `1`. Variables whose types are those literal types are still reported.
5667
5683
  */
5668
5684
  allowConstantLoopConditions?: AllowConstantLoopConditions;
5669
5685
  /**
5670
- * Whether to check type predicate functions.
5686
+ * Whether to check arguments passed to type predicate and assertion functions.
5687
+ *
5688
+ * When enabled, the rule reports a call if the argument already satisfies the predicate or
5689
+ * if an assertion function receives an argument that is always truthy or always falsy.
5690
+ *
5691
+ * For example, `narrow(value)` is unnecessary because `value` already has type `true`:
5692
+ *
5693
+ * ```ts
5694
+ * declare const narrow: (value: unknown) => value is true;
5695
+ * const value = true;
5696
+ * if (narrow(value)) {
5697
+ * // ...
5698
+ * }
5699
+ * ```
5671
5700
  */
5672
5701
  checkTypePredicates?: boolean;
5673
5702
  }
@@ -1,2 +1,2 @@
1
- import { t as main } from "../src-CMaVigSj.mjs";
1
+ import { t as main } from "../src-C1jP736q.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",
@@ -581,7 +582,6 @@ const styleRules = [
581
582
  "prefer-numeric-literals",
582
583
  "prefer-object-has-own",
583
584
  "prefer-object-spread",
584
- "prefer-promise-reject-errors",
585
585
  "prefer-regex-literals",
586
586
  "prefer-rest-params",
587
587
  "prefer-spread",
@@ -1334,6 +1334,8 @@ var unsupportedRules = {
1334
1334
  "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
1335
  "unicorn/no-boolean-sort-comparator": "No need to implement, TypeScript type checking requires array sort comparators to return numbers.",
1336
1336
  "unicorn/no-invalid-argument-count": "No need to implement, TypeScript type checking reports invalid argument counts for functions, constructors, and built-in APIs.",
1337
+ "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.",
1338
+ "unicorn/no-undeclared-class-members": "No need to implement, TypeScript type checking reports accesses to undeclared class members.",
1337
1339
  "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
1340
  "unicorn/prefer-explicit-viewport-units": "Not currently possible, as full support requires parsing standalone CSS files.",
1339
1341
  "unicorn/require-frontmatter-fields": "Not currently possible, as it requires parsing YAML frontmatter in Markdown files.",
@@ -1347,6 +1349,7 @@ var unsupportedRules = {
1347
1349
  "unicorn/no-misrefactored-assignment": "No need to implement, already covered by `oxc/misrefactored-assign-op`.",
1348
1350
  "unicorn/no-constant-zero-expression": "No need to implement, already covered by `oxc/erasing-op`.",
1349
1351
  "unicorn/prefer-math-constants": "No need to implement, already covered by `oxc/approx-constant`.",
1352
+ "unicorn/no-invalid-character-comparison": "No need to implement, already covered by `oxc/bad-char-at-comparison`.",
1350
1353
  "unicorn/require-array-sort-compare": "No need to implement, already implemented by `typescript/require-array-sort-compare` via tsgolint.",
1351
1354
  "eslint/no-negated-in-lhs": "Replaced by `eslint/no-unsafe-negation`, which we support.",
1352
1355
  "eslint/no-catch-shadow": "Replaced by `eslint/no-shadow`.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxlint/migrate",
3
- "version": "1.76.0",
3
+ "version": "1.77.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.77.0",
77
77
  "oxlint-tsgolint": "^0.24.0",
78
78
  "tsdown": "^0.22.0",
79
79
  "typescript": "^6.0.0",