@biomejs/biome
2.6.8 · 15 Nov 2026MIT OR Apache-2.030.3M / weekRepositoryHomepagenpmAtom feed
2.6.9 is the newest release of 2.x.
In short
4 new7 faster29 fixed
Release note
Patch Changes
Added the option
ignoreIfStatementsto useNullishCoalescing. Biome now flagsifstatements that only assign to a nullish variable (such asif (!a) { a = b }) and can rewrite them to??=. When enabled, Biome ignores thoseifstatements.Added a new nursery rule
noExtendNative, which reports extending the prototype of a built-in object.Added the nursery rule
noTailwindArbitraryValue. Biome now reports Tailwind CSS arbitrary values such asw-[400px], including in HTML/JSX class attributes, configured utility functions, and tagged templates.Fixed #11176:
noUnknownPseudoClassnow recognizes Vue's:deep()pseudo-class inside.vuestyle blocks.Fixed #8233, where Biome CLI in
stdin mode didn't work correctly when handling files in projects with nested
configurations. For example, with the following structure,--stdin-file-path=subdirectory/...would not use the nested configuration insubdirectory/biome.json:├── biome.json └── subdirectory ├── biome.json └── lib.jsbiome format --write --stdin-file-path=subdirectory/lib.js < subdirectory/lib.js
Now, the nested configuration is correctly picked up and applied.
In addition, Biome now shows a warning if
--stdin-file-pathis provided but
that path is ignored and therefore not formatted or fixed.Fixed
noUnnecessaryConditions: Biome now chooses the same function overload as TypeScript when an argument is a callback, so conditions that were previously missed are reported.The following code is now invalid, because a parameter typed
() => voidaccepts anasynccallback andscheduletherefore returnsstring:declare function schedule(handler: () => void): string; declare function schedule(handler: () => Promise<void>): string | undefined; schedule(async () => {}) ?? "fallback";The following code is also now invalid, because
map(() => 42)returns42:type Mapper<T> = () => T; declare function map<T>(mapper: Mapper<T>): T; map(() => 42) || flag;
Fixed #11087:
noUnnecessaryConditionsno longer reports optional chains and nullish coalescing whose receiver can be nullish.For example, the optional chain and fallback in the following code are no longer reported:
declare const usage: { range: { startDate: string } } | null; const startDate = usage?.range.startDate ?? "N/A";Fixed #11098: The HTML formatter now preserves the configured trailing newline when a file ends with a comment.
-<!-- trailing comment --> \ No newline at end of file +<!-- trailing comment -->
Fixed #11182: suppression comments for
noPositiveTabindexnow suppress the rule in HTML files when the attributes of the element span multiple lines.The HTML formatter now lays out the
srcsetattribute of<img>and<source>as the list of candidates it is. Runs of whitespace between candidates collapse, and once the list no longer fits on one line each candidate goes on its own line with the descriptors aligned:- <img srcset="/visual@0.5.png 400w, /visual.png 805w, /visual@2x.png 1610w, /visual@3x.png 2415w" /> + <img + srcset=" + /visual@0.5.png 400w, + /visual.png 805w, + /visual@2x.png 1610w, + /visual@3x.png 2415w + " + />
Fixed #11129:
noUnusedVariablesno longer reports Vue bindings as unused when they are assigned through automatically unwrapped template refs.Fixed CSS formatting of line comments between a declaration colon and value to preserve their source indentation.
.test { background: - /////// foo - // bar + /////// foo + // bar radial-gradient(circle, #000, transparent); }Fixed CSS formatting of long block comments between comma-separated property values:
.foo { box-shadow: - 1000px /* long long long long long long long long long long long long comment */ 1000px /* long long long long long long long long long comment */ 2px color(srgb 0.555555555 0.555555555 0.555555555), + 1000px + /* long long long long long long long long long long long long comment */ + 1000px /* long long long long long long long long long comment */ 2px + color(srgb 0.555555555 0.555555555 0.555555555), 1px 1px black; }The HTML formatter now picks the quote character for an attribute by counting the quotes in the value rather than looking only for a double quote.
'and"count as the characters they stand for, and only the character that ends up as the delimiter stays escaped:- <div title='123 '" 456'></div> + <div title="123 '" 456"></div>
Entities that are not quotes, such as
&or&[#39](https://github.com/biomejs/biome/issues/39);, are left exactly as written.Fixed the HTML formatter collapsing the blank line between an element and the text that follows it. A blank line before text is now kept, the way one before another element already was:
<div>foo</div> - text
The HTML formatter now writes the HTML5 doctype in lowercase, matching Prettier:
- <!DOCTYPE html> + <!doctype html>
This only applies to a plain
.htmlfile whose doctype stands alone. A doctype that names a DTD keeps the case it was written with, since the rest of the declaration is not lowercased either:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
A
.vue,.svelte, or.astrofile keeps whatever the author wrote.Fixed the HTML formatter printing a comment twice when it ended the line of the last element in a document:
- text<!-- a --><!-- a --> + text<!-- a -->
Fixed a bug where the HTML formatter collapsed the whitespace inside
<textarea>,<xmp>and<plaintext>, changing what the page renders.- <textarea> - line one - line two </textarea> + <textarea>line one line two</textarea>
Biome now prints the content of these elements exactly as it appears in the source, matching the existing behavior for
<pre>.Fixed the HTML formatter refusing to format a Svelte file containing an array pattern that skips a position:
{#each animals as [, value]} <p>{value}</p> {/each}Fixed
useSortedClassesto correctly detect unsorted classes in static member expression tagged templates (e.g.tw.div\...``). Previously, these were silently skipped due to surrounding whitespace trivia not being stripped from the tag name.Fixed Vue single-file components failing to parse when they contain a custom block such as
<i18n>or<docs>, or a<template>written in another language. Their content is no longer read as HTML, so a block may hold whatever its own tooling expects:<docs> This block is prose, and it may mention a `<my-component>` without closing it. </docs> <template lang="pug"> .test #foo </template>Previously both blocks produced a parse error and the whole file was left unformatted. Biome now prints their content unchanged while still formatting the opening tag.
Improved the performance of the following lint rules:
Clarified the warning emitted when using the experimental
jsonandjson-prettyreporters.Fixed #11171: variables referenced only inside a Svelte attachment (
{@attach ...}) are no longer reported as unused bynoUnusedVariablesandnoUnusedImports.Improved performance when printing diagnostics to the console.
Improved the performance of
noFloatingPromisesby skipping type inference for assignment statements, which are always considered handled.Fixed #11144:
noFloatingPromisesno longer reports already-awaited optional Promise values.Fixed #11121:
noUnnecessaryConditionsno longer reports conditions based on an inapplicable function overload.For example, the condition in the following code is no longer reported because
query({})selects the overload that returnsboolean:declare function query(options: { initial: string }): { isPending: false }; declare function query(options: { initial?: string }): { isPending: boolean }; const { isPending } = query({}); isPending || fallback;Improved the performance of collecting rule timings with
--profile-rulesin heavily multithreaded environments.Fixed #7635:
noDeprecatedImportsnow detects deprecated ambient declarations that are exported separately.Fixed #11014:
noDeleteno longer reportsprocess.env["FOO"]style property deletions.Added the nursery rule
noNonScalableViewport, which reports viewport metadata that disables user scaling withuser-scalable=no.For example:
<meta name="viewport" content="width=device-width, user-scalable=no" />
Improved the performance of
noImportCyclesby skipping graph traversals for imports that cannot be part of a cycle.Fixed CSS parsing of registered custom properties: Biome now correctly validates the
syntaxdescriptor of@propertyrules.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.