@oxlint/migrate 1.72.0 → 1.73.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
@@ -115,3 +115,11 @@ Depending on how this is implemented by the given config, these behaviors may no
115
115
  The JS Plugins API supports almost all ESLint v9+ plugins for linting JS/TS/JSX/TSX files, but there are still some minor holes in support. See the [JS Plugins documentation](https://oxc.rs/docs/guide/usage/linter/js-plugins.html) for specifics.
116
116
 
117
117
  For example, if you currently use `eslint-plugin-svelte`, only some of its rules will work via JS Plugin, as Oxlint does not yet fully support custom file formats like `.svelte`. This means that Oxlint will only be able to lint the script blocks in your `.svelte` files, and not the template blocks where many of the `eslint-plugin-svelte` rules apply.
118
+
119
+ ## ❤ Who's [Sponsoring Oxc](https://github.com/sponsors/Boshen)?
120
+
121
+ <p align="center">
122
+ <a href="https://github.com/sponsors/Boshen">
123
+ <img src="https://raw.githubusercontent.com/Boshen/sponsors/main/sponsors.svg" alt="Our sponsors" />
124
+ </a>
125
+ </p>
@@ -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-CLLHiI8g.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-aj7n0D2s.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.72.0";
33
+ var version = "1.73.0";
34
34
  //#endregion
35
35
  //#region src/walker/comments/replaceRuleDirectiveComment.ts
36
36
  const allRulesSet = new Set(Object.values(rules_exports).flat());
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * What to enforce for `/// <reference types="..." />` references.
6
6
  */
7
- //#region node_modules/.pnpm/oxlint@1.72.0_oxlint-tsgolint@0.23.0/node_modules/oxlint/dist/index.d.ts
7
+ //#region node_modules/.pnpm/oxlint@1.73.0_oxlint-tsgolint@0.24.0/node_modules/oxlint/dist/index.d.ts
8
8
  //#region src-js/package/config.generated.d.ts
9
9
  type AllowWarnDeny = ("allow" | "off" | "warn" | "error" | "deny") | number;
10
10
  type GlobalValue = ("readonly" | "writable" | "off") | undefined;
@@ -124,6 +124,7 @@ type NoReturnAssignMode = "always" | "except-parens";
124
124
  * Controls how hoisting is handled when checking for shadowing.
125
125
  */
126
126
  type HoistOption = "all" | "functions" | "functions-and-types" | "never" | "types";
127
+ type LoopType = "WhileStatement" | "DoWhileStatement" | "ForStatement" | "ForInStatement" | "ForOfStatement";
127
128
  type NoUnusedVarsConfig = VarsOption | NoUnusedVarsOptions;
128
129
  type VarsOption = "all" | "local";
129
130
  type ArgsOption = "after-used" | "all" | "none";
@@ -296,6 +297,7 @@ type PathOption = "always" | "never";
296
297
  type TypesOption = "always" | "never" | "prefer-import";
297
298
  type BomOptionType = "always" | "never";
298
299
  type NonZero = "greater-than" | "not-equal";
300
+ type ExplicitTimerDelayMode = "always" | "never";
299
301
  type ModuleStylesOverride = (false | {
300
302
  /**
301
303
  * Whether default imports or whole-module `require()` assignments are allowed for this module.
@@ -1016,7 +1018,7 @@ interface DummyRuleMap {
1016
1018
  "no-cond-assign"?: RuleNoConfig | [AllowWarnDeny, NoCondAssignConfig];
1017
1019
  "no-console"?: RuleNoConfig | [AllowWarnDeny, NoConsoleConfig];
1018
1020
  "no-const-assign"?: RuleNoConfig;
1019
- "no-constant-binary-expression"?: RuleNoConfig;
1021
+ "no-constant-binary-expression"?: RuleNoConfig | [AllowWarnDeny, NoConstantBinaryExpressionConfig];
1020
1022
  "no-constant-condition"?: RuleNoConfig | [AllowWarnDeny, NoConstantCondition];
1021
1023
  "no-constructor-return"?: RuleNoConfig;
1022
1024
  "no-continue"?: RuleNoConfig;
@@ -1105,6 +1107,7 @@ interface DummyRuleMap {
1105
1107
  "no-unmodified-loop-condition"?: RuleNoConfig;
1106
1108
  "no-unneeded-ternary"?: RuleNoConfig | [AllowWarnDeny, NoUnneededTernary];
1107
1109
  "no-unreachable"?: RuleNoConfig;
1110
+ "no-unreachable-loop"?: RuleNoConfig | [AllowWarnDeny, NoUnreachableLoopConfig];
1108
1111
  "no-unsafe-finally"?: RuleNoConfig;
1109
1112
  "no-unsafe-negation"?: RuleNoConfig | [AllowWarnDeny, NoUnsafeNegation];
1110
1113
  "no-unsafe-optional-chaining"?: RuleNoConfig | [AllowWarnDeny, NoUnsafeOptionalChaining];
@@ -1392,6 +1395,7 @@ interface DummyRuleMap {
1392
1395
  "unicorn/error-message"?: RuleNoConfig;
1393
1396
  "unicorn/escape-case"?: RuleNoConfig;
1394
1397
  "unicorn/explicit-length-check"?: RuleNoConfig | [AllowWarnDeny, ExplicitLengthCheck];
1398
+ "unicorn/explicit-timer-delay"?: RuleNoConfig | [AllowWarnDeny, ExplicitTimerDelayMode];
1395
1399
  "unicorn/filename-case"?: DummyRule;
1396
1400
  "unicorn/import-style"?: RuleNoConfig | [AllowWarnDeny, ImportStyleConfig];
1397
1401
  "unicorn/max-nested-calls"?: RuleNoConfig | [AllowWarnDeny, MaxNestedCalls];
@@ -1408,6 +1412,7 @@ interface DummyRuleMap {
1408
1412
  "unicorn/no-array-sort"?: RuleNoConfig | [AllowWarnDeny, NoArraySort];
1409
1413
  "unicorn/no-await-expression-member"?: RuleNoConfig;
1410
1414
  "unicorn/no-await-in-promise-methods"?: RuleNoConfig;
1415
+ "unicorn/no-confusing-array-with"?: RuleNoConfig;
1411
1416
  "unicorn/no-console-spaces"?: RuleNoConfig;
1412
1417
  "unicorn/no-document-cookie"?: RuleNoConfig;
1413
1418
  "unicorn/no-empty-file"?: RuleNoConfig;
@@ -2269,6 +2274,7 @@ interface PreferEndingWithAnExpectConfig {
2269
2274
  additionalTestBlockFunctions?: string[];
2270
2275
  /**
2271
2276
  * A list of function names that should be treated as assertion functions.
2277
+ * Default: `["expect"]`
2272
2278
  */
2273
2279
  assertFunctionNames?: string[];
2274
2280
  }
@@ -2793,6 +2799,9 @@ interface NoConsoleConfig {
2793
2799
  */
2794
2800
  allow?: string[];
2795
2801
  }
2802
+ interface NoConstantBinaryExpressionConfig {
2803
+ checkRelationalComparisons?: boolean;
2804
+ }
2796
2805
  interface NoConstantCondition {
2797
2806
  /**
2798
2807
  * Configuration option to specify whether to check for constant conditions in loops.
@@ -3469,6 +3478,9 @@ interface NoUnneededTernary {
3469
3478
  */
3470
3479
  defaultAssignment?: boolean;
3471
3480
  }
3481
+ interface NoUnreachableLoopConfig {
3482
+ ignore?: LoopType[];
3483
+ }
3472
3484
  interface NoUnsafeNegation {
3473
3485
  /**
3474
3486
  * The `enforceForOrderingRelations` option determines whether negation is allowed
@@ -4253,20 +4265,20 @@ interface ForbidItemObject {
4253
4265
  * Component names for which this prop is **allowed** (all others are
4254
4266
  * forbidden).
4255
4267
  */
4256
- allowedFor: string[];
4268
+ allowedFor?: string[];
4257
4269
  /**
4258
4270
  * Glob patterns for component names where the prop is **allowed**.
4259
4271
  */
4260
- allowedForPatterns: string[];
4272
+ allowedForPatterns?: string[];
4261
4273
  /**
4262
4274
  * Component names for which this prop is **disallowed** (all others are
4263
4275
  * allowed).
4264
4276
  */
4265
- disallowedFor: string[];
4277
+ disallowedFor?: string[];
4266
4278
  /**
4267
4279
  * Glob patterns for component names where the prop is **disallowed**.
4268
4280
  */
4269
- disallowedForPatterns: string[];
4281
+ disallowedForPatterns?: string[];
4270
4282
  /**
4271
4283
  * Custom message to display.
4272
4284
  */
@@ -4288,7 +4300,7 @@ interface ForbidDomPropsConfig {
4288
4300
  * An array of prop names or objects that are forbidden on DOM elements.
4289
4301
  *
4290
4302
  * Each array element can be a string with the property name, or an object
4291
- * with `propName`, an optional `disallowedFor` array of DOM node names,
4303
+ * with `propName`, optional `disallowedFor` and `disallowedValues` arrays,
4292
4304
  * and an optional custom `message`.
4293
4305
  *
4294
4306
  * Examples:
@@ -4296,11 +4308,13 @@ interface ForbidDomPropsConfig {
4296
4308
  * - `["error", { "forbid": ["id", "style"] }]`
4297
4309
  * - `["error", { "forbid": [{ "propName": "className", "message": "Use class instead" }] }]`
4298
4310
  * - `["error", { "forbid": [{ "propName": "style", "disallowedFor": ["div", "span"] }] }]`
4311
+ * - `["error", { "forbid": [{ "propName": "type", "disallowedValues": ["button"] }] }]`
4299
4312
  */
4300
4313
  forbid?: ForbidDomPropsItem[];
4301
4314
  }
4302
4315
  /**
4303
- * A prop with optional `disallowedFor` DOM node list and custom `message`.
4316
+ * A prop with optional `disallowedFor` DOM node list, optional `disallowedValues`
4317
+ * value list, and custom `message`.
4304
4318
  */
4305
4319
  interface PropWithOptions {
4306
4320
  /**
@@ -4309,6 +4323,11 @@ interface PropWithOptions {
4309
4323
  * DOM elements.
4310
4324
  */
4311
4325
  disallowedFor?: string[];
4326
+ /**
4327
+ * A list of string literal values for which this prop is forbidden. If
4328
+ * omitted, the prop is forbidden for all values.
4329
+ */
4330
+ disallowedValues?: string[];
4312
4331
  /**
4313
4332
  * A custom message to display when this prop is used.
4314
4333
  */
@@ -5960,6 +5979,16 @@ interface NoArrayReverse {
5960
5979
  allowExpressionStatement?: boolean;
5961
5980
  }
5962
5981
  interface NoArraySort {
5982
+ /**
5983
+ * When set to `true`, allows sorting a fresh array created by a spread, e.g. `[...iterable].sort()`.
5984
+ * This avoids the double allocation of `toSorted()` when sorting an iterable such as a `Set`.
5985
+ *
5986
+ * Example of **correct** code for this rule with `allowAfterSpread` set to `true`:
5987
+ * ```js
5988
+ * const sorted = [...mySet].sort();
5989
+ * ```
5990
+ */
5991
+ allowAfterSpread?: boolean;
5963
5992
  /**
5964
5993
  * When set to `true` (default), allows `array.sort()` as an expression statement.
5965
5994
  * Set to `false` to forbid `Array#sort()` even if it's an expression statement.
@@ -1,2 +1,2 @@
1
- import { t as main } from "../src-CLLHiI8g.mjs";
1
+ import { t as main } from "../src-aj7n0D2s.mjs";
2
2
  export { main as default };
@@ -706,6 +706,7 @@ const styleRules = [
706
706
  "unicorn/custom-error-definition",
707
707
  "unicorn/empty-brace-spaces",
708
708
  "unicorn/error-message",
709
+ "unicorn/explicit-timer-delay",
709
710
  "unicorn/filename-case",
710
711
  "unicorn/max-nested-calls",
711
712
  "unicorn/no-array-method-this-argument",
@@ -862,6 +863,7 @@ const suspiciousRules = [
862
863
  "unicorn/no-array-fill-with-reference-type",
863
864
  "unicorn/no-array-reverse",
864
865
  "unicorn/no-array-sort",
866
+ "unicorn/no-confusing-array-with",
865
867
  "unicorn/no-instanceof-builtins",
866
868
  "unicorn/prefer-add-event-listener",
867
869
  "unicorn/require-module-specifiers",
@@ -1238,6 +1240,7 @@ const perfRules = [
1238
1240
  const nurseryRules = [
1239
1241
  "no-restricted-exports",
1240
1242
  "no-undef",
1243
+ "no-unreachable-loop",
1241
1244
  "no-useless-assignment",
1242
1245
  "import/export",
1243
1246
  "import/named",
@@ -1351,6 +1354,15 @@ var unsupportedRules = {
1351
1354
  "import/no-deprecated": "No need to implement, already implemented by `typescript/no-deprecated` via tsgolint.",
1352
1355
  "n/no-restricted-import": "No need to implement, already implemented by `no-restricted-imports` rule.",
1353
1356
  "n/no-restricted-require": "No need to implement, already implemented by `no-restricted-imports` rule.",
1357
+ "n/prefer-global/buffer": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
1358
+ "n/prefer-global/console": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
1359
+ "n/prefer-global/crypto": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
1360
+ "n/prefer-global/process": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
1361
+ "n/prefer-global/text-decoder": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
1362
+ "n/prefer-global/text-encoder": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
1363
+ "n/prefer-global/timers": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
1364
+ "n/prefer-global/url": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
1365
+ "n/prefer-global/url-search-params": "No need to implement, the same policy can be enforced with generic restriction rules such as `no-restricted-imports` and `no-restricted-globals`.",
1354
1366
  "import/order": "Not implementing this in Oxlint as its behavior is covered very well by [Oxfmt's import sorting](https://oxc.rs/docs/guide/usage/formatter/sorting.html).",
1355
1367
  "unicorn/template-indent": "Stylistic rule.",
1356
1368
  "jsdoc/type-formatting": "Experimental rule in the original plugin, may reconsider once stable.",
@@ -1518,6 +1530,7 @@ var unsupportedRules = {
1518
1530
  "react/jsx-uses-vars": "Handled by `eslint/no-unused-vars`, which already evaluates whether vars are used in JSX.",
1519
1531
  "unicorn/no-named-default": "Implemented via `import/no-named-default`.",
1520
1532
  "unicorn/no-double-comparison": "Use `oxc/double-comparisons` instead.",
1533
+ "unicorn/no-chained-comparison": "Use `oxc/bad-comparison-sequence` instead. TypeScript also reports errors for these comparisons.",
1521
1534
  "vue/no-lone-template": "Not currently possible, as it requires Vue template parsing.",
1522
1535
  "vue/no-v-html": "Not currently possible, as it requires Vue template parsing.",
1523
1536
  "vue/this-in-template": "Not currently possible, as it requires Vue template parsing.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxlint/migrate",
3
- "version": "1.72.0",
3
+ "version": "1.73.0",
4
4
  "description": "Generates a `.oxlintrc.json` from a existing eslint flat config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -40,7 +40,7 @@
40
40
  "dependencies": {
41
41
  "commander": "^15.0.0",
42
42
  "globals": "^17.0.0",
43
- "oxc-parser": "^0.137.0",
43
+ "oxc-parser": "^0.138.0",
44
44
  "tinyglobby": "^0.2.14"
45
45
  },
46
46
  "devDependencies": {
@@ -83,9 +83,9 @@
83
83
  "husky": "^9.1.7",
84
84
  "lint-staged": "^17.0.0",
85
85
  "next": "^16.0.0",
86
- "oxfmt": "^0.55.0",
87
- "oxlint": "^1.72.0",
88
- "oxlint-tsgolint": "^0.23.0",
86
+ "oxfmt": "^0.57.0",
87
+ "oxlint": "^1.73.0",
88
+ "oxlint-tsgolint": "^0.24.0",
89
89
  "tsdown": "^0.22.0",
90
90
  "typescript": "^6.0.0",
91
91
  "typescript-eslint": "^8.35.0",
@@ -94,5 +94,5 @@
94
94
  "lint-staged": {
95
95
  "*": "oxfmt --no-error-on-unmatched-pattern"
96
96
  },
97
- "packageManager": "pnpm@11.8.0"
97
+ "packageManager": "pnpm@11.9.0"
98
98
  }