Packages

@biomejs/biome

2.6.8 · 15 Nov 2026MIT OR Apache-2.030.3M / weekRepositoryHomepagenpmAtom feed

Your version

2.6.3

24 Oct 2026Where it was published

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. Use Math.min() or Math.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 of for...of loops. 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 calling require with new, such as new 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, or import.meta.url.

    const fullPath = __dirname + "/foo.js"; // reported
  • Added the new nursery rule noPlaywrightNthMethods, which disallows selecting Playwright elements by position with first(), last(), and nth(). 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 @layer block are relative to it, so the inner layer below creates the sublayer components.components instead of adding to components.

    @layer components {
      @layer components {
        .button {
          color: red;
        }
      }
    }
  • Added the nursery rule noShortTimeValues, which reports CSS animation and transition times that are shorter than the configured minimum number of milliseconds. The rule does nothing until minimum is set.

    For example, the following code is invalid when minimum is 100:

    a {
      transition-duration: 80ms;
    }
  • Added the nursery rule noSvelteInternal, which disallows importing from svelte/internal and 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 tanstackQuery domain.

  • Added the new nursery rule noUnreadableForOfExpression, which reports for...of and for await...of loops 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))) {} // reported
  • Added the new nursery rule noUnsafeReturn, which disallows returning a value typed as any from a function.

    function parse(text: string) {
      return JSON.parse(text); // reported
    }
  • Added the nursery rule noUselessSplice, which reports splice() calls that have a simpler alternative. For example, array.splice(0, 1) can be written as array.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 disallows v-text and v-html on 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 an await in a Vue component's setup() 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 of lab(), lch(), oklab(), and oklch() colors as a percentage, or as a number with the notation option. For example, with the default options, oklch(0.85 0.17 88) is reported and can be fixed to oklch(85% 0.17 88).

  • Added the nursery rule useExpectToContain, which reports tests that compare the result of includes() to a boolean, and suggests using toContain() instead.

    expect(fruits.includes("apple")).toBe(true);
  • Added the new nursery rule useIteratorZip, which reports for loops that use an index only to read the same position from several arrays. Such loops can use Iterator.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 use Math.abs(). For example, value < 0 ? -value : value can be written as Math.abs(value), and value > limit || value < -limit can be written as Math.abs(value) > limit.

  • Added the nursery rule useMathTrunc, which requires Math.trunc() instead of bitwise operations or parseInt(String(x), 10) for removing the decimal part of a number. For example, const result = value | 0; and const result = ~~value; are now reported.

  • Added the new nursery rule usePackageJsonValidCpu, which reports a cpu field in package.json that isn't an array of known processor types. The cpu field lists the processor types that the package supports.

    For example, the rule reports the following package.json file because x86 isn't a processor type that package managers recognize:

    {
      "name": "my-package",
      "cpu": ["x86"]
    }
  • Added the nursery rule usePackageJsonValidEngines, which reports an invalid engines field in package.json. The field must be an object, and each of its values must be a non-empty string.

    For example, the following engines field is reported because the version of node is a number:

    {
        "engines": {
            "node": 24
        }
    }
  • Added the nursery rule useVueComponentIs, which requires Vue <component> elements to bind the is attribute with :is or v-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 with v-if or v-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 reports ref() and shallowRef() calls in TypeScript that have no type argument and no initial value other than null or undefined. 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 .exact modifier on a v-on listener 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: useSortedProperties could 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 reads make<T> + y as make < T > +y, and make<T> >> y doesn'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 1 can'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 when proseWrap is "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 new expression when it contains a dynamic import() call, which produced code that doesn't parse.

    - new import("foo").bar();
    + new (import("foo").bar)();
  • Fixed #12502: noInvalidGridAreas now counts the cells in each row of grid-template-areas instead 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: noUselessElse no longer reports an else clause when the if block ends with a switch statement that has no default clause. If no case matches, such a switch doesn't exit, so the else clause is needed.

  • Fixed #12505: useDomNodeTextContent no longer reports innerText on 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 noDescendingSpecificity to 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 .column and code, 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: noUnknownProperty now checks SCSS nested properties by the name Sass emits for them. For example, radius in border: { radius: 4px; } is checked as border-radius and is no longer reported, while color in font: { color: red; } is checked as font-color and is now reported.

  • Added the nursery rule useConsistentUnicodeBom, which disallows a leading Unicode byte order mark by default and can require one with bom: "always". The rule supports JavaScript, TypeScript, JSON, CSS, GraphQL, HTML, and Markdown, provides a fix, and preserves the unicode-bom option 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 requires PlatformColor() and DynamicColorIOS() 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.includes exclusions 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-diagnostics warning, 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: useSortedProperties now sorts properties inside @keyframes animations 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.