Biome CLI v2.5.13
- Add the nursery rule useLayeredStyles, which enforces that style rules are defined within a cascade layer and import rules to import its styles into a cascade layer
- Add the nursery rule useBetterDomTraversing, which prefers .firstChild, .firstElementChild, .closest(), and merged .querySelector() calls over positional DOM traversal
- Add the nursery rule noXorAsExponentiation, which reports the bitwise XOR operator ^ between two decimal integer literals where the exponentiation operator ** was likely intended
- Improve type-aware lint performance for large libraries such as Zod by no longer fully inferring imported generic declarations just to apply their type arguments
- Fix noUselessConstructor to ignore TypeScript constructors that forward at least one argument to super, preserving constructors that narrow the subclass's accepted parameter types
- Fix useAriaPropsForRole and useFocusableInteractive to no longer report non-focusable elements with role="separator"
- Fix Grit plugins to capture and inspect multiple named import specifiers
- Reduce unnecessary type inference when type-aware lint rules inspect members of namespace imports from libraries such as Zod
- Fix noUnusedPrivateClassMembers to consider compound assignments such as ??= to read and use private class members
- Fix useReactCompiler by disabling the experimental capitalized-call and effect-dependency checks to match upstream's recommended lint preset
From Biome
2.5.13
Patch Changes
-
#11379
07a0073Thanks @Netail! - Added the nursery ruleuseLayeredStyles, which enforces that style rules are defined within a cascade layer and import rules to import its styles into a cascade layer./* Invalid */ @import 'foo.css'; .my-style { color: red; } /* Valid */ @import 'foo.css' layer(base); @layer base { .my-style { color: red; } } -
#11667
e997900Thanks @devtechedge! - Added the nursery ruleuseBetterDomTraversing, which prefers.firstChild,.firstElementChild,.closest(), and merged.querySelector()calls over positional DOM traversal.element.childNodes[0]; element.children[0]; element.parentElement.parentElement; element.querySelector("a").querySelector("b"); -
#11620
20e513aThanks @jakeleventhal! - Fixed #11610, #11611, #11612, #11615, and #11616: Biome no longer fully infers an imported generic declaration just to apply its type arguments, restoring type-aware lint performance for large libraries such as Zod. This improvesuseRegexpExec,noFloatingPromises,noMisusedPromises,useNullishCoalescing, andnoUnsafePlusOperands. -
#11657
e322040Thanks @ematipico! - Fixed #7495:noUselessConstructornow ignores TypeScript constructors that forward at least one argument tosuper, preserving constructors that narrow the subclass's accepted parameter types. The exemption also applies when the parent and child signatures are identical; JavaScript and zero-argument forwarding behavior are unchanged. -
#11670
4969ee1Thanks @ematipico! - Fixed #7076:useAriaPropsForRoleanduseFocusableInteractiveno longer report non-focusable elements withrole="separator". A separator with an explicittabIndexortabindexstill requiresaria-valuenow. -
#11627
23aad6dThanks @ematipico! - Fixed #6571 so Grit plugins can capture and inspect multiple named import specifiers. -
#11631
00dbd3aThanks @ematipico! - Reduced unnecessary type inference when type-aware lint rules inspect members of namespace imports from libraries such as Zod. Fixed type inference so blanket re-exports do not expose default exports. -
#11628
a2f8ff7Thanks @dyc3! - Added the nursery rulenoXorAsExponentiation, which reports the bitwise XOR operator^between two decimal integer literals, where the exponentiation operator**was likely intended.const kibibyte = 2 ^ 10; // 8, not 1024 -
#11670
4969ee1Thanks @ematipico! - Fixed #7192:noUnusedPrivateClassMembersnow considers compound assignments such as??=to read and use private class members. -
#11676
840a52aThanks @dyc3! - Fixed #11672 and #11671 by disabling the experimental capitalized-call and effect-dependency checks inuseReactCompiler, matching their exclusion from upstream's recommended lint preset. Valid calls such asIntl.NumberFormat()and captures of variables declared inside effects no longer produce these diagnostics. -
#11660
49485edThanks @ematipico! - Fixed #11653: Astro template suppression comments ({/* biome-ignore lint: reason */}) now suppress matching HTML lint diagnostics on the following line when full HTML support is enabled. -
#11664
9a73b9cThanks @dyc3! - Improved the performance ofuseRegexpExec. -
#11661
5341b3fThanks @ematipico! - Fixed #7479.noUnusedVariablesnow treats Unicode escapes in identifiers as the same binding as their decoded spelling. -
#11630
62e1fc5Thanks @dyc3! - Fixed the HTML formatter inserting whitespace between adjacent Svelte expressions when their combined length exceeds the line width.<span> - {head.median - base.median >= 0 ? "+" : "−"} - {formatMs(Math.abs(head.median - base.median))} + {head.median - base.median >= 0 ? "+" : "−"}{formatMs(Math.abs(head.median - base.median))} </span> -
#11658
ed4bfa4Thanks @fredrikblau! - Fixed #11644:useHeadingContentno longer reports headings that render their text with a directive:set:htmlandset:textin Astro files,v-htmlandv-textin Vue files.<h1 set:html={heading} /> <h2 set:text={heading}></h2><template> <h1 v-html="heading"></h1> <h2 v-text="heading"></h2> </template> -
#11613
47d7383Thanks @ematipico! - Improved the performance of Biome Formatter up to ~50% in some cases. -
#11655
fd8fc74Thanks @ematipico! - Fixed #6974, wherenoUnusedPrivateClassMembersincorrectly reported TypeScript private constructor properties read through object destructuring fromthisas unused. -
#11618
21a10cfThanks @siketyan! - Fixed #11605: Type inference now infers the type of an unannotated callback parameter from the signature of the function the callback is passed to, and honours explicit type arguments on call expressions. This improves type-aware analysis fornoBaseToString,noFloatingPromises,noMisleadingReturnType,noMisusedPromises,noUnnecessaryConditions,noUnsafePlusOperands,noUselessTypeConversion,useArrayFind,useArraySortCompare,useAwaitThenable,useDisposables,useExhaustiveSwitchCases,useIncludes,useNullishCoalescing,useRegexpExec, anduseStringStartsEndsWith. For example,noFloatingPromisescan now detect Promises reached through such parameters:interface Context { doSomething(): Promise<void>; } declare function test(callback: (ctx: Context) => Promise<void>): void; test(async (ctx) => { ctx.doSomething(); // now reported as a floating promise }); -
#11698
b019982Thanks @denbezrukov! - Fixed parsing of unquoted CSS URLs beginning with@or!, such asurl(@/assets/icon.svg)andurl(!font.woff2). Preserved escaped and non-ASCII whitespace in raw URLs during formatting.-background-image: url(image\); +background-image: url(image\ ); -
#11622
c23e4c7Thanks @Netail! - Added the nursery rulenoUnsafeIframeSandbox, which reportsiframeelements whosesandboxattribute combinesallow-scriptsandallow-same-origin, since that combination lets the embedded document remove its own sandboxing.<iframe src="https://example.com" sandbox="allow-scripts allow-same-origin" /> -
#11606
de0528fThanks @dyc3! - Added the recommendednoSvelteAtHtmlTagsnursery rule, which reports Svelte{@html}tags that render unescaped HTML. -
#11670
4969ee1Thanks @ematipico! - Fixed #6782: GritQL plugins now match captured JSX component names against code snippets such asReact.Fragment. -
#11687
09d97d9Thanks @hori-design! - Fixed #11678:useReactCompilerno longer panics on files that contain non-ASCII characters. This bumps the React Compiler version. -
#11595
a64d757Thanks @dyc3! - Added the nursery Vue-domain ruleuseVueBaseImportrule, which enforces importing Vue APIs fromvueinstead of internal@vue/*packages. -
#11675
353cbaeThanks @dyc3! - FixeduseReactCompilersilently producing no diagnostics in WebAssembly builds, including the playground. -
#11625
ea20e5aThanks @denbezrukov! - Improved linting performance for large CSS and JSON files. -
#11670
4969ee1Thanks @ematipico! - Fixed #7527: suppression actions for diagnostics emitted on comments are now inserted before the diagnostic comment. In particular, suppressingnoTsIgnorenow places thebiome-ignorecomment before@ts-ignore. -
#11655
fd8fc74Thanks @ematipico! - Fixed #8629, wherenoUnusedPrivateClassMembersincorrectly reported used private TypeScript method overload signatures as unused. -
#11669
579f401Thanks @denbezrukov! - Improved the performance ofnoExcessiveLinesPerFilewhenskipBlankLinesisfalse.
What's Changed
- chore: update depot logo by @nhedger in https://github.com/biomejs/biome/pull/11602
- ci: md parse and format benches by @ematipico in https://github.com/biomejs/biome/pull/11607
- perf(css_parser): short-circuit SCSS unary operator detection by @denbezrukov in https://github.com/biomejs/biome/pull/11609
- feat(lint/js/vue): add useVueBaseImport by @dyc3 in https://github.com/biomejs/biome/pull/11595
- perf(css_parser): exclude diagnostics from parser benchmarks by @denbezrukov in https://github.com/biomejs/biome/pull/11617
- feat(css): model numeric SCSS identifier parts by @denbezrukov in https://github.com/biomejs/biome/pull/11621
- perf(rowan): accelerate token lookup by offset by @denbezrukov in https://github.com/biomejs/biome/pull/11625
- fix(grit): query named imports by @ematipico in https://github.com/biomejs/biome/pull/11627
- perf(type_inference): avoid eager generic declaration inference by @jakeleventhal in https://github.com/biomejs/biome/pull/11620
- feat(md): parse gfm markdown by @ematipico in https://github.com/biomejs/biome/pull/11551
- perf(yaml_formatter): avoid copying unchanged scalars by @ematipico in https://github.com/biomejs/biome/pull/11613
- feat(lint/js): add noXorAsExponentiation by @dyc3 in https://github.com/biomejs/biome/pull/11628
- perf(rowan): specialize first and last token traversal by @denbezrukov in https://github.com/biomejs/biome/pull/11626
- fix(inference): reduce unnecessary type inference by @ematipico in https://github.com/biomejs/biome/pull/11631
- fix(format/html/svelte): preserve adjacent Svelte expressions by @dyc3 in https://github.com/biomejs/biome/pull/11630
- feat: noUnsafeIframeSandbox by @Netail in https://github.com/biomejs/biome/pull/11622
- feat(css_analyze): implement useLayeredStyles by @Netail in https://github.com/biomejs/biome/pull/11379
- chore: include branch/PR info in preview releases by @dyc3 in https://github.com/biomejs/biome/pull/11637
- fix(parse/md): prevent infinite loop after closing code fences by @dyc3 in https://github.com/biomejs/biome/pull/11639
- feat(lint/html/svelte): add noSvelteAtHtmlTags by @dyc3 in https://github.com/biomejs/biome/pull/11606
- chore(deps): update rust to v1.98.1 by @renovate[bot] in https://github.com/biomejs/biome/pull/11646
- perf(css_formatter): avoid repeated value-range scans by @denbezrukov in https://github.com/biomejs/biome/pull/11643
- fix(biome_html_analyze): don't report Astro headings using set:html or set:text by @fredrikblau in https://github.com/biomejs/biome/pull/11658
- chore(review): make skill behavioural by @ematipico in https://github.com/biomejs/biome/pull/11663
- fix(css_parser): allow !important in Sass function arguments by @denbezrukov in https://github.com/biomejs/biome/pull/11654
- fix(noUnusedPrivateClassMembers): use of this by @ematipico in https://github.com/biomejs/biome/pull/11655
- fix(noUnusedVariables): decode Unicode escapes by @ematipico in https://github.com/biomejs/biome/pull/11661
- fix(noUselessConstructor): add TypeScript forwarding constructor exclion by @ematipico in https://github.com/biomejs/biome/pull/11657
- fix(analyzer): suppressions via trait by @ematipico in https://github.com/biomejs/biome/pull/11660
- perf(semantic): use declaration metadata for import checks by @dyc3 in https://github.com/biomejs/biome/pull/11665
- perf(useRegexpExec): check member name before receiver inference by @dyc3 in https://github.com/biomejs/biome/pull/11664
- perf: reuse token text and CSS property names by @denbezrukov in https://github.com/biomejs/biome/pull/11662
- perf(formatter): avoid quadratic token coverage validation by @dyc3 in https://github.com/biomejs/biome/pull/11666
- fix: various fixes by @ematipico in https://github.com/biomejs/biome/pull/11670
- perf(analyze): avoid rebuilding tokens when counting lines by @denbezrukov in https://github.com/biomejs/biome/pull/11669
- test(css_formatter): add SCSS benchmarks by @denbezrukov in https://github.com/biomejs/biome/pull/11673
- feat(plugins): add traversal methods for JS by @ematipico in https://github.com/biomejs/biome/pull/11674
- feat(linter): add useBetterDomTraversing nursery rule by @devtechedge in https://github.com/biomejs/biome/pull/11667
- fix(react_compiler): run React Compiler in WebAssembly by @dyc3 in https://github.com/biomejs/biome/pull/11675
- chore(xtask): migrate Promise global types by @minseong0324 in https://github.com/biomejs/biome/pull/11185
- perf(css_formatter): skip verbatim bookkeeping in release builds by @denbezrukov in https://github.com/biomejs/biome/pull/11677
- fix(useReactCompiler): disable noisy experimental checks by @dyc3 in https://github.com/biomejs/biome/pull/11676
- chore(deps): update rust crate proc-macro-error3 to 3.1.1 by @renovate[bot] in https://github.com/biomejs/biome/pull/11652
- chore(deps): update dependency vitest to v4.1.11 [security] by @renovate[bot] in https://github.com/biomejs/biome/pull/11681
- chore(deps): update rust crate crossbeam to 0.8.5 by @renovate[bot] in https://github.com/biomejs/biome/pull/11648
- chore(deps): update rust crate indexmap to 2.14.2 by @renovate[bot] in https://github.com/biomejs/biome/pull/11649
- fix(css_parser): allow parenthesized Sass query values by @denbezrukov in https://github.com/biomejs/biome/pull/11680
- fix(css_parser): support interpolated subselectors in SCSS by @denbezrukov in https://github.com/biomejs/biome/pull/11685
- chore(deps): update mcr.microsoft.com/devcontainers/universal docker tag to v6 by @renovate[bot] in https://github.com/biomejs/biome/pull/11690
- chore(deps): update github-actions (major) by @renovate[bot] in https://github.com/biomejs/biome/pull/11689
- chore(deps): update pnpm to v12 by @renovate[bot] in https://github.com/biomejs/biome/pull/11691
- chore(deps): update dependency tombi to v1 by @renovate[bot] in https://github.com/biomejs/biome/pull/11688
- fix(react-compiler): bump vendored React Compiler crates to fix non-ASCII panic by @hori-design in https://github.com/biomejs/biome/pull/11687
- fix(type-inference): infer callback parameter types from call signatures by @siketyan in https://github.com/biomejs/biome/pull/11618
- fix(deps): update @biomejs packages by @renovate[bot] in https://github.com/biomejs/biome/pull/11694
- chore(deps): update github-actions by @renovate[bot] in https://github.com/biomejs/biome/pull/11693
- feat(plugins): add code fix mutation by @ematipico in https://github.com/biomejs/biome/pull/11682
- feat(plugins): add rule context by @ematipico in https://github.com/biomejs/biome/pull/11683
- feat(plugins): add semantic model by @ematipico in https://github.com/biomejs/biome/pull/11686
- refactor: change package name by @ematipico in https://github.com/biomejs/biome/pull/11695
- chore(deps): update Prettier and Svelte plugin by @dyc3 in https://github.com/biomejs/biome/pull/11696
- fix(css_parser): accept unquoted URLs starting with @ or ! by @denbezrukov in https://github.com/biomejs/biome/pull/11698
- perf(css_formatter): avoid duplicate separated-list traversal by @denbezrukov in https://github.com/biomejs/biome/pull/11679
- refactor(js_analyze): extract shared DOM AST utilities by @dyc3 in https://github.com/biomejs/biome/pull/11702
- fix(css_parser): accept valid SCSS forward prefixes by @denbezrukov in https://github.com/biomejs/biome/pull/11701
- docs: clarify the usage of 'use strict' in ESM and CommonJS files by @alexrudd2 in https://github.com/biomejs/biome/pull/11707
- perf(css_formatter): skip include scans without closing comments by @denbezrukov in https://github.com/biomejs/biome/pull/11708
- ci: release by @github-actions[bot] in https://github.com/biomejs/biome/pull/11614
New Contributors
- @fredrikblau made their first contribution in https://github.com/biomejs/biome/pull/11658
- @devtechedge made their first contribution in https://github.com/biomejs/biome/pull/11667
- @hori-design made their first contribution in https://github.com/biomejs/biome/pull/11687
- @alexrudd2 made their first contribution in https://github.com/biomejs/biome/pull/11707
Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/biome@2.5.12...@biomejs/biome@2.5.13