Packages

@biomejs/biome

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

Your version

2.4.11

9 Apr 2026Where it was published

2.6.9 is the newest release of 2.x.

In short

6 new29 fixed

Release note

Patch Changes

  • Added the new nursery rule useConsistentTestIt in the test domain. The rule enforces consistent use of either it or test for test functions in Jest/Vitest suites, with separate control for top-level tests and tests inside describe blocks.

    Invalid:

    test("should fly", () => {}); // Top-level test using 'test' flagged, convert to 'it'
    
    describe("pig", () => {
      test("should fly", () => {}); // Test inside 'describe' using 'test' flagged, convert to 'it'
    });
  • Added the new nursery lint rule useExplicitReturnType. It reports TypeScript functions and methods that omit an explicit return type.

    function toString(x: any) {
      // rule triggered, it doesn't declare a return type
      return x.toString();
    }
  • Fixed #9484: the formatter no longer panics when formatting files that contain graphql tagged template literals combined with parenthesized expressions.

  • Fixed an issue where, occasionally, some bindings and references were not properly tracked, causing false positives from noUnusedVariables and noUndeclaredVariables in Svelte, Vue, and Astro files.

  • Fixed #4093: the noDelete rule no longer triggers for delete process.env.FOO, since delete is the documented way to remove environment variables in Node.js.

  • Added the rule noMisleadingReturnType. The rule detects when a function's return type annotation is wider than what the implementation actually returns.

    // Flagged: `: string` is wider than `"loading" | "idle"`
    function getStatus(b: boolean): string {
      if (b) return "loading";
      return "idle";
    }
  • Improved the diagnostics for useFind to better explain the problem, why it matters, and how to fix it.

  • Improved performance of fix-all operations (--write). Biome is now smarter when it runs lint rules and assist actions. First, it runs only rules that have code fixes, and then runs the rest of the rules.

  • Add a new lint rule useDisposables for JavaScript, which detects disposable objects assigned to variables without using or await using syntax. Disposable objects that implement the Disposable or AsyncDisposable interface are intended to be disposed of after use. Not disposing them can lead to resource or memory leaks, depending on the implementation.

    Invalid:

    function createDisposable(): Disposable {
      return {
        [Symbol.dispose]() {
          // do something
        },
      };
    }
    
    const disposable = createDisposable();

    Valid:

    function createDisposable(): Disposable {
      return {
        [Symbol.dispose]() {
          // do something
        },
      };
    }
    
    using disposable = createDisposable();
  • Fixed #7760: Added support for CSS scroll-driven animation timeline-range-name keyframe selectors (cover, contain, entry, exit, entry-crossing, exit-crossing). Biome no longer reports parse errors on keyframes like entry 0% { ... } or exit 100% { ... }.

  • Fixed #9696: Astro frontmatter now correctly parses regular expression literals like /\d{4}/.

  • Fixed #8409: CSS formatter now correctly places comments after the colon in property declarations.

    Previously, comments that appeared after the colon in CSS property values were incorrectly moved before the property name:

    [lang]:lang(ja) {
    -  /* system-ui,*/ font-family:
    +  font-family: /* system-ui,*/
        Hiragino Sans,
        sans-serif;
    }
  • Fixed #1630: LSP project selection now prefers the most specific project root in nested workspaces.

  • Fixed #9118: noUnusedImports no longer reports false positives for default imports used inside Svelte, Vue and Astro components.

  • Fixed a parser diagnostic's message when vue syntax is disabled so that it no longer references the non-existant html.parser.vue option. This option will become available in 2.5.

  • Improved the diagnostics for useRegexpExec to better explain the problem, why it matters, and how to fix it.

  • Fixed #9140: Biome now parses Astro's attribute shorthand inside .astro files. The following snippet no longer reports a parse error:

    ---
    const items = ['a', 'b'];
    ---
    <ul>
      {items.map((item) => <li {item}>row</li>)}
    </ul>
  • Fixed #9781: Trailing comments after a top-level biome-ignore-all format suppression are now preserved instead of being dropped. This applies to JavaScript, CSS, HTML, JSONC, GraphQL, and Grit files.

  • Fixed #9741: the LSP server now correctly returns the organizeImports code action when the client requests it via source.organizeImports.biome in the only filter. Previously, editors with codeAction/resolve support (e.g. Zed) received an empty response because the action was serialized with the wrong kind (source.biome.organizeImports instead of source.organizeImports.biome).

  • Improved the diagnostics for useArraySome to better explain the problem, why it matters, and how to fix it.

  • Relaxed useExplicitType for trivially inferrable types.

    Type annotations can now be omitted when types are trivially inferrable from:

    • Binary expressions (const sum = 1 + 1)

    • Comparison expressions (const isEqual = 'a' === 'b', const isTest = process.env.NODE_ENV === 'test')

    • Logical expressions (const and = true && false)

    • Class instantiation (const date = new Date())

    • Array literals (const arr = [1, 2, 3])

    • Conditional expressions (const val = true ? 'yes' : 'no')

    • Function calls (const num = Math.random())

    • Parameter defaults - any expression is now allowed (const fn = (max = MAX_ATTEMPTS) => ...)

    Comparison expressions always return boolean, so any operands are now allowed
    (including property access like process.env.NODE_ENV).

    Parameters with default values no longer require type annotations, as TypeScript
    can infer the type from the default value (even when referencing variables).

    Also removed the redundant any type validation from this rule. The any type
    is now only validated by the dedicated noExplicitAny rule, following the
    Single Responsibility Principle.

  • Added the new nursery rule useQwikLoaderLocation, which enforces that Qwik loader functions are declared in the correct location.

  • Fixed #9136 and #9653: noUndeclaredVariables and noUnusedVariables no longer report false positives on several Svelte template constructs that declare or reference bindings in the host grammar:

    • {#snippet name(params)} — the snippet name and its parameters (including object, array, rest, and nested destructuring) are now tracked.

    • {@render name(args)} — the snippet name used at the render site is now resolved against the snippet declaration.

    • {#each items as item, index (key)} — the item binding (plain identifier or destructured), the optional index, and the optional key expression are now tracked.

    • {@const name = value} — the declared name is now tracked as a binding and the initializer is analyzed for undeclared references.

    • {@debug a, b, c} — each debugged identifier is now analyzed and reported if undeclared.

    • Shorthand attributes <img {src} /> — the curly-shorthand attribute is now analyzed as an expression, so undeclared references inside it are reported.

    For example, the following template no longer triggers either rule:

    <script>
    let items = [];
    let total = 0;
    </script>
    
    {#snippet figure(image)}
        <figure>
            <img src={image.src} alt={image.caption} />
            <figcaption>{image.caption}</figcaption>
        </figure>
    {/snippet}
    
    {#each items as item}
        {@const price = item.price}
        {@render figure(item)}
        <span>{price}</span>
    {/each}
    
    {@debug items, total}
  • Updated noDuplicateFieldDefinitionNames to also flag duplicate fields within type extensions, interface extensions & input extensions.

  • Fixed Grit queries that use native Biome AST node names with the native field names that are in our .ungram grammar files. Queries such as JsConditionalExpression(consequent = $cons, alternate = $alt) now compile successfully in biome search and grit plugins.

  • Updated noImpliedEval to flag new Function() usages, as its a form of indirect eval, and to include no-new-func as a rule source.

  • Marked eslint-qwik-plugin's unused-server as redundant since it was covered by noUnusedVariables.

  • Added the new nursery rule noUselessTypeConversion, which reports redundant primitive conversion patterns such as String(value) when value is already a string.

  • useNullishCoalescing now also detects ternary expressions that check for null or undefined and suggests rewriting them with ??. A new ignoreTernaryTests option allows disabling this behavior.

  • Fixed #9690: biome check --write is now idempotent on HTML files that contain embedded <style> or <script> blocks. Previously, each run reported "Fixed 1 file" even when the file content did not actually change, because the embedded language formatter's output was not re-indented to match the surrounding HTML block.

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.