@biomejs/biome
2.6.8 · 15 Nov 2026MIT OR Apache-2.030.3M / weekRepositoryHomepagenpmAtom feed
In short
30 new5 faster33 fixed
Release note
The section about @biomejs/biome of a note shared by several packages.
Patch Changes
Added the nursery rule
noArrayDelete. It reports thedeleteoperator used on array elements, which leaves an empty slot in the array instead of removing the element. The rule needs type information, and offers an unsafe fix that replaces thedeletewith asplice()call.declare const array: number[]; delete array[0];
Added the nursery rule
noExpectToHaveBeenCalledOnce, which reportstoHaveBeenCalledOnce()andtoBeCalledOnce()assertions and suggeststoHaveBeenCalledTimes(1)andtoBeCalledTimes(1)instead. The rule belongs to thetestdomain.expect(sendEmail).toHaveBeenCalledOnce();
Added the new nursery rule
noImmediateMutation, which reports arrays, objects,Sets, andMaps that are changed in the statement right after they are created, and variables that are assigned right after they are declared.const array = [1, 2]; array.push(3); // reported: write `[1, 2, 3]` instead let foo; foo = 1; // reported: write `let foo = 1` instead
Added the nursery rule
noJasmineGlobals, which reports Jasmine globals in Jest tests, such asspyOn(),fail(),pending(), and thejasmineobject. Jest's default test runner doesn't provide them.jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
Added the nursery rule
noReturnInTest, which reportsreturnstatements directly inside the body of a test function. The rule belongs to thetestdomain.test("adds two numbers", () => { return expect(add(1, 2)).toBe(3); });Added the nursery rule
noTailwindConflictingClasses, which reports Tailwind CSS classes that set the same CSS properties on an element. Only one of the conflicting classes takes effect, so the other one does nothing.<div className="flex grid" />;
Added the nursery rule
noTestGlobals, which reports Jest and Vitest APIs that are used as global variables instead of being imported.describe("sum", () => {});Added the nursery rule
noTestHooks, which reports setup and teardown hooks in tests, such asbeforeEachandafterAll.beforeEach(() => { // reported cart = createCart(); });Added the nursery rule
noUnsafeSqliteInterpolation, which reports SQL strings that insert values with${}or use a tagged template when passed to theexec()andprepare()methods of anode:sqlitedatabase.import { DatabaseSync } from "node:sqlite"; const database = new DatabaseSync(":memory:"); database.exec(`SELECT * FROM users WHERE id = ${id}`);Added the new nursery rule
noUselessBind, which disallows.bind()calls on functions that don't usethis, and on arrow functions.const handler = function () { console.log("clicked"); }.bind(this); // reportedAdded the nursery rule
noUselessDefaultAssignment, which uses type information to report default values that can never be used, because the value they replace can't beundefined.function greet({ name = "friend" }: { name: string }) {} // reportedAdded the new nursery rule
noUselessNestedTernary, which reports nested ternary expressions that repeat a result of the expression around them. The conditions of such expressions can be combined with&&or||.const result = a ? (b ? c : d) : d;
Added the nursery rule
noUselessSetConstruction, which reports anew Set()that only copies a value used with aSetmethod such asunion()orisSubsetOf(). These methods accept aSetor aMapdirectly, don't change theSetthey are called on, and return a newSetwhen they combine values.const selected = new Set([1, 2]); const other = new Set([2, 3]); selected.union(new Set(other)); new Set(selected).union(other); new Set(selected.union(other));
Added the nursery rule
noVueDuplicateVElseIf, which reportsv-else-ifconditions in Vue templates that repeat, or are covered by, earlier conditions of the samev-if/v-else-ifchain.For example, the second element below can never be rendered:
<template> <div v-if="a || b" /> <div v-else-if="a" /> </template>
Added the new nursery rule
noVueNegationElse, which reports a negated condition inv-iforv-else-ifwhen av-elsebranch follows it. Its fix removes the negation and swaps the two branches.<template> <div v-if="!isLoading">Content</div> <!-- reported --> <div v-else>Loading...</div> </template>
Added the nursery rule
useBiomeKindSets, which reports Biome JS plugins that check thekindof a node or token against several strings. A kind set created withnodeKinds()ortokenKinds()reads the kind natively, which is faster.The rule belongs to the new
biomePlugindomain. Biome doesn't enable this domain automatically, so enable it in the linter configuration of your plugin project.if (node.kind === "JS_CALL_EXPRESSION" || node.kind === "JS_NEW_EXPRESSION") {}Added the nursery rule
useBiomeTopLevelTypes, which reports the use ofnodeKinds(),tokenKinds(), orunion()inside a function. The rule belongs to thebiomePlugindomain.import { defineRule, nodeKinds } from "@biomejs/runtime/plugin"; export const rule = defineRule({ run(node) { return nodeKinds("JS_CALL_EXPRESSION").has(node); }, });Added the new nursery rule
useConsistentIndexedObjectStyle, which requires one style for object types with arbitrary keys. By default, it requires theRecordtype instead of index signatures and mapped types.// reported, prefer `Record<string, number>` interface Scores { [name: string]: number; }Added the nursery rule
useDescribeFunctionTitle, which reports test suites (describeblocks) whose title is a string or a.nameproperty that repeats the name of an imported value, and suggests passing the value itself as the title.import { myFunction } from "./myFunction"; describe("myFunction", () => {}); // reportedAdded the nursery rule
useEarlyContinue, which reports anifstatement that wraps the rest of a loop body and suggests skipping the iteration early withcontinueinstead.for (const item of items) { if (item.isActive) { process(item); save(item); } }Added the nursery rule
useExpectToHaveLength, which reports tests that check thelengthproperty withtoBe(),toEqual(), ortoStrictEqual(), and suggests usingtoHaveLength()instead.expect(files.length).toBe(1);
Added the nursery rule
useExpectToStrictEqual, which reports tests that compare values withtoEqual(), and suggests usingtoStrictEqual()instead.toEqual()ignores properties set toundefined, so the following test passes even though the two objects are different.expect({ a: "a", b: undefined }).toEqual({ a: "a" });Added the new nursery rule
useTanstackQueryExhaustiveDependencies, which reports TanStack Query options whosequeryKeydoesn't include every value thatqueryFnuses. When the key misses a value, changing that value doesn't fetch new data, and the query keeps returning data for the old value.function Todo({ todoId }) { useQuery({ queryKey: ["todo"], queryFn: () => fetchTodo(todoId), }); }Added the nursery rule
useTanstackQueryMutationPropertyOrder, which requiresonMutateto come beforeonErrorandonSettledin the options of TanStack Query'suseMutation. The type of the value thatonMutatereturns can be wrong in a property that comes before it.import { useMutation } from "@tanstack/react-query"; useMutation({ mutationFn: (todo) => saveTodo(todo), onError: (error, todo, saved) => restoreTodo(saved.previousTodo), onMutate: (todo) => ({ previousTodo: readTodo(todo.id) }), });Added the nursery rule
useTopLevelDescribe, which reports tests and hooks that are not inside adescribeblock. ThemaxTopLevelDescribesoption also limits how many top-leveldescribeblocks a file can have.test("adds two numbers", () => {});Improved the performance of GritQL plugins on files with many matches. Evaluation time no longer grows quadratically with the number of matches.
Improved Astro cross-language JavaScript analysis by resolving embedded bindings and references through Astro scopes instead of document-wide name matching.
Fixed #12818:
useFilenamingConventionnow reports a filename diagnostic once per HTML, Vue, Svelte, or Astro document instead of once per embedded JavaScript snippet.Improved how Biome aligns edits in diagnostic fix previews. Suggested fixes now group nearby edits more clearly, which can change which repeated lines are shown as unchanged.
Fixed #13267:
biome migrate prettiernow enablesmarkdown.parser.frontmatter, matching Prettier's parsing of YAML frontmatter in Markdown files.Implemented the runtime default-export case from #11463 with the new
noAstroComponentDefaultExportnursery rule. The rule reports runtime default exports in Astro component frontmatter while allowing named and type-only exports.--- export default function render() {} ---Fixed #12956:
useImportTypenow distinguishes Astro template type and value uses, whileuseConstandnoVaraccount for template writes. Cross-language references now prevent unsafe unused-variable rename suggestions.Fixed #5242: the HTML-family formatter now collapses whitespace in static
classattributes and formats validstyleattributes as inline CSS declarations. Component props, dynamic Astro template values, and style attributes containing invalid CSS remain conservative. Embedded replacements also recompute parent layout so formatting converges in one pass.-<div class=" card selected " style="color:red;font-size:10px"></div> +<div class="card selected" style="color: red; font-size: 10px;"></div>
Fixed #12956: React, React Native, and Next.js rules that rely on framework-specific JSX behavior no longer report Astro template expressions. Mixed-framework projects can enable those rule domains without receiving React- or Next-specific diagnostics for Astro markup such as
<head>,<img>, componentchildrenprops, string refs, Astro list rendering, or Polyfill.io scripts.Fixed #9768:
noDescendingSpecificityno longer reports nested selectors that style different elements. The following code is now valid:.aaa { ul li { &:hover { color: #1684fc; } } } .bbb { a { &:hover { background: #fff; } } }The rule now reports
a:hover { color: red; }followed bya { color: blue; }, as Stylelint does, and ignores rules without declarations.Fixed the detection of
describeblocks in the test rulesnoIdenticalTestTitle,useTestHooksOnTop, anduseTestHooksInOrder. These rules treateddescribe.todo,describe.shuffle,test.describe.parallel, andtest.describe.serialas tests, and they didn't recognize conditional blocks such asdescribe.skipIf(condition)("title", () => {}). As a result, they didn't check the tests and hooks inside those blocks.For example,
noIdenticalTestTitlenow reports the second test:test.describe.serial("checkout", () => { test("pays", async ({ page }) => {}); test("pays", async ({ page }) => {}); });The nursery rule
useValidTestTitlenow also checks the titles of tagged-template tables such astest.each`table`("title", () => {})and of conditional calls such astest.skipIf(condition)("title", () => {}).Fixed
useNullishCoalescingreportinginert || undefinedwheninertis destructured with a default value, such as{ inert = false }.Fixed
noDuplicateSelectorsmissing some duplicates. The rule now reports these selectors:.c:is(.a .b) {} :is(.a .b).c {} [data-progress="50%"] {} [data-progress="50%"] {}Fixed #13258: the HTML parser no longer panics when a CDATA section starts with a second
<![CDATA[marker. The marker is kept as literal text.Fixed #13299: the HTML formatter no longer adds a line break between whitespace-sensitive siblings that touch in the source, such as an element next to a self-closing element, a Svelte
{@render}tag, or a text expression. The line break rendered as a space that wasn't in the source.<p> - <span class="label">label</span><img src="image.png"> - <span class="hint">hint</span> + <span class="label">label</span><img src="image.png"><span class="hint" + >hint</span + > </p>
Fixed #13178: the JS parser no longer panics on
import.deferorimport.sourcewhen either is parsed as an expression without a following parenthesized argument list. It reports a syntax error instead.Fixed #13268: the Markdown formatter no longer pairs emphasis markers across paragraphs of a blockquote.
-> a _**, b +> a ___, b > -> c 20**. +> c 20__.
Fixed #13334: the Markdown formatter now uses
indentWidthto indent the content of list items, as Prettier does withtabWidth. Some content keeps its current alignment, such as blockquotes, HTML blocks, and lists inside blockquotes.With
indentWidthset to4:- parent - second paragraph - - child + second paragraph + - child
Fixed a Markdown parser hang on block quote lines that contain only spaces after the
>. For example, Biome no longer hangs when the second line below has two or more spaces after the>:- > - a >
Fixed the HTML formatter adding a line break between a Svelte block (
{#if},{#each},{#await},{#key},{#snippet}) or tag ({@const},{let},{@debug}) and a sibling that touches it in the source. Svelte keeps that line break as a text node, so the page rendered a space that wasn't in the source.<p> - Total: - {#each items as item} + Total:{#each items as item} <b>{item}</b> - {/each} - . + {/each}. </p>Fixed #12707:
useValidAriaValuesno longer reports Astro template-literal attributes that contain substitutions because their runtime value is unknown. Static template-literal attributes remain checked.Fixed
noFloatingPromises, which now detects unhandled promises returned through generic class methods, such asfactory.create<Promise<void>>().Improved the performance of GritQL plugins, especially for plugins that report many matches in large files.
Fixed #12956:
noUndeclaredVariablesnow respects Astro server and client scopes,define:vars, and type/value namespaces.noUnusedVariables,noUnusedImports, andnoUnusedFunctionParametersnow follow resolved Astro symbols and treat write-only template references as unused.Improved performance of all parsers. On large projects,
biome lintis up to 1.7% faster.Fixed #12956: Biome now leaves the contents of unsupported
<script>and<style>blocks unchanged instead of trying to format them as JavaScript or CSS. This includes embedded languages such as Less, SCSS, PostCSS, CoffeeScript, and customlangortypevalues.<style lang="less"> @color: red; .card { color: @color; } </style> <script lang="coffee"> square = (value) -> value * value </script>Malformed Astro frontmatter, expressions, scripts, and styles also retain their original text while Biome formats the surrounding markup.
Added the nursery rule
noCanvasToImage, which reports canvases that are converted to an image or copied pixel by pixel only to be drawn onto another canvas. Pass the canvas todrawImage()instead.const image = await loadImage(canvas.toDataURL()); context.drawImage(image, 0, 0);
Added trivia APIs to JavaScript plugins.
leadingTrivia()andtrailingTrivia()on nodes and tokens return the whitespace, line breaks, and comments around them, andleadingComments()andtrailingComments()on tokens return only the comments. Each piece has anisComment()method.registerDiagnostic()now also accepts tokens and trivia pieces, and highlights only that element.const keyword = statement.declaration.token("kindToken"); for (const comment of keyword.leadingComments()) { if (comment.text.includes("TODO")) { registerDiagnostic(comment, "warning", "Resolve this TODO."); } }Improved the performance of linting with many rules enabled, such as Biome's recommended rules. In exchange, Biome can use more memory, because each thread now keeps some freed memory for reuse.
Fixed
.editorconfigsection globs that have a negative number in a numeric range.[{-3..3}]now matches the files named-3to3, instead of only a file named{-3..3}.Fixed a crash when a dependency's
package.jsonmaps anexportsentry to its own package name, such as"exports": { "sass": "my-package" }. Like Node.js, Biome now rejectsexportstargets that don't start with./.Fixed
noUnusedClassesreporting classes of SCSS partials loaded with@use,@forwardor@import. Biome now resolves these loads the way Sass does, including partials such as_card.scss,indexfiles, and import-only files, so a class in_card.scsscounts as used when a component importsstyles.scss, which contains@use "card".Made
noArrayForEach,noArraySortForMinMax,noBooleanSortComparator,noNegatedArrayPredicate,noReturnArrayPush, anduseIteratorZipagree on which values are known not to be arrays. They now all ignore calls on literals, object literals, functions, classes,newexpressions other thannew Array()or a typed array, and variables whose type annotation, type alias, orconstvalue is one of those or a built-in type such asMap,Set, orstring | undefined. A type declared in the file with the same name as a built-in type, such astype Set<T> = T, is no longer treated as the built-in type.// No longer reported by noArrayForEach new Collection().forEach((value) => console.log(value));
Improved the performance of
biome lint,biome check, andbiome cion Linux. Biome now spends less time in the operating system for each file it analyzes, so linting large projects is faster.Fixed range formatting in the editor for Vue, Svelte, and Astro files when full HTML support is disabled. Selections that end before the script block no longer format it or report an error, and edits for selections inside the script block are now applied at the selected location.
Recognized Astro
<style define:vars>keys as custom-property declarations. ThenoUndeclaredCustomPropertiesrule now accepts statically supplied variables and avoids diagnostics when dynamic keys may provide a declaration.Fixed #10547: Astro files can now place
<!doctype html>after top-level elements such as inline scripts without parse errors, and formatting preserves the source order.-<script is:inline>console.log("ready");</script> +<script is:inline> + console.log("ready"); +</script> <!doctype html>Fixed #13257: untitled VS Code documents now use their existing workspace project, retain it across workspace-folder removal and re-addition, avoid creating projects from non-file URIs, and preserve URI extensions for language detection.
Fixed #13335: Svelte
{#snippet}blocks with type parameters, such as{#snippet row<T extends string>(item: T)}, are now parsed and formatted. Invalid snippet signatures no longer make the linter panic.Fixed #12317 and #12984: VCS ignore matching now preserves logical paths for external and symlinked inputs, normalizes stdin paths, combines coexisting
.gitignoreand.ignorerules, respects nested ignore precedence and Git's repository exclude file, and reloads ignore state when ignore files change.Fixed #12349: Biome now reads quote character references, such as
"and&[#39](https://github.com/biomejs/biome/issues/39);, as string quotes in the CSS of HTML and SVGstyleattributes. Valid values such asfont-family: "Rotis Sans"no longer produce CSS parse diagnostics.Updated the Baseline data of the
useBaselinerule. The rule now reports CSS features according to their latest Baseline status.
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.