2.5.2
Patch Changes
-
#10595
f458028Thanks @pkallos! - Added the optionignoreBooleanCoercionto useNullishCoalescing. When enabled, Biome ignores||and||=used inside aBoolean()call, where coalescing on falsy values is intentional. -
#10798
4a32b63Thanks @pkallos! - Added the optionignorePrimitivesto useNullishCoalescing. When enabled, Biome ignores||,||=, and ternary expressions whose non-nullish operands are all primitives the option opts out of. Usetrueto ignore all primitives, or an object selectingstring,number,boolean, orbigint. -
#10545
f3d4c00Thanks @Mokto! - Added the new nursery rulenoSvelteUnnecessaryStateWrap, which reports unnecessary$state()wrapping of classes fromsvelte/reactivitythat are already reactive.<script> import { SvelteMap } from "svelte/reactivity"; const map = $state(new SvelteMap()); // redundant </script>
-
#10752
f62fb8bThanks @ematipico! - Fixed #10739. Now the ruleuseValidAutocompletecorrectly flags theautoCompleteattribute. -
#10796
f1b3ab2Thanks @ematipico! - Fixed #10768. Improved the performance of the Biome Language Server by cancelling certain in-flight operations when there are fast updates. -
#10719
aa649b5Thanks @minseong0324! - FixednoMisleadingReturnTypefalse positive on returns that use a widening type assertion:"a" as stringis no longer reported as misleading. The rule now also reports a literal-pinning assertion such asfalse as false, matching the existingas constbehavior.// No longer flagged (returns are `string`): function getValue(b: boolean): string { if (b) return "a" as string; return "b" as string; } // Now also reported, like `as const` (returns `false`): function isReady(): boolean { return false as false; }
-
#10678
8f073a7Thanks @PranavAchar01! - Fixed #7718: Biome now correctly parses CSS nesting selectors when&appears as a trailing sub-selector after a type selector, e.g.h1& { color: red; }. -
#10756
5ec965aThanks @denbezrukov! - Fixed CSS formatter output for selector lists withallowWrongLineCommentsand//comments after a selector comma. Biome now keeps the selector before the line comment inline instead of breaking it across descendant combinators.-.powerPathNavigator - .helm - button.pressedButton, // pressed +.powerPathNavigator .helm button.pressedButton, // pressed .powerPathNavigator .helm button:active:not(.disabledButton) { }
-
#10757
6232fcdThanks @PranavAchar01! - Fixed #8269: the CSS parser now accepts Tailwind@variantand@utilitynames that start with a digit, such as the2xlbreakpoint.@utility container { @variant 2xl { max-width: 1400px; } }
-
#10777
575ced6Thanks @WaterWhisperer! - Fixed an issue reported in #10708: the GitLab reporter now handles--verbosediagnostics filtering correctly. -
#10281
0efe244Thanks @Zelys-DFKH! - Fixed a bug where GritQL patterns rejected positional (unkeyed) arguments. -
#10758
e36fd8aThanks @henrybrewer00-dotcom! - Fixed #10697: The formatter no longer removes the parentheses around anawaitoryieldexpression used as the target of a TypeScript instantiation expression. For example,(await makeFactory)<Value>is no longer reformatted toawait makeFactory<Value>, which would change the meaning of the code. -
#10586
3617094Thanks @IxxyDev! - Fixed #9568:noFloatingPromisesno longer reports a false positive when calling an overloaded function and the selected overload does not return a promise.function bestEffort(cb: () => Promise<number>): Promise<number>; function bestEffort(cb: () => number): number; function bestEffort( cb: () => number | Promise<number>, ): Promise<number> | number { return cb() as Promise<number> | number; } // This resolves to the second overload, which returns `number`, so it is no // longer flagged as a floating promise. bestEffort(() => 42);
-
#10766
7aff4c1Thanks @JamBalaya56562! - Fixed #2862:noInteractiveElementToNoninteractiveRoleno longer reports custom elements (a tag name containing a dash, e.g.<my-button role="img" />). Per the W3C HTML-ARIA specification, a custom element may be given any role or none. -
#10680
771daa4Thanks @WaterWhisperer! - Fixed #10635: Biome now recognizes chained
table tests such astest.concurrent.each()andit.concurrent.each()as test calls, fixing
noMisplacedAssertionfalse positives and improving formatting for those test declarations. -
#10759
34570b5Thanks @henrybrewer00-dotcom! - Fixed #10636: noStaticElementInteractions no longer reports a false positive for event handlers on Svelte special elements such as<svelte:window>,<svelte:document>, and<svelte:body>. These are not real DOM elements, so they are now ignored by the rule. -
#10741
bd2364eThanks @JamBalaya56562! - Fixed #6686: theragecommand now respects the--config-pathoption and theBIOME_CONFIG_PATHenvironment variable when loading the Biome configuration. Previously it always used the default configuration resolution and reported the configuration asNot setwhen nobiome.jsonexisted in the working directory. -
#10763
2c3e82dThanks @Aqu1bp! - Fixed #10742:noSolidDestructuredPropsnow reports destructured props in Solid function components and JSX children. -
#10606
a4cc4abThanks @Mokto! - Fixed false positives innoUnusedImports,noUnusedVariables, anduseImportTypefor Svelte components that use both a<script module>and a<script>block. The two blocks compile to a single module and share a top-level scope, so a binding (import, function, or variable) declared in one block and used only in the other is no longer reported as unused. -
#10767
36d5aa7Thanks @otkrickey! - Fixed #10754:useVueValidVBindno longer reports the Vue 3.4+ same-name shorthand as missing a value.:fooandv-bind:fooare now accepted as equivalent to:foo="foo", whilev-bind,v-bind:[dynamicArg], and:[dynamicArg]without a value continue to be reported. -
#10775
a918af0Thanks @WaterWhisperer! - Fixed an issue reported in #10708:biome ragedidn't detect running Biome daemon pipes on Windows. -
#10730
5a2e65bThanks @dinocosta! - Fixed an issue where Biome was resolving the well-known Zed settings file from the wrong location on macOS and Windows. -
#10807
d97fffeThanks @ematipico! - Fixed an issue where.scssfiles were incorrectly analyzed when runningbiome check. -
#10672
53c6efcThanks @ematipico! - Fixed a bug where Biome incorrectly formatted snippets that have parsing errors. -
#10719
aa649b5Thanks @minseong0324! - FixeduseAwaitThenablefalse positive when awaiting a custom thenable that is not the globalPromise. A value with a callablethenmember is now recognized as awaitable.interface Thenable<T> { then(onfulfilled: (value: T) => void): void; } declare const t: Thenable<number>; async function f() { await t; }
-
#10734
4396496Thanks @BangDori! - Fixed #10708:biome migratenow preserves trivia when migrating the deprecatedrecommendedoption topreset. -
#10683
ae31a00Thanks @Netail! - Fixed #10657 #10671 #10661 #10637 #10718: HTML rules now correctly handle dynamic attributes. -
#10746
54e8239Thanks @ematipico! - Fixed an issue wherenoUndeclaredClassesdidn't correctly detect styles defined inside the Astro directiveis:global. -
#10770
dd1429cThanks @ematipico! - Improved the Biome Language Server DX by orchestrating certain operations, so that they won't block the editor during typing. This improvement is more visible in large documents. -
#10473
d9b5133Thanks @Mokto! - ImprovednoUnusedImports,noUnusedVariables,noUnusedFunctionParameters, anduseImportTypefor Svelte, Vue, and Astro files (withhtml.experimentalFullSupportEnabled). Bindings used only in the template — including component tags, attribute interpolations, directives,bind:shorthand, and snippet parameters — are no longer reported as unused, while genuinely unused ones still are. -
#10796
f1b3ab2Thanks @ematipico! - Fixed an issue where the Biome Language Server didn't enable project or type-aware lint rules, even when they were explicitly enabled. -
#10746
54e8239Thanks @ematipico! - Fixed an issue wherenoUndeclaredClassesdidn't detect styles declared inside HTML documents. -
#10774
bde945bThanks @pattrickrice! - Fixed #10268 where a race condition resulted in internal errors such as:The file biome.json does not exist in the workspace.
What's Changed
- fix(cli): respect --config-path and BIOME_CONFIG_PATH in rage command by @JamBalaya56562 in #10741
- fix(migrate): preserve trivia in recommended migration by @BangDori in #10734
- fix(css/parser): allow & as a trailing sub-selector in compound selectors by @PranavAchar01 in #10678
- perf(cli): don't drop file guard and reuse data by @ematipico in #10731
- feat(lint): add ignoreBooleanCoercion option to useNullishCoalescing by @pkallos in #10595
- chore: remove dead code and update CLI comments by @BangDori in #10748
- fix(lint/noFloatingPromises): select the matching overload by @IxxyDev in #10586
- fix(lint): noUnusedImports/noUnusedVariables now flag truly-unused script bindings in Svelte/Vue/Astro by @Mokto in #10473
- fix(useValidAutocomplete): update autocomplete attribute validation by @ematipico in #10752
- fix(md): parse space+tab indented sublists as nested list items by @xsourabhsharma in #10703
- ci: attempt to reduce disk usage on windows by @ematipico in #10753
- feat(js/nursery): add noSvelteNoUnnecessaryStateWrap rule by @Mokto in #10545
- refactor(core): semantic, embedded bindings and references as salsa tracked functions by @ematipico in #10672
- fix(json): detect global Zed settings as JSONC on macOS and Windows by @dinocosta in #10730
- fix(formatter): keep parens around await/yield in instantiation expressions by @henrybrewer00-dotcom in #10758
- fix(css_formatter): keep selector comments inline by @denbezrukov in #10756
- fix(grit): support positional arguments in pattern, function, and node calls by @Zelys-DFKH in #10281
- fix(linter): correctly track is:global and current styles by @ematipico in #10746
- chore(deps): update rust crate salsa to 0.27.2 by @renovate[bot] in #10650
- refactor: feature-gate via langauges and other core features by @ematipico in #10762
- fix(js_analyze): handle chained test.each calls in noMisplacedAssertion by @WaterWhisperer in #10680
- fix(useVueValidVBind): accept Vue 3.4+ same-name shorthand by @otkrickey in #10767
- fix(cli): detect Biome daemon pipes on Windows by @WaterWhisperer in #10775
- chore(deps): update rust crate camino to 1.2.4 by @renovate[bot] in #10724
- chore(deps): update github-actions by @renovate[bot] in #10788
- fix(lsp): debounce diagnostics after rapid changes by @ematipico in #10770
- test: update snapshots by @ematipico in #10794
- chore(deps): update rust crate anyhow to 1.0.103 by @renovate[bot] in #10786
- feat(css_parser): parse SCSS query feature expressions by @denbezrukov in #10755
- fix(cli): scss shouldn't be enabled by @ematipico in #10807
- feat(css_parser): parse SCSS variable media features by @denbezrukov in #10804
- chore(deps): update rust crate jiff to 0.2.31 by @renovate[bot] in #10725
- fix(linter): ignore svelte special elements in noStaticElementInteractions by @henrybrewer00-dotcom in #10759
- fix(css/parser): allow Tailwind variant and utility names to start with a digit by @PranavAchar01 in #10757
- fix(workspace_db):
The file biome.json does not exist in the workspaceby @pattrickrice in #10774 - feat(css_parser): parse hyphen-led interpolated properties by @denbezrukov in #10809
- refactor(core): move db outside workspace by @ematipico in #10796
- fix(cli): filter verbose diagnostics in GitLab reporter by @WaterWhisperer in #10777
- fix(lint): ignore custom elements in noInteractiveElementToNoninteractiveRole by @JamBalaya56562 in #10766
- fix(lint): detect Solid destructured props in JSX children by @Aqu1bp in #10763
- feat(lint): add ignorePrimitives option to useNullishCoalescing by @pkallos in #10798
- docs: fix duplicate "children" in formatter comment by @dfedoryshchev in #10771
- fix(lint): noMisleadingReturnType reads type assertions as their asserted type by @minseong0324 in #10719
- fix(svelte): share
<script module>/<script>scope for unused-binding rules by @Mokto in #10606 - fix(html_analyze): correctly handle dynamic values for attributes by @Netail in #10683
- ci: release by @github-actions[bot] in #10747
New Contributors
- @BangDori made their first contribution in #10734
- @PranavAchar01 made their first contribution in #10678
- @dinocosta made their first contribution in #10730
- @henrybrewer00-dotcom made their first contribution in #10758
- @Zelys-DFKH made their first contribution in #10281
- @WaterWhisperer made their first contribution in #10680
- @otkrickey made their first contribution in #10767
- @Aqu1bp made their first contribution in #10763
Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/biome@2.5.1...@biomejs/biome@2.5.2