Packages

@biomejs/biome

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

Your version

2.5.0

12 Jun 2026Where it was published

2.6.9 is the newest release of 2.x.

In short

1 security103 new3 faster45 fixed

Release note

Minor Changes

  • Added a new reporter called concise. When --reporter=concise is passed the commands format, lint, check and ci, the diagnostics are printed in a compact manner:

    ! index.ts:2:10: lint/correctness/noUnusedImports: Several of these imports are unused.
    ! main.ts:9:7: lint/correctness/noUnusedVariables: This variable f is unused.
    × index.ts:8:5: lint/suspicious/noImplicitAnyLet: This variable implicitly has the any type.
    × main.ts:2:10: lint/suspicious/noRedeclare: Shouldn't redeclare 'z'. Consider to delete it or rename it.
  • Added the useKeyWithClickEvents a11y lint rule for HTML files (.html, .vue, .svelte, .astro). This is a port of the existing JSX rule. The rule enforces that elements with an onclick handler also have at least one keyboard event handler (onkeydown, onkeyup, or onkeypress) to ensure keyboard accessibility.

    Inherently keyboard-accessible elements (<a>, <button>, <input>, <select>, <textarea>, <option>) are excluded, as are elements hidden from assistive technologies (aria-hidden) or with role="presentation" / role="none".

    <!-- Invalid: no keyboard handler -->
    <div onclick="handleClick()">Click me</div>
    
    <!-- Valid: has keyboard handler -->
    <div onclick="handleClick()" onkeydown="handleKeyDown()">Click me</div>
    
    <!-- Valid: inherently keyboard-accessible -->
    <button onclick="handleClick()">Submit</button>
  • Added new nursery lint rule noUndeclaredClasses for HTML, JSX, and SFC files (Vue, Astro, Svelte). The rule detects CSS class names used in class="..." (or className) attributes that are not defined in any <style> block or linked stylesheet reachable from the file.

    <!-- .typo is used but never defined -->
    <html>
      <head>
        <style>
          .button {
            color: blue;
          }
        </style>
      </head>
      <body>
        <div class="button typo"></div>
      </body>
    </html>
  • Added new nursery lint rule noUnusedClasses for CSS. The rule detects CSS class selectors that are never referenced in any HTML or JSX file that imports the stylesheet. This is a project-domain rule that requires the module graph.

    /* styles.css — .ghost is never used in any importing file */
    .button {
      color: blue;
    }
    .ghost {
      color: red;
    }
    /* App.jsx */
    import "./styles.css";
    export default () => <div className="button" />;
  • Added a biome upgrade command for standalone installations. It upgrades Homebrew installs with brew upgrade biome, updates manually installed binaries from the latest GitHub release, and tells npm users to upgrade with their package manager instead.

  • Added the HTML version of the useHeadingContent rule. The rule now enforces that heading elements (h1-h6) have content accessible to screen readers in HTML, Vue, Svelte, and Astro files.

    <!-- Invalid: empty heading -->
    <h1></h1>
    
    <!-- Invalid: heading hidden from screen readers -->
    <h1 aria-hidden="true">invisible content</h1>
    
    <!-- Valid: heading with text content -->
    <h1>heading</h1>
    
    <!-- Valid: heading with accessible name -->
    <h1 aria-label="Screen reader content"></h1>
  • Added the HTML version of the useKeyWithMouseEvents rule. The rule now enforces that onmouseover is accompanied by onfocus and onmouseout is accompanied by onblur in HTML, Vue, Svelte, and Astro files.

    <!-- Invalid: onmouseover without onfocus -->
    <div onmouseover="handleMouseOver()"></div>
    
    <!-- Valid: onmouseover paired with onfocus -->
    <div onmouseover="handleMouseOver()" onfocus="handleFocus()"></div>
  • Added the new assist action useSortedTypeFields, which sorts the fields of GraphQL object types, interface types and input object types alphabetically, e.g. name, age, id becomes age, id, name.

  • Added a new style option to useExportType,
    which enforces a style for exporting types.
    This is the same option as the one provided by useImportType.

  • Ported the useValidAnchor rule to HTML. This rule enforces that all anchors are valid and that they are navigable elements.

  • The init command now prints the Biome logo.

  • Added the HTML lint rule noStaticElementInteractions, which enforces that static, visible elements (such as <div>) that have click handlers use the valid role attribute.

    Invalid:

    <div onclick="myFunction()"></div>
  • Added the assist action useSortedPackageJson.

    This action organizes package.json fields according to the same conventions as the popular sort-package-json tool.

  • The allowDoubleNegation option has been added to noImplicitCoercions to allow ignoring double negations inside code.

    With the option enabled, the following example is considered valid and is ignored by the rule:

    const truthy = !!value;
  • The Biome Language server now supports the "go-to definition" feature.

    When the cursor of the mouse is hovering an entity (variable, CSS class, type, etc.), and the command CTRL + click is triggered, the editor jumps to where this entity is defined, if the language server can find it.

    Here's what Biome is able to resolve:

    • Variables and types used in JavaScript modules, defined in the same file or imported from another module.

    • JSX Components used in JavaScript modules, defined in the same file or imported from another module.

    • CSS classes used in JSX and HTML-ish files (Vue, Svelte and Astro), and defined in CSS files.

    • Components used in HTML-ish files and defined in other HTML-ish.

    • Variables used in HTML-ish files and defined in the same file or imported from another module (JavaScript or HTML-ish).

  • Added the :STYLE: group matcher for organizeImports that matches style imports.

    For example, the following configuration...

    {
      "assist": {
        "actions": {
          "source": {
            "organizeImports": {
              "level": "on",
              "options": {
                "groups": ["**", "!:STYLE:"],
                "sortBareImports": true
              }
            }
          }
        }
      }
    }

    ...places style imports last:

    - import "./style.css"
      import A from "./a.js"
    + import "./style.css"
  • Added bundleDependencies option to NoUndeclaredDependencies rule.

    This rule now supports imports of packages that are defined only in bundleDependencies and bundledDependencies arrays.

  • Added new assist rule useSortedAttributes for HTML, porting the existing JSX rule. This rule enforces sorted HTML attributes.

    Invalid

    <input type="text" id="name" name="name" />
  • Added the html.parser.vue configuration option. When enabled, it adds support for the parsing of Vue in .html files. Most Vue users don't need to enable this option since Vue files typically use the .vue extension, but it can be useful for projects that embed Vue syntax in regular HTML files.

  • Added support for applying GritQL plugin rewrites as code actions. GritQL plugins that use the rewrite operator (=>) now produce fixable diagnostics for JavaScript, CSS, and JSON files. By default, plugin rewrites are treated as unsafe fixes and require --write --unsafe to apply. Plugin authors can pass fix_kind = "safe" to register_diagnostic() to mark a fix as safe, allowing it to be applied with just --write.

    Example plugin (useConsoleInfo.grit):

    language js
    
    `console.log($msg)` as $call where {
        register_diagnostic(span = $call, message = "Use console.info instead of console.log.", severity = "warn", fix_kind = "safe"),
        $call => `console.info($msg)`
    }

    Running biome check --write applies safe rewrites. Unsafe rewrites (the default, or fix_kind = "unsafe") still require --write --unsafe.

  • Added the sortBareImports option to organizeImports,
    which allows bare imports to be sorted within other imports when set to false.

    {
      "assist": {
        "actions": {
          "source": {
            "organizeImports": {
              "level": "on",
              "options": { "sortBareImports": true }
            }
          }
        }
      }
    }
    - import "b";
      import "a";
    + import "b";
      import { A } from "a";
    + import "./file";
      import { Local } from "./file";
    - import "./file";
  • Added the watch mode (--watch) to the CLI for check/format/lint commands. By enabling this option, Biome will re-run the check automatically when any file in the workspace has changed after the first run.

  • Biome can now format and lint .svg files.

  • Added HTML support for noExcessiveLinesPerFile. Biome now reports HTML files that exceed the configured line limit, including when skipBlankLines is enabled.

  • Added the HTML lint rule noAriaUnsupportedElements. This rule enforces that elements that do not support ARIA roles, states, and properties (meta, html, script, style) do not have role or aria-* attributes.

    <!-- Invalid: meta does not support aria attributes -->
    <meta charset="UTF-8" role="meta" />
  • Added the noNoninteractiveTabindex lint rule for HTML. This rule enforces that tabindex is not used on non-interactive elements, as it can cause usability issues for keyboard users.

    <div tabindex="0">Invalid: non-interactive element</div>
    `
  • Added the HTML lint rule noRedundantRoles. This rule enforces that explicit role attributes are not the same as the implicit/default role of an HTML element. It supports HTML, Vue, Svelte, and Astro files.

    <!-- Invalid: role="button" is redundant on <button> -->
    <button role="button"></button>
  • Added a new linter configuration called preset. With the new option, users can enable different kinds of rules at once.

    The following presets are available:

    • "recommended": it enables all Biome-recommended rules, or recommended rules of a group;

    • "all": it enables all Biome rules, or enables all rules of a group;

    • "none": it disables all Biome rules, or disable all rules of a group.

    You can enable recommended rules:

    {
      "linter": {
        "rules": {
          "preset": "recommended"
        }
      }
    }

    You can enable all rules at once:

    {
      linter: {
        rules: {
          preset: "all", // enables all rules
        },
      },
    }

    Or enable all rules for a group:

    {
      linter: {
        rules: {
          style: {
            preset: "all", // enables all rules in the style group
          },
        },
      },
    }

    This new option, however, doesn't affect how nursery rules work. Nursery rules must be enabled singularly, due to their nature.

    This new option is meant to replace recommended, so make sure to run the migrate command.

  • Added the HTML lint rule noNoninteractiveElementToInteractiveRole, which enforces that interactive ARIA roles are not assigned to non-interactive HTML elements.

    Invalid:

    <h1 role="checkbox"></h1>
  • Biome now supports pnpm catalogs (default and named) when resolving dependencies for linting. This behavior is opt-in and requires setting javascript.resolver.experimentalPnpmCatalogs to true.

  • Added the HTML lint rule noInteractiveElementToNoninteractiveRole, which enforces that non-interactive ARIA roles are not assigned to interactive HTML elements.

    Invalid:

    <input role="img" />
  • Added the new assist action useSortedSelectionSet, which sorts GraphQL selection sets alphabetically, e.g. name, age, id becomes age, id, name.

    Invalid:

    query {
      name
      age
      id
    }
  • Added a kind field to the ImportMatcher used by the organizeImports assist action. The new field selects imports by their syntactic kind and currently supports bare (matching side-effect imports such as import "polyfill") with optional ! negation (!bare). The matcher composes with the existing type and source fields, so users can express patterns such as "only bare imports that import a CSS file" ({ "kind": "bare", "source": "**/*.css" }).

    For example, with the following configuration:

    {
      "assist": {
        "actions": {
          "source": {
            "organizeImports": {
              "level": "on",
              "options": {
                "sortBareImports": true,
                "groups": [
                  { "kind": "!bare" },
                  ":BLANK_LINE:",
                  { "kind": "bare" }
                ]
              }
            }
          }
        }
      }
    }

    ...the following code:

    import "./register-my-component";
    import { render } from "react-dom";
    import "./polyfill";
    import { Button } from "@/components/Button";

    ...is organized as:

    import { render } from "react-dom";
    import { Button } from "@/components/Button";
    
    import "./polyfill";
    import "./register-my-component";
  • Added includes option for plugin file scoping. Plugins can now be configured with glob patterns to restrict which files they run on. Use negated globs for exclusions.

    {
      "plugins": [
        "global-plugin.grit",
        {
          "path": "scoped-plugin.grit",
          "includes": ["src/**/*.ts", "!**/*.test.ts"]
        }
      ]
    }
  • Ported useAriaActivedescendantWithTabindex a11y rule to HTML.

  • Added HTML support for the noAriaHiddenOnFocusable accessibility lint rule, which enforces that aria-hidden="true" is not set on focusable elements. Focusable elements include native interactive elements (<button>, <input>, <select>, <textarea>), elements with href (<a>, <area>), elements with tabindex >= 0, and editing hosts (contenteditable). Includes an unsafe fix to remove the aria-hidden attribute.

    <!-- Invalid: aria-hidden on a focusable element -->
    <button aria-hidden="true">Submit</button>
    
    <!-- Valid: aria-hidden on a non-focusable element -->
    <div aria-hidden="true">decorative content</div>
  • Added the useSemanticElements lint rule for HTML. The rule now detects the use of role attributes in HTML elements and suggests using semantic elements instead.

    For example, the following code is now flagged:

    <div role="navigation"></div>

    The rule suggests using <nav> instead.

  • Ported the useValidAriaProps lint rule to HTML. This rule checks that all aria-* attributes used in HTML elements are valid ARIA attributes as defined by the WAI-ARIA specification.

  • Ported useValidAriaValues to HTML. Biome now validates static aria-* attribute values in HTML elements against WAI-ARIA types, catching invalid values such as aria-hidden="yes".

  • Promoted 73 nursery rules to stable groups.

    Four rules were renamed as part of the promotion:

Correctness

Promoted the following rules to the correctness group:

Suspicious

Promoted the following rules to the suspicious group:

Style

Promoted the following rules to the style group:

Complexity

Promoted the following rules to the complexity group:

Performance

Promoted the following rules to the performance group:

Security

Promoted the following rules to the security group:

A11y

Promoted the following rules to the a11y group:

  • noAmbiguousAnchorText (recommended)

  • Biome now applies Git's local exclude file when VCS ignore files are enabled. Files listed in .git/info/exclude are skipped the same way as files listed in .gitignore, including in linked worktrees.

  • Added ignore option to the noUnusedVariables rule. The option allows excluding identifiers by providing a list of ignored names. It also allows excluding kinds of identifiers from this rule entirely, which may be useful when loading classes dynamically.

    For example, unused classes as well as all unused variables, functions, etc. called "unused" may be ignored entirely with the following configuration:

    {
      "ignore": {
        "*": ["unused"],
        "class": ["*"]
      }
    }
  • Added the lint rule noLabelWithoutControl to HTML, which enforces that a label element or component has a text label and an associated input.

    <label></label>
  • Added the HTML lint rule useAriaPropsSupportedByRole, which enforces that ARIA properties are valid for the roles that are supported by the element.

    <a href="#" aria-checked></a>
  • Added the delimiterSpacing formatter option. This option inserts spaces inside delimiters (after the opening delimiter and before the closing delimiter) when the content fits on a single line. Empty delimiters are not affected, and no space is added before the opening delimiter. The specific delimiters affected depend on the language. It can be configured globally via formatter.delimiterSpacing or per-language via javascript.formatter.delimiterSpacing, json.formatter.delimiterSpacing, and css.formatter.delimiterSpacing. Defaults to false.

    - callFn(foo)
    + callFn( foo )
    - const arr = [1, 2, 3];
    + const arr = [ 1, 2, 3 ];

JavaScript

When enabled, Biome inserts spaces inside parentheses (e.g., foo( a, b )), square brackets (e.g., [ a, b ]), template literal interpolations (e.g., ${ expr }), and the logical NOT operator (e.g., ! x, but in chains only after the last one: !! x). Only applies when the content fits on a single line. Empty delimiters and the space before the opening delimiter are not affected.

- if (condition) {}
+ if ( condition ) {}
- `Hello ${name}!`
+ `Hello ${ name }!`

JSX

When enabled, Biome inserts spaces inside JSX expression braces (e.g., attr={ value }) and spread attributes (e.g., { ...props }). Only applies when the content fits on a single line. Empty delimiters are not affected.

- <Foo bar={value} />
+ <Foo bar={ value } />

TypeScript

When enabled, Biome inserts spaces inside TypeScript angle brackets (e.g., foo< T >()), indexed access types (e.g., T[ K ]), mapped types, tuple types, type parameters, and index signatures. Only applies when the content fits on a single line. Empty delimiters are not affected.

- type Result = Map<string, number>;
+ type Result = Map< string, number >;

JSON

When enabled, Biome inserts spaces inside square brackets when the content fits on a single line. Empty brackets are not affected.

- [1, 2, 3]
+ [ 1, 2, 3 ]

CSS

When enabled, Biome inserts spaces inside parentheses and square brackets when the content fits on a single line. Empty delimiters are not affected.

- rgba(0, 0, 0, 1)
+ rgba( 0, 0, 0, 1 )
- [data-attr]
+ [ data-attr ]
  • Implements #9445. Added the allowImplicit option to useIterableCallbackReturn. When enabled, callbacks can use return; to implicitly return undefined, matching ESLint's array-callback-return rule.

  • Added configurable options to the useNumericSeparators rule. Users can now customize the minimum number of digits required before adding separators and the group length for each type of numeric literal (binary, octal, decimal, hexadecimal).

    {
      "linter": {
        "rules": {
          "style": {
            "useNumericSeparators": {
              "level": "error",
              "options": {
                "decimal": {
                  "minimumDigits": 7,
                  "groupLength": 3
                },
                "hexadecimal": {
                  "minimumDigits": 4,
                  "groupLength": 2
                }
              }
            }
          }
        }
      }
    }
  • Added the lint rule useFocusableInteractive to HTML, which enforces elements with an interactive role and interaction handler to be focusable.

    Invalid:

    <div role="button"></div>
  • Added the HTML lint rule noNoninteractiveElementInteractions, which disallows use event handlers on non-interactive elements.

    Invalid:

    <div onclick="myFunction()">button</div>
  • Added the new assist action useSortedEnumMembers, which sorts TypeScript & GraphQL enum members.

    Invalid:

    enum Role {
      SUPER_ADMIN
      ADMIN
      USER
      GOD
    }
  • Added the HTML lint rule useValidAutocomplete, which enforces using valid values for the autocomplete attribute on input elements.

    <input autocomplete="incorrect" />

Patch Changes

  • Added the nursery rule useReactFunctionComponentDefinition, which enforces a consistent function type for named React function components.

    For example, the following snippet triggers the rule by default.

    const MyComponent = (props) => {
      return <div>{props.name}</div>;
    };
  • Added ignoreMixedLogicalExpressions to useNullishCoalescing, partially addressing #9232. When enabled, Biome ignores || and ||= mixed with && in the same expression tree.

  • Added the new nursery rule useSvelteRequireEachKey, a Svelte lint rule that reports {#each} blocks with item bindings that are missing a key.

  • Added useIncludes to the nursery group. This rule flags comparisons of String.prototype.indexOf() or Array.prototype.indexOf() against -1 and suggests replacing them with the clearer includes() / !includes() form.

  • Fixed a Svelte parser error that incorrectly required a binding variable after {:then} and {:catch}. Biome now correctly accepts {:then} and {:catch} without a binding, as well as the {#await expr then} and {#await expr catch} shorthand forms.

  • Fixed useVueHyphenatedAttributes: The rule now only reports diagnostics in Vue files and ignores SVG elements.

  • Fixed useVueConsistentVBindStyle: The rule no longer reports argument-less v-bind directives because they cannot be converted to shorthand syntax.

  • Fixed #10563: Biome now parses comma-separated CSS Modules composes values, such as composes: classA from "./a.css", classB from "./b.css";.

  • Fixed CSS formatting for grid-template-areas declarations with comments before multiline values. Biome now keeps grid area rows aligned instead of adding an extra declaration-boundary indent.

     .grid {
       grid-template-areas:
     /* row */
    -      "header header"
    -      "footer footer";
    +    "header header"
    +    "footer footer";
     }
  • Fixed #10513: Biome no longer rejects literal \u sequences in quoted HTML attribute values.

  • Fixed #6611: noUnnecessaryConditions now uses type information to detect more redundant conditions, including ?., ??, ||, &&, comparisons against null/undefined on non-nullish operands, and case clauses that can never match the switch value.

  • Fixed #10564: useAriaPropsForRole no longer reports false positives for Vue v-bind shorthand bindings (:aria-checked, :aria-level, etc.).

  • Improved noTsIgnore.
    The rule now reports more precisely the range of the @ts-ignore comment.

  • Fixed #10519: Vue v-on event handlers with multiple inline statements are now parsed consistently with Vue.

  • Improved the performance of the Biome linter. The improvements are more visible in bigger projects that have more than ~1k files. Early tests showed that in a code base with ~2k files, Biome took less than 26% of time to finish the command.

  • Fixed #10536: noUnknownFunction no longer flagged CSS contrast-color() as unknown. contrast-color() is Baseline 2026.

  • Improved the performance of the formatter in some cases. The formatter is now up to ~20% faster at formatting files.

  • Added a new nursery rule noRestrictedDependencies, which flags imports and package.json dependency entries that have better alternatives in e18e's module replacement data.

    For example, the package globby is reported because there's a better alternative:

    import glob from "globby";
    {
      "dependencies": {
        "globby": "x.x.x"
      }
    }
  • Fixed #10447: now the rule noProcessEnv detects the use of env when it's imported from process and node:process.

  • Fixed #10492: Biome no longer crashes with a stack overflow on certain code when a type-aware rule such as noFloatingPromises, noMisusedPromises, or noUnnecessaryConditions is enabled. For example, the following code used to crash Biome:

    function f(visitor) {
      let ctrl = visitor();
      for (const x of [0]) ctrl = ctrl();
    }
  • CSS declarations with comments before : or after !important now preserve spaces before : and ;.

     .selector {
    -  padding/* name */: 1px;
    -  color: red !important /* note */;
    +  padding/* name */ : 1px;
    +  color: red !important /* note */ ;
     }
  • Fixed the Svelte parser rejecting {#each} blocks where the binding uses object destructuring with property renaming, e.g. {#each items as { id, component: Filter }}. Biome now correctly parses and formats these rename bindings.

  • Fixed the CSS parser rejecting comma-separated selector lists inside :global() and :local() pseudo-class functions. Biome now correctly parses :global(.foo, .bar).

  • Fixed #10477: The RDJSON reporter now emits code replacement text for fix suggestions instead of the human-readable fix description.

  • Fixed #10493: useImportType now correctly separates types from a default named import when all imports are types and the style option is set to separatedType.

  • Improved Svelte lint rule accuracy for quoted attribute values containing {expression} interpolations.

    • noRedundantAlt no longer emits false positives when the alt text contains an interpolation, e.g. alt="image of {person}".

    • useButtonType no longer emits false positives for dynamic button types written as type="{dynamicType}".

    • noScriptUrl no longer emits false positives for dynamic hrefs such as href="{url}".

  • Fixed Svelte {#each} parser incorrectly rejecting TypeScript as const type assertions in the iterable expression. Biome now correctly parses {#each arr as const as item}.

  • Improved how diagnostics print long lines of code, for example minified files where the entire source code is printed in one line.

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.