@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
33 new17 fixed
Release note
The section about @biomejs/biome of a note shared by several packages.
Patch Changes
Added the new nursery rule
noArraySortForMinMax, which reports sorting an array only to read its smallest or largest value. UseMath.min()orMath.max()instead.const minimum = array.toSorted((a, b) => a - b)[0];
Added the nursery rule
noBooleanSortComparator, which reports sort comparators that return a boolean instead of a number. For example,array.sort((a, b) => a > b)never puts the first item before the second, so the array isn't sorted correctly.Added the new nursery rule
noEagerArrayMethodsInLoops, which reports.map()and.filter()calls in the header offor...ofloops. These calls build a new array that is only used by the loop.for (const name of users.map((user) => user.name)) { console.log(name); }Added the nursery rule
noNewRequire, which disallows callingrequirewithnew, such asnew require("app-header").Added the new nursery rule
noObsoleteAttributes, which disallows obsolete attributes on HTML elements and suggests what to use instead.<table bgcolor="#ffffff" cellpadding="5"></table>
Added the nursery rule
noPathConcat, which disallows building file paths and URLs by joining strings to__dirname,__filename,import.meta.dirname,import.meta.filename, orimport.meta.url.const fullPath = __dirname + "/foo.js"; // reported
Added the new nursery rule
noPlaywrightNthMethods, which disallows selecting Playwright elements by position withfirst(),last(), andnth(). A test that relies on the position of an element can act on a different element when the page changes.await page.locator("button").first().click();Added the nursery rule
noSelfNestedLayer, which disallows nesting a cascade layer inside a layer with the same name. Layer names inside an@layerblock are relative to it, so the inner layer below creates the sublayercomponents.componentsinstead of adding tocomponents.@layer components { @layer components { .button { color: red; } } }Added the nursery rule
noShortTimeValues, which reports CSS animation and transition times that are shorter than the configuredminimumnumber of milliseconds. The rule does nothing untilminimumis set.For example, the following code is invalid when
minimumis100:a { transition-duration: 80ms; }Added the nursery rule
noSvelteInternal, which disallows importing fromsvelte/internaland its submodules. These modules are private to Svelte and can change or disappear in any release.import { get_current_component } from "svelte/internal";Added the nursery rule
noTanstackQueryRestDestructuring, which disallows rest destructuring and object spread on TanStack Query results. Both read every property of the result, so the component updates on every change to the query.import { useQuery } from "@tanstack/react-query"; const { data, ...rest } = useQuery({ queryKey: ["todos"], queryFn: fetchTodos });The rule belongs to the new
tanstackQuerydomain.Added the new nursery rule
noUnreadableForOfExpression, which reportsfor...ofandfor await...ofloops that go through the result of a complex expression instead of a variable, a property, or a short call.for (const item of getItems(createArgument(seed))) {} // reportedAdded the new nursery rule
noUnsafeReturn, which disallows returning a value typed asanyfrom a function.function parse(text: string) { return JSON.parse(text); // reported }Added the nursery rule
noUselessSplice, which reportssplice()calls that have a simpler alternative. For example,array.splice(0, 1)can be written asarray.shift().Added the nursery rule
noVueUnusedEmitDeclarations, which reports events that a Vue component declares but never emits.For example, the following component never emits
close:<script setup> const emit = defineEmits(["change", "close"]); emit("change"); </script>Added the nursery rule
noVueVTextVHtmlOnComponent, which disallowsv-textandv-htmlon Vue components. These directives replace everything inside the component's root element instead of filling its slot.<template> <MyComponent v-html="html"></MyComponent> </template>
Added the new nursery rule
noVueWatchAfterAwait, which disallows creating watchers after anawaitin a Vue component'ssetup()function. Vue doesn't stop these watchers when the component is removed. A watcher is allowed when the function it returns is stored, so that function can be called later to stop the watcher.<script> import { watch } from "vue"; export default { async setup() { await fetchUser(); watch(source, () => {}); }, }; </script>Added the nursery rule
noZeroLengthUnit, which disallows units on zero lengths in CSS. Biome can remove the unit.a { top: 0px; }Added the nursery rule
useBlockStatementOverIife, which reports functions that are called immediately when a block statement can replace them. Biome can replace these functions with a block statement.Invalid:
(() => { const value = getValue(); run(value); })();Added the nursery rule
useConsistentLightnessNotation, which enforces writing the lightness oflab(),lch(),oklab(), andoklch()colors as a percentage, or as a number with thenotationoption. For example, with the default options,oklch(0.85 0.17 88)is reported and can be fixed tooklch(85% 0.17 88).Added the nursery rule
useExpectToContain, which reports tests that compare the result ofincludes()to a boolean, and suggests usingtoContain()instead.expect(fruits.includes("apple")).toBe(true);Added the new nursery rule
useIteratorZip, which reportsforloops that use an index only to read the same position from several arrays. Such loops can useIterator.zip()instead.// reported for (let index = 0; index < Math.min(names.length, scores.length); index++) { save(names[index], scores[index]); }Added the nursery rule
useMathAbs, which reports manual absolute value calculations and range checks that can useMath.abs(). For example,value < 0 ? -value : valuecan be written asMath.abs(value), andvalue > limit || value < -limitcan be written asMath.abs(value) > limit.Added the nursery rule
useMathTrunc, which requiresMath.trunc()instead of bitwise operations orparseInt(String(x), 10)for removing the decimal part of a number. For example,const result = value | 0;andconst result = ~~value;are now reported.Added the new nursery rule
usePackageJsonValidCpu, which reports acpufield inpackage.jsonthat isn't an array of known processor types. Thecpufield lists the processor types that the package supports.For example, the rule reports the following
package.jsonfile becausex86isn't a processor type that package managers recognize:{ "name": "my-package", "cpu": ["x86"] }Added the nursery rule
usePackageJsonValidEngines, which reports an invalidenginesfield inpackage.json. The field must be an object, and each of its values must be a non-empty string.For example, the following
enginesfield is reported because the version ofnodeis a number:{ "engines": { "node": 24 } }Added the nursery rule
useVueComponentIs, which requires Vue<component>elements to bind theisattribute with:isorv-bind:is. Without it, Vue has no component to render.<template> <component :is="currentView" /> </template>
Added the nursery rule
useVueToggleInsideTransition, which requires the element inside a Vue<Transition>to be shown and hidden withv-iforv-show. Without one of them, the element is always shown and the transition never plays.<template> <Transition> <div>Content</div> </Transition> </template>Added the nursery rule
useVueTypedRef, which reportsref()andshallowRef()calls in TypeScript that have no type argument and no initial value other thannullorundefined. Without a type, TypeScript can't tell which values these refs are meant to hold.import { ref } from "vue"; const count = ref();Added the nursery rule
useVueVOnExact, which requires the.exactmodifier on av-onlistener when another listener for the same event on the element needs more modifier keys, such as.ctrl. Without.exact, both listeners run when those keys are held down. The rule accepts the following code:<template> <button @click.exact="select" @click.ctrl="open"></button> </template>
Fixed #12417:
useSortedPropertiescould produce invalid CSS when sorting properties without a final semicolon. Comments attached to reordered properties are preserved.Added the new nursery rule
noDanglingUnderscore, which disallows variable names, function names, and property accesses that start or end with an underscore.const _count = 0; // reported user._id; // reported
Fixed the formatter removing the parentheses around an instantiation expression before
+,-,<,>,>=,>>and>>>. TypeScript readsmake<T> + yasmake < T > +y, andmake<T> >> ydoesn't parse.- x = make<T> + y; + x = (make<T>) + y; - x = make<T> >> y; + x = (make<T>) >> y;
Fixed the formatter removing the parentheses around an instantiation expression before a non-null assertion or type arguments of a class heritage, which produced code that doesn't parse.
- const a = make<T>!; + const a = (make<T>)!; - class D extends B<T><T> {} + class D extends (B<T>)<T> {}Fixed the formatter removing the parentheses around binary, logical, type-cast and instantiation operands of an instantiation expression. The type arguments then applied to the last operand only, and a nested instantiation expression didn't parse.
- const x = a + b<T>; + const x = (a + b)<T>; - const y = a as B<T>; + const y = (a as B)<T>; - const z = f<A><B>; + const z = (f<A>)<B>;
Fixed #12524: the Markdown formatter no longer removes the blank line between a paragraph and the list that follows it. Removing it could change the document, because an ordered list that doesn't start at
1can't interrupt a paragraph and became part of the paragraph text.Steps: 3. three 4. four
Fixed #12507: the Markdown formatter no longer drops the
>markers after an empty quote line whenproseWrapis"always"or"never". Previously, the text after the empty line was moved out of the blockquote.> a > - b + > b
Fixed the formatter removing the parentheses around the callee of a
newexpression when it contains a dynamicimport()call, which produced code that doesn't parse.- new import("foo").bar(); + new (import("foo").bar)();Fixed #12502:
noInvalidGridAreasnow counts the cells in each row ofgrid-template-areasinstead of comparing the length of the row text. Rows such as"a" "bb"are no longer reported, and rows such as"abc" "d e"are now reported.Fixed #12529:
noUselessElseno longer reports anelseclause when theifblock ends with aswitchstatement that has nodefaultclause. If no case matches, such aswitchdoesn't exit, so theelseclause is needed.Fixed #12505:
useDomNodeTextContentno longer reportsinnerTexton values whose type annotation shows they aren't DOM nodes. The following code is now valid:const Link = ({ innerText }: { innerText: string }) => <a>{innerText}</a>;Fixed
noDescendingSpecificityto compare resolved nested selector targets. Biome no longer reports nested selectors that resolve to different targets, detects equivalent explicit and nested targets, and emits one diagnostic when a parent selector list expands the same nested selector multiple times.For example, the following selectors are no longer reported because their final targets are
.columnandcode, respectively:.card { .column { :root[data-theme="dark"] & {} } code { :root[data-theme="dark"] & {} } }Improved the diagnostics of
noIdenticalTestTitle. Biome now reports one diagnostic per repeated title, pointing at the first occurrence and at every later occurrence, instead of one diagnostic per duplicate.Fixed #12503:
noUnknownPropertynow checks SCSS nested properties by the name Sass emits for them. For example,radiusinborder: { radius: 4px; }is checked asborder-radiusand is no longer reported, whilecolorinfont: { color: red; }is checked asfont-colorand is now reported.Added the nursery rule
useConsistentUnicodeBom, which disallows a leading Unicode byte order mark by default and can require one withbom: "always". The rule supports JavaScript, TypeScript, JSON, CSS, GraphQL, HTML, and Markdown, provides a fix, and preserves theunicode-bomoption during ESLint migration.The following example is invalid by default because it starts with an invisible U+FEFF character:
const value = 1;
Added the nursery rule
useReactNativeValidPlatformColors, which requiresPlatformColor()andDynamicColorIOS()calls to use values written directly in the call, so React Native can optimize them.import { PlatformColor } from "react-native"; const labelColor = "labelColor"; const color = PlatformColor(labelColor);Fixed #12532: checking the project root no longer applies
files.includesexclusions to directories above the project.Fixed GraphQL parsing and formatting for executable descriptions and legacy fragment variables. Biome now formats inputs such as
"Description" query { field }without panicking and removes insignificant commas consistently.Fixed #12555: the default reporter now prints the command summary, the
--max-diagnosticswarning, and the skipped-fixes notice to stderr instead of stdout. Diagnostics already go to stderr, so the summary can no longer get mixed into the middle of a diagnostic when a tool reads the two streams separately.Fixed #12412:
useSortedPropertiesnow sorts properties inside@keyframesanimations in CSS and SCSS.
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.