2.5.12
Patch Changes
-
#11440
b88f1eaThanks @Princesseuh! - Fixed Astro attribute expressions rejecting TypeScript and JSX syntax that is accepted in text expressions.<Component icon={<Icon />} count={total as number} onSelect={(e: Event) => e} />
-
#11440
b88f1eaThanks @Princesseuh! - Fixed Astro attribute names being split on:and.inside an expression, such as{x && <button x-on:keyup.enter={go} client:load.foo />}. -
#11440
b88f1eaThanks @Princesseuh! - Fixed a bare>in the children of an Astro expression being treated as markup, such as{x && <div>a > b</div>}. -
#11440
b88f1eaThanks @Princesseuh! - Fixed HTML comments inside an Astro expression failing to parse. They are now read as trivia, wherever they appear among the children.{x && <div><!-- first -->text<!-- last --></div>} {cond && <a></a><!-- c --><b></b>}
-
#11440
b88f1eaThanks @Princesseuh! - Fixedis:rawchildren inside an Astro expression being read as JSX, such as{x && <div is:raw>{not js} < & text</div>}. -
#11440
b88f1eaThanks @Princesseuh! - Fixed an apostrophe or quote in the text of a JSX element inside an Astro expression ending the expression early, such as{items.map((i) => <li>it's {i}</li>)}. -
#11440
b88f1eaThanks @Princesseuh! - Fixed the children of a<script>or<style>inside an Astro expression being read as JSX. Their contents are text, so braces and comparisons no longer have to be escaped.{cond && <style>a { color: red }</style>} {cond && <script>let x = {a: 1};</script>}
-
#11440
b88f1eaThanks @Princesseuh! - Added support for template literal attribute values inside an Astro expression, such as{x && <C data-x=`t${x}` />}. -
#11440
b88f1eaThanks @Princesseuh! - Fixed unquoted attribute values being rejected inside an Astro expression, such as{x && <a class=foo maxlength=255 href=/about>go</a>}. -
#11440
b88f1eaThanks @Princesseuh! - Fixed a template literal nested inside${}breaking the rest of an Astro file, such asconst href = `/blog${page === 0 ? '' : `/${page + 1}`}`;. -
#11440
b88f1eaThanks @Princesseuh! - Fixed a quote inside a regex character class breaking the rest of an Astro file, such asconst unsafe = /[/"]/;. -
#11508
54f3a2eThanks @dyc3! - Added the nursery ruleuseFlatMathMinMax. BecauseMath.min()andMath.max()accept any number of arguments, the rule reports unnecessary nested calls to the same method:Math.max(Math.max(a, b), c);
The fix flattens this expression to
Math.max(a, b, c). -
#11585
c5c8315Thanks @Netail! - Fixed #11475:noUnresolvedImportsno longer reports Bun runtime built-in modules (bun,bun:bundle,bun:ffi,bun:jsc,bun:sqlite,bun:test). -
#11368
52a57b3Thanks @Austin1serb! - Fixed #6830: Biome now reports a diagnostic for excessively deep syntax instead of overflowing the native stack while releasing the parsed tree. -
#11596
1fc42edThanks @dyc3! - Added the nursery rulenoThisOutsideOfClass. The rule reportsthisoutside class members and TypeScript functions with an explicitthisparameter.function Person(name) { this.name = name; }
-
#11555
2516335Thanks @dyc3! - Fixed #11529, wherenoFloatingPromisesmissed unhandled Promise chains when the imported function's module belonged to an import cycle. Cyclic modules now preserve types for exports that do not participate in recursive type dependencies. -
#11518
0fee70cThanks @HarperZ9! - Fixed #11500: the formatter now prints thedeclaremodifier before accessibility modifiers on class properties.private declare readonly name: stringis now formatted asdeclare private readonly name: string, matching Prettier and TypeScript's canonical modifier order. -
#11580
1277af2Thanks @ematipico! - Fixed #5091: Biome no longer moves comments next to the<of a generic, which causes invalid TypeScript syntax:- Generic<// a comment + Generic< + // a comment
-
#11577
42995d2Thanks @ematipico! - Fixed #4592. Biome no longer crashes while parsing malformeddeleteexpressions. -
#11590
67963b4Thanks @ematipico! - Fixed #6427 so Grit plugins can usefunction = ...as a node argument. -
#11600
a689cb5Thanks @ematipico! - Fixed #6644:noUnusedVariablesnow recognizes all interface declarations in a TypeScript declaration-merging group when the interface is referenced.The following snippet no longer triggers the rule.
interface Things { foo: string; } interface Things { bar: string; } export type Key = keyof Things; interface Things { baz: string; }
-
#11591
d4a0716Thanks @ematipico! - Fixed #6615.noDuplicatePropertiesno longer reports declarations nested in block at-rules as duplicates of declarations in their parent block. -
#11492
f2a07aaThanks @santichausis! - Fixed #11454:noMisplacedAssertionnow recognises@fast-check/vitest'stest.prop(...)(and.concurrent.prop,.skip.prop, etc.) as a test function, the same way it already recognisestest.each. The JS formatter picks up the same recognition, so a curriedtest.prop(...)(...)call is now formatted with the regular breakable argument layout used fortest.each/test.for, instead of the single-line-hugging layout used for plainit/testcalls.For example, Biome no longer reports the assertion below as misplaced:
import { fc, test } from "@fast-check/vitest"; test.prop([fc.string()])("round-trips", (s) => { expect(s).toBe(s); });
-
#11589
65742b3Thanks @ematipico! - Fixed #4928:noUnusedVariablesno longer reports a value declaration as unused when its merged namespace is referenced. -
#11559
472dbc2Thanks @levrik! - Fixed a false positive innoVueDuplicateKeyswhere a<script setup>variable initialized frompropswas reported as a duplicate of the prop it derives from. Biome now exempts any variable whose initializer referencesprops, instead of only recognizingdefineProps()andtoRefs(props).For example, Biome no longer reports
foobelow as a duplicate key:<script setup> import { toRef } from 'vue'; const props = defineProps(['foo']); const foo = toRef(props, 'foo'); </script>
-
#11594
6586cebThanks @ematipico! - Fixed #6640. Biome no longer crashes when linting malformedfor...ofstatements. -
#11571
85b197dThanks @ematipico! - Fixed #10838:useSortedAttributesno longer corrupts JSX attributes when nested JSX elements also require sorting. -
#11533
97e76c0Thanks @ematipico! - Fixed #11520, where the Biome scanner would start analysing dependencies multiple times, leading to long and unresponsive sessions. -
#11564
18a0e1fThanks @Netail! - Fixed the diagnostic range ofnoInferrableTypesso it now highlights only the type instead of including the leading:colon, spaces and comments. -
#11540
124fdaaThanks @ematipico! - Fixed#11537:noShorthandPropertyOverridesnow compares declarations only within the same block. The rule no longer reports@supportsfeature queries and correctly checks nested,@keyframes, and@pageblocks. -
#11532
7ceb0eeThanks @dyc3! - Fixed #11528:noFloatingPromisesno longer reports statement-levelawaitexpressions that handle Promise values, including overloaded calls returning Promise aliases. Awaited values that resolve to arrays of Promises remain reported because their element Promises are not handled byawait. -
#11474
3c6412eThanks @dyc3! - Fixed #10241. Biome no longer reports unsupported text expression diagnostics for double-curly text in vanilla HTML, and the formatter preserves adjacent curly-brace text. -
#11593
6c7fd27Thanks @dyc3! - Added the nursery rulenoVueDeprecatedScopedSlots. It reports deprecated$scopedSlotsreferences in Vue templates and component objects, and offers an unsafe replacement with$slots. For example, Biome now reportsthis.$scopedSlots.defaultinside a Vue component. -
#11440
b88f1eaThanks @Princesseuh! - Fixed the formatter crashing on an Astro or Svelte expression spanning several lines in a file with CRLF line endings, such as<p>{a +\r\n b}</p>. -
#11581
f4e5ebbThanks @dyc3! - Added the nursery ruleuseModernMathApis. The rule reports legacy mathematical patterns that have direct modernMathequivalents.Math.sqrt(a * a + b * b);
-
#11597
a20f44aThanks @Netail! - Added the nursery rulenoBunModules, which forbids the use of Bun builtin modules (e.g.bun:sqlite,bun:ffi). -
#11545
7d54688Thanks @dyc3! - Fixed #11542: Biome now reports HTML comments between Svelte tag attributes as parse errors. -
#11582
b6611ddThanks @ematipico! - Fixed #3862. Biome now parses legacy Internet Explorerfilterand-ms-filtervalues such asprogid:DXImageTransform...andalpha(opacity=40). -
#11575
65da251Thanks @dyc3! - Improved the Tailwind parser's ability to recover from parsing failures. Whitespace now always allows the parser to recover and start parsing a new class. -
#11576
0f78499Thanks @ematipico! - Fixed #3515 and #10395, where Biome could corrupt Unicode characters while writing source received through standard input to standard output. Characters such as⚠and✔are now preserved. -
#11539
0fca643Thanks @ematipico! - Fixed #11512, wherestyle/noDescendingSpecificitymissed lower-specificity selectors after a later higher-specificity selector with the same tail selector. -
#11544
040f867Thanks @dyc3! - Fixed #11541: formatting a Svelte render tag followed by an HTML comment no longer duplicates the comment.<div> {@render children?.()} <!-- comment --> - <!-- comment --> </div> -
#11565
ee69e0eThanks @ematipico! - Fixed #11525. Now the configuration schema correctly provides auto-completion for linter domains. -
#11583
b19390cThanks @dyc3! - Fixed #11352:useExplicitLengthCheckno longer reportslength-like properties used as value-producing||fallbacks or optional chains, and it no longer offers fixes for value-producing&&checks or unsafe negations. -
#11562
753e955Thanks @ematipico! - Fixed an issue where the Biome Language Server would start with logging level set to debug. This would cause logs to grow exponentially in long sessions. -
#11217
7d3ee9cThanks @dyc3! - Fixed handling ofbiome-ignore formatsuppression comments on TypeScript declared class properties with string literal names.class A { declare /* biome-ignore format: exercise suppression checking */ 'a-b': 0; }
-
#11497
f5d7896Thanks @dyc3! - Added thenoInvalidFileInputAcceptnursery rule. The rule reports invalid literalacceptvalues on file inputs in JSX and HTML, and normalizes common mistakes.<input type="file" accept="image/jpg" />
-
#11345
ac58958Thanks @jakeleventhal! - Improved type inference performance by avoiding resolution of unused members in object arguments. -
#11554
2d55931Thanks @Netail! - Added the new nursery ruleuseReactNamingConvention, which enforces naming conventions for React values assigned fromcreateContext,useId, anduseRef. A value fromcreateContextmust be a PascalCase component name ending withContext, a value fromuseIdmust be namedidor end withId, and a value fromuseRefmust be namedrefor end withRef. -
#11491
1d6210bThanks @dyc3! - Added the nursery rulenoUnmodifiedLoopCondition, which reports variables in loop conditions that are never modified in the loop.let node = getNode(); while (node) { process(node); }
What's Changed
- fix(noDescendingSpecificity): compare against the highest specificity for a repeated tail selector 🤖🤖🤖 by @rawsun007 in #11524
- Revert "fix(noDescendingSpecificity): compare against the highest specificity for a repeated tail selector 🤖🤖🤖" by @ematipico in #11536
- fix(workspace): scanner behaviour by @ematipico in #11533
- perf: void extra resolution of unused object members and params by @jakeleventhal in #11345
- fix(formatter): print declare before accessibility modifiers by @HarperZ9 in #11518
- fix(js_analyze): recognize fast-check's test.prop in noMisplacedAssertion by @santichausis in #11492
- fix(format/html): avoid duplicating Svelte render comments by @dyc3 in #11544
- fix(parse/html): emit a diagnostic for invalid HTML comments inside tags by @dyc3 in #11545
- refactor: reduce generic functions per rule to reduce binary size by @siketyan in #11549
- fix(noDescendingSpecificity): improve specificity comparison by @ematipico in #11539
- fix(noFloatingPromises): various bugs by @dyc3 in #11532
- fix(noShorthandPropertyOverrides): improve query and visitor logic by @ematipico in #11540
- fix(format/js): check declared property name suppressions by @dyc3 in #11217
- fix(format/yaml): move overflowing multiline flow scalars below their key by @dyc3 in #11140
- feat(css): support interpolated SCSS URL values by @denbezrukov in #11547
- fix(cli): pass log level to the daemon by @ematipico in #11562
- feat(markdown): port markdownlint MD025 single top-level heading rule by @saberoueslati in #11266
- feat(lint/js): add
noInvalidFileInputAcceptby @dyc3 in #11497 - fix(schema): domains by @ematipico in #11565
- fix: noInferrableTypes range by @Netail in #11564
- fix(js/parser): read Astro template expression contents as Astro does by @Princesseuh in #11440
- fix(parse/html): treat double curly braces as plain text in regular html by @dyc3 in #11474
- chore(deps): update rust crate ureq to 3.4.0 by @renovate[bot] in #11487
- chore(deps): update rust crate tokio to 1.53.1 by @renovate[bot] in #11374
- chore(deps): update rust crate globset to 0.4.20 by @renovate[bot] in #11287
- fix(rowan): avoid stack overflow when dropping deep trees by @Austin1serb in #11368
- feat(js_analyze): added a React naming convention rule by @Netail in #11554
- feat(lint/js): add
noUnmodifiedLoopConditionby @dyc3 in #11491 - fix(noVueDuplicateKeys): fix a range of false-positives by @levrik in #11559
- chore: add a "update module replacements" workflow by @Netail in #10737
- chore(bench): use default benchmark sample sizes by @dyc3 in #11574
- test: issue 1634 by @ematipico in #11573
- fix(cli): unicode characters via stdin by @ematipico in #11576
- fix(useSortedAttributes): suppress nested JSX attributes by @ematipico in #11571
- fix(type_inference): infer non-cyclic declarations in module cycles by @dyc3 in #11555
- feat(lint/js): add
useFlatMathMinMaxby @dyc3 in #11508 - perf(css_parser): add SCSS parser benchmarks by @denbezrukov in #11572
- fix(js/parse): avoid panic on skipped token trivia by @ematipico in #11577
- fix(parse/tailwind): make whitespace not trivia anymore by @dyc3 in #11575
- fix(js/fmt): comments next to generic by @ematipico in #11580
- feat(lint): add useModernMathApis by @dyc3 in #11581
- feat: bun runtime modules support by @Netail in #11585
- fix(css/parse): legacy filters by @ematipico in #11582
- fix(grit): handle function named by @ematipico in #11590
- fix(noUnusedVariables): remove unused namespace by @ematipico in #11589
- fix(noDuplicateProperties): handle function named by @ematipico in #11591
- fix(js/parse): recover on malformed
for...ofstatements by @ematipico in #11594 - perf(css_parser): avoid rejected nesting blocks by @denbezrukov in #11592
- chore: tweak contributing docs by @dyc3 in #11586
- fix(noUnusedVariables): recognize merged interfaces by @ematipico in #11600
- feat(lint/js/vue): add noVueDeprecatedScopedSlots by @dyc3 in #11593
- feat(lint/js): add noThisOutsideOfClass by @dyc3 in #11596
- feat: noBunModules by @Netail in #11597
- fix(lint): align explicit length checks by @dyc3 in #11583
- fix(control_flow): fix panic in debug builds by @dyc3 in #11604
- perf(css_parser): add isolated SCSS benchmarks by @denbezrukov in #11603
- ci: release by @github-actions[bot] in #11530
New Contributors
- @rawsun007 made their first contribution in #11524
- @HarperZ9 made their first contribution in #11518
Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/biome@2.5.11...@biomejs/biome@2.5.12