biome-to-oxc 3.7.0 → 3.7.1

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
@@ -337,10 +337,12 @@ report exactly what the Biome rule reports; `unicorn/prefer-string-starts-ends-w
337
337
  Biome flags, so that substitution is reported as a semantic loss.
338
338
 
339
339
  Every other Biome rule that maps only to a type-aware Oxlint rule — `noFloatingPromises`,
340
- `noMisusedPromises`, `useOptionalChain`, `useLiteralKeys` and the rest — has no non-type-aware
341
- Oxlint counterpart. Oxlint skips type-aware rules unless type-aware linting is on, so a migration
342
- without `--type-aware` reports each of them as a semantic loss instead of emitting a rule that
343
- never runs.
340
+ `noMisusedPromises`, `useOptionalChain`, `noUnnecessaryConditions` and the rest — has no
341
+ non-type-aware Oxlint counterpart. Oxlint skips type-aware rules unless type-aware linting is on,
342
+ so a migration without `--type-aware` reports each of them as a semantic loss instead of emitting
343
+ a rule that never runs. `useLiteralKeys` maps to two rules: `typescript/dot-notation` for
344
+ `a["b"]` member access, which is type-aware and reported the same way, and
345
+ `no-useless-computed-key` for `{ ["b"]: 1 }` keys, which runs either way.
344
346
 
345
347
  ### Assist Actions
346
348
 
@@ -9,4 +9,5 @@ interface CliRuntimeOptions {
9
9
  }
10
10
  export declare function runCli(argv: string[], runtimeOptions?: CliRuntimeOptions): Promise<number>;
11
11
  export declare function createTerminationHandler(signalName: NodeJS.Signals, controller: AbortController, stderr: CliWriteStream): () => void;
12
- //#endregion
12
+ //#endregion
13
+ export {};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { i as readJsonFile, n as DefaultReporter, r as findClosestPackageJson, t as migrate } from "../src-JKoQYJ0f.mjs";
2
+ import { i as readJsonFile, n as DefaultReporter, r as findClosestPackageJson, t as migrate } from "../src-DgeCWlW4.mjs";
3
3
  import { realpath } from "node:fs/promises";
4
4
  import { dirname } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -1,2 +1 @@
1
- import { t as migrate } from "../src-JKoQYJ0f.mjs";
2
- export { migrate };
1
+ export { t as migrate } from "../src-DgeCWlW4.mjs";
@@ -1694,13 +1694,16 @@ const PARTIAL_RULE_MAPPING_NOTES = {
1694
1694
  noBarrelFile: "Biome rule noBarrelFile was mapped to oxc/no-barrel-file, which only counts `export *` re-exports and reports a file once it re-exports more modules than its threshold (100 by default); Biome reports any file that re-exports, including through named `export { ... } from`.",
1695
1695
  noExcessiveCognitiveComplexity: "Biome rule noExcessiveCognitiveComplexity was mapped to complexity, which scores cyclomatic complexity rather than cognitive complexity; the threshold carries over, but the two scores differ, so a different set of functions is reported.",
1696
1696
  noMeaninglessVoidOperator: "Biome rule noMeaninglessVoidOperator was mapped to typescript/no-meaningless-void-operator, which reports `void` applied to a value whose type is `void` or `undefined` but not `void` applied to any other non-call operand, such as `void 1` or `void value`.",
1697
+ noInvalidBuiltinInstantiation: "Biome rule noInvalidBuiltinInstantiation was mapped to no-new-native-nonconstructor, which reports `new BigInt()` and `new Symbol()` but not constructors that require `new` called without it, such as `Map()`, `Set()`, `Promise()`, `WeakMap()`, `Proxy()` or a typed array; unicorn/new-for-builtins reports those, together with the calls useConsistentBuiltinInstantiation reports.",
1697
1698
  noInlineStyles: "Biome rule noInlineStyles was mapped to react/forbid-dom-props, which reports the `style` prop on JSX DOM elements but not `style` passed through React.createElement() or written in HTML, Vue, Svelte or Astro templates.",
1699
+ noStaticOnlyClass: "Biome rule noStaticOnlyClass was mapped to typescript/no-extraneous-class, which reports classes with only static members but not a class whose only member is a static initialization block.",
1698
1700
  noSelfImport: "Biome rule noSelfImport was mapped to import/no-self-import, which reports static `import` and `export ... from` statements that resolve to their own file but not `require()` calls or dynamic `import()` expressions that do.",
1699
1701
  noReactObjectTypeAsDefaultProp: "Biome rule noReactObjectTypeAsDefaultProp was mapped to react/no-object-type-as-default-prop, which reports array, object, function, class, regex, `new` and JSX default prop values but not a `Symbol()` default.",
1700
1702
  noReactPropAssignments: "Biome rule noReactPropAssignments was mapped to the React Compiler rule react/immutability, which reports prop mutation alongside other mutations of values React treats as immutable.",
1701
1703
  noUnresolvedImports: "Biome rule noUnresolvedImports was mapped to import/named, which reports named imports a JavaScript module does not export but skips TypeScript files entirely and does not report import paths that cannot be resolved.",
1702
1704
  noUnsafeIframeSandbox: "Biome rule noUnsafeIframeSandbox was mapped to react/iframe-missing-sandbox, which reports `allow-scripts` combined with `allow-same-origin` only when the sandbox value is a plain string attribute, not a `{\"...\"}` or template-literal expression; it also reports iframes with no or an invalid sandbox attribute, which Biome leaves to useIframeSandbox.",
1703
1705
  useConsistentCurlyBraces: "Biome rule useConsistentCurlyBraces was mapped to react/jsx-curly-brace-presence, which reports unnecessary braces around string literals in JSX props and children but not a JSX element passed as a prop value without braces (`foo=<Bar />`).",
1706
+ useConsistentBuiltinInstantiation: "Biome rule useConsistentBuiltinInstantiation was mapped to unicorn/new-for-builtins, which does not report `AggregateError()`, `EvalError()`, `RangeError()`, `ReferenceError()`, `SyntaxError()`, `TypeError()` or `URIError()` called without `new`.",
1704
1707
  useArrowFunction: "Biome rule useArrowFunction was mapped to prefer-arrow-callback, which reports function expressions passed as callbacks but not ones assigned to variables or properties, such as `const f = function () {}`.",
1705
1708
  useExplicitType: "Biome rule useExplicitType was mapped to typescript/explicit-function-return-type, which requires return types on functions and methods but not types on variables or parameters.",
1706
1709
  noUselessSwitchCase: "Biome rule noUselessSwitchCase was mapped to unicorn/no-useless-switch-case, which reports a case that falls through into a trailing `default` but not one next to a `default` placed earlier in the switch.",
@@ -1901,7 +1904,7 @@ const BIOME_TO_OXLINT_RULE_MAP = {
1901
1904
  noInferrableTypes: "typescript/no-inferrable-types",
1902
1905
  noInvalidBuiltinInstantiation: "no-new-native-nonconstructor",
1903
1906
  noInvalidUseBeforeDeclaration: "no-use-before-define",
1904
- noInvalidConstructorSuper: "no-this-before-super",
1907
+ noInvalidConstructorSuper: "constructor-super",
1905
1908
  noIrregularWhitespace: "no-irregular-whitespace",
1906
1909
  noInteractiveElementToNoninteractiveRole: "jsx-a11y/no-interactive-element-to-noninteractive-role",
1907
1910
  noInvalidNewBuiltin: "no-new-native-nonconstructor",
@@ -1944,7 +1947,7 @@ const BIOME_TO_OXLINT_RULE_MAP = {
1944
1947
  noPositiveTabindex: "jsx-a11y/tabindex-no-positive",
1945
1948
  noProcessEnv: "node/no-process-env",
1946
1949
  noProto: "no-proto",
1947
- noPrototypeBuiltins: "no-prototype-builtins",
1950
+ noPrototypeBuiltins: ["no-prototype-builtins", "prefer-object-has-own"],
1948
1951
  noRedeclare: "no-redeclare",
1949
1952
  noReactObjectTypeAsDefaultProp: "react/no-object-type-as-default-prop",
1950
1953
  noReactPropAssignments: "react/immutability",
@@ -1973,7 +1976,7 @@ const BIOME_TO_OXLINT_RULE_MAP = {
1973
1976
  noShadowRestrictedNames: "no-shadow-restricted-names",
1974
1977
  noSkippedTests: ["jest/no-disabled-tests", "vitest/no-disabled-tests"],
1975
1978
  noSparseArray: "no-sparse-arrays",
1976
- noStaticOnlyClass: "unicorn/no-static-only-class",
1979
+ noStaticOnlyClass: "typescript/no-extraneous-class",
1977
1980
  noSyncScripts: "nextjs/no-sync-scripts",
1978
1981
  noSwitchDeclarations: "no-case-declarations",
1979
1982
  noStaticElementInteractions: "jsx-a11y/no-static-element-interactions",
@@ -1992,7 +1995,7 @@ const BIOME_TO_OXLINT_RULE_MAP = {
1992
1995
  noUnnecessaryConditions: "typescript/no-unnecessary-condition",
1993
1996
  noUnnecessaryTemplateExpression: "typescript/no-unnecessary-template-expression",
1994
1997
  noUnreachable: "no-unreachable",
1995
- noUnreachableSuper: "constructor-super",
1998
+ noUnreachableSuper: ["constructor-super", "no-this-before-super"],
1996
1999
  noUnresolvedImports: "import/named",
1997
2000
  noUnsafeDeclarationMerging: "typescript/no-unsafe-declaration-merging",
1998
2001
  noUnsafeTypeAssertion: "typescript/no-unsafe-type-assertion",
@@ -2061,7 +2064,7 @@ const BIOME_TO_OXLINT_RULE_MAP = {
2061
2064
  useCollapsedIf: "unicorn/no-lonely-if",
2062
2065
  useConsistentArrayType: "typescript/array-type",
2063
2066
  useConsistentArrowReturn: "arrow-body-style",
2064
- useConsistentBuiltinInstantiation: "no-new-wrappers",
2067
+ useConsistentBuiltinInstantiation: "unicorn/new-for-builtins",
2065
2068
  useConsistentCurlyBraces: "react/jsx-curly-brace-presence",
2066
2069
  useConsistentEnumValueType: "typescript/no-mixed-enums",
2067
2070
  useConsistentFunctionStyle: "func-style",
@@ -2121,7 +2124,7 @@ const BIOME_TO_OXLINT_RULE_MAP = {
2121
2124
  useKeyWithClickEvents: "jsx-a11y/click-events-have-key-events",
2122
2125
  useKeyWithMouseEvents: "jsx-a11y/mouse-events-have-key-events",
2123
2126
  useLiteralEnumMembers: "typescript/prefer-literal-enum-member",
2124
- useLiteralKeys: "typescript/dot-notation",
2127
+ useLiteralKeys: ["typescript/dot-notation", "no-useless-computed-key"],
2125
2128
  useMathMinMax: "unicorn/prefer-math-min-max",
2126
2129
  useMaxParams: "max-params",
2127
2130
  useMediaCaption: "jsx-a11y/media-has-caption",
@@ -2246,6 +2249,10 @@ function mapBiomeRuleOptionsToOxlintSeverity(biomeName, severity, biomeSeverity,
2246
2249
  return [severity, { accessibility: "no-public" }];
2247
2250
  }
2248
2251
  if (biomeName === "noImplicitBoolean") return [severity, "always"];
2252
+ if (biomeName === "noStaticOnlyClass") return [severity, {
2253
+ allowConstructorOnly: true,
2254
+ allowEmpty: true
2255
+ }];
2249
2256
  if (biomeName === "noInlineStyles") return [severity, { forbid: ["style"] }];
2250
2257
  if (biomeName === "useImportExtensions") {
2251
2258
  if (options?.extensionMappings !== void 0 || options?.forceJsExtensions !== void 0) reporter.loss("Biome rule useImportExtensions options \"extensionMappings\" and \"forceJsExtensions\" are not supported by Oxlint import/extensions; the rule requires an extension without rewriting it.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biome-to-oxc",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "Migrate from Biome to Oxc ecosystem (oxlint + oxfmt + oxlint-tsgolint)",
5
5
  "keywords": [
6
6
  "biome",
@@ -54,18 +54,18 @@
54
54
  "commander": "15.0.0",
55
55
  "jsonc-parser": "next",
56
56
  "picocolors": "^1.1.1",
57
- "zod": "^4.6.5"
57
+ "zod": "^4.6.6"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@arethetypeswrong/core": "^0.18.5",
61
61
  "@biomejs/biome": "^2.5.15",
62
- "@types/node": "^26.6.4",
62
+ "@types/node": "^26.6.5",
63
63
  "@vitest/coverage-v8": "^5.0.3",
64
64
  "oxfmt": "^0.72.0",
65
65
  "oxlint": "^1.87.0",
66
- "oxlint-tsgolint": "^7.0.2003",
66
+ "oxlint-tsgolint": "^7.0.2004",
67
67
  "publint": "^0.3.25",
68
- "tsdown": "0.23.0",
68
+ "tsdown": "0.23.1",
69
69
  "typescript": "next",
70
70
  "vitest": "^5.0.3"
71
71
  },