chore: upgrade @biomejs/biome to 2.x - #1427
Open
dannyhw wants to merge 3 commits into
Open
Conversation
- 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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades
@biomejs/biomefrom 1.9.4 to 2.5.6.Config migration
biome.jsoncmigrated to the v2 schema viabiome migrate --write, plus two manual fixes the migration doesn't handle:useImportExtensionsoverride now uses"forceJsExtensions": true(the 1.xsuggestedExtensionsoption was removed)organizeImportsignore list is carried over asassist.includes(the migration silently drops it)packages/repack/client/*.jsandpackages/repack/mf/*.jsfrom 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.a11y/noSvgWithoutTitlefor**/*.svg(biome 2 now lints raw SVG files; all hits were static image assets) andsuspicious/noUnknownAtRulesfor**/*.css(tailwind at-rules).Code changes
@ts-ignore→@ts-expect-error(22 sites).useIterableCallbackReturn(newly recommended): reviewed all 15 hits individually — none were real bugs.forEachcallbacks that implicitly returned a value got block bodies; a side-effect-onlymapin the rspackCompileris nowforEach;DevelopmentPlugin'smapcallback now returnsundefinedexplicitly instead of mixing barereturn;with value returns.biome-ignoresuppressions that v2 reports as unused (noParameterAssign/useNodejsImportProtocolwere demoted from recommended;useConst/noUnusedImportsanalysis got smarter — theFederatedjsdoc import is now recognized).noUnusedPrivateClassMembers(newly recommended): fixed the write-onlytimerfield inWebSocketServerby clearing the heartbeat interval in a fastifyonClosehook (it previously kept the event loop alive after server close), and removed the unusedconfigconstructor property onJsonConsoleReporter; keptModuleFederationPlugin.config/deepImportswith suppressions since they're runtime-exposed for V1 plugin compat.?.+!combos inbabelSwcLoader: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— cleanpnpm typecheck— 11/11 tasks passpnpm test— all green, including tester-app bundle/start integration tests