Skip to content

chore: upgrade @biomejs/biome to 2.x - #1427

Open
dannyhw wants to merge 3 commits into
mainfrom
dannyhw/upgrade-biome-2
Open

chore: upgrade @biomejs/biome to 2.x#1427
dannyhw wants to merge 3 commits into
mainfrom
dannyhw/upgrade-biome-2

Conversation

@dannyhw

@dannyhw dannyhw commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Upgrades @biomejs/biome from 1.9.4 to 2.5.6.

Config migration

  • biome.jsonc migrated to the v2 schema via biome migrate --write, plus two manual fixes the migration doesn't handle:
    • the useImportExtensions override now uses "forceJsExtensions": true (the 1.x suggestedExtensions option was removed)
    • the old organizeImports ignore list is carried over as assist.includes (the migration silently drops it)
  • Excluded packages/repack/client/*.js and packages/repack/mf/*.js from biome — these are one-line ESM redirect stubs in a "type": "commonjs" package, and biome 2 now infers module type from package.json so it refuses to parse them as modules.
  • Disabled a11y/noSvgWithoutTitle for **/*.svg (biome 2 now lints raw SVG files; all hits were static image assets) and suspicious/noUnknownAtRules for **/*.css (tailwind at-rules).

Code changes

  • Auto-fixes: new import sort order (~45 files), @ts-ignore@ts-expect-error (22 sites).
  • useIterableCallbackReturn (newly recommended): reviewed all 15 hits individually — none were real bugs. forEach callbacks that implicitly returned a value got block bodies; a side-effect-only map in the rspack Compiler is now forEach; DevelopmentPlugin's map callback now returns undefined explicitly instead of mixing bare return; with value returns.
  • Removed 6 biome-ignore suppressions that v2 reports as unused (noParameterAssign/useNodejsImportProtocol were demoted from recommended; useConst/noUnusedImports analysis got smarter — the Federated jsdoc import is now recognized).
  • noUnusedPrivateClassMembers (newly recommended): fixed the write-only timer field in WebSocketServer by clearing the heartbeat interval in a fastify onClose hook (it previously kept the event loop alive after server close), and removed the unused config constructor property on JsonConsoleReporter; kept ModuleFederationPlugin.config/deepImports with suppressions since they're runtime-exposed for V1 plugin compat.
  • Replaced the two ?. + ! combos in babelSwcLoader: babelResult.code! (already dereferenced non-optionally on the line above), and ?? 'ecmascript' for the swc parser syntax (the loader always sets it, so no behavior change).

Test plan

  • pnpm lint:ci — clean
  • pnpm typecheck — 11/11 tasks pass
  • pnpm test — all green, including tester-app bundle/start integration tests

- migrate biome.jsonc to the v2 schema; replace the removed
  useImportExtensions 'suggestedExtensions' option with
  'forceJsExtensions', and carry the organizeImports ignore list
  over as assist.includes
- exclude the ESM redirect stubs in packages/repack/client and
  packages/repack/mf from biome, since v2 infers module type from
  package.json and refuses to parse them as modules
- disable noSvgWithoutTitle for static .svg assets and
  noUnknownAtRules for tailwind at-rules in CSS
- apply safe fixes: new import sort order, @ts-ignore ->
  @ts-expect-error conversions
- give forEach callbacks block bodies and make map returns explicit
  to satisfy useIterableCallbackReturn; convert a side-effect-only
  map to forEach in the rspack Compiler
- drop biome-ignore suppressions that v2 reports as unused
- remove the write-only timer field in WebSocketServer and the
  unused config constructor property on JsonConsoleReporter; keep
  runtime-exposed ModuleFederationPlugin fields with suppressions
- replace non-null-asserted optional chains in babelSwcLoader
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
repack-website Ready Ready Preview Jul 30, 2026 1:56pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a59f79e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

The heartbeat setInterval started in the WebSocketServer constructor
was never cleared, keeping the event loop alive after the fastify
server closes. Register an onClose hook so the interval is cleared
when the dev server shuts down.
packages/repack typechecks the dev-server sources with DOM libs,
where setInterval returns number instead of NodeJS.Timeout. Use
ReturnType<typeof setInterval> so the field types correctly under
both lib configurations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant