Skip to content

Releases: biomejs/biome

Biome CLI v2.4.7

13 Mar 18:33
1f30838

Choose a tag to compare

2.4.7

Patch Changes

  • #9318 3ac98eb Thanks @ematipico! - Added new nursery lint rule useBaseline for CSS. The rule reports when CSS properties, property values, at-rules, media conditions, functions, or pseudo-selectors are not part of the configured Baseline tier.

    For example, at the time of writing, the rule will trigger for the use of accent-color because it has limited availability:

    a {
      accent-color: bar;
    }
  • #9272 2de8362 Thanks @terror! - Added the nursery rule useImportsFirst that enforces all import statements appear before any non-import statements in a module. Inspired by the eslint-plugin-import import/first rule.

    // Invalid
    import { foo } from "foo";
    const bar = 1;
    import { baz } from "baz"; // ← flagged
    
    // Valid
    import { foo } from "foo";
    import { baz } from "baz";
    const bar = 1;
  • #9285 93ea495 Thanks @dyc3! - Fixed noUndeclaredVariables from erroneously flagging props only used in the template section in Vue SFCs

  • #9435 6c5a8f2 Thanks @siketyan! - Fixed #9432: Values referenced as a JSX element in Astro/Vue/Svelte templates are now correctly detected; noUnusedImports and useImportType rules no longer reports these values as false positives.

  • #9362 fc9ca4c Thanks @Netail! - Extra rule source references. biome migrate eslint should do a bit better detecting rules in your eslint configurations.

  • #9392 b881fea Thanks @g-ortuno! - Fixed biomejs/biome-vscode#959: LSP now correctly resolves project directory when configurationPath points to a configuration file outside the workspace.

  • #9420 a1c46af Thanks @ematipico! - Fixed #9385: noUselessEscapeInString no longer incorrectly flags valid CSS hex escapes (e.g. \e7bb) as useless. The rule now recognizes all hex digits (0-9, a-f, A-F) as valid escape characters in CSS strings.

  • #9416 f2581b8 Thanks @ematipico! - Fixed #9131, #9112, #9166: the formatter no longer crashes or produces corrupt output when a JS file with experimentalEmbeddedSnippetsEnabled contains non-embedded template literals alongside embedded ones (e.g. console.log(\test`)next tographql(`...`)`).

  • #9344 cb4d7d7 Thanks @ematipico! - Fixed #6921: noShadow no longer incorrectly flags destructured variable bindings in sibling scopes as shadowing. Object destructuring, array destructuring, nested patterns, and rest elements are now properly recognized as declarations.

  • #9360 bc5dd99 Thanks @ematipico! - Fixed #7125: The rule noShadow no longer incorrectly flags parameters in TypeScript constructor and method overload signatures.

  • #9371 29cac17 Thanks @ematipico! - Fixed #5279: Tabs in diagnostic diff output are now rendered at a consistent width across context and changed lines, fixing visual misalignment when source files use tab indentation.

  • #9043 61e2a02 Thanks @dyc3! - Fixed #8897: Biome now parses @utility names containing / when Tailwind directives are enabled.

  • #9354 930c858 Thanks @denbezrukov! - Improved CSS parser recovery for invalid unicode-range values that mix wildcard ranges with range intervals. For example, Biome now reports clearer diagnostics for invalid syntax like:

    unicode-range: U+11???-2??;
    unicode-range: U+11???-;

    with diagnostics such as:

    × Wildcard ranges cannot be combined with a range interval.
      > unicode-range: U+11???-2??;
                                ^
    
    × Expected a codepoint but instead found ';'.
      > unicode-range: U+11???-;
                                 ^
    
  • #9355 78e74a2 Thanks @SchahinRohani! - Fixed #9349: Biome now correctly handles Vue dynamic :alt and v-bind:alt bindings in useAltText, preventing false positives in .vue files.

  • #9369 b309dde Thanks @costajohnt! - Fixed #9210: useAnchorContent no longer reports an accessibility error for Astro Image components inside links when they provide non-empty alt text.

  • #9345 70c2d4e Thanks @ematipico! - Fixed #7214: useOptionalChain now detects optional chain patterns that don't start at the beginning of a logical AND expression. For example, bar && foo && foo.length is now correctly flagged and fixed to bar && foo?.length.

  • #9311 78c4e9b Thanks @ruidosujeira! - Fixed #9245: the useSemanticElements rule no longer suggests <output> for role="status" and role="alert". The <output> element is only a relatedConcept of these roles, not a direct semantic equivalent. These roles are now excluded from suggestions, aligning with the intended behavior of the upstream prefer-tag-over-role rule.

  • #9363 b2ffb4a Thanks @ematipico! - Fixed #5212: useSemanticElements no longer reports a diagnostic when a semantic element already has its corresponding role attribute (e.g. <nav role="navigation">, <footer role="contentinfo">). These cases are now correctly left to noRedundantRoles.

  • #9364 1bb9edc Thanks @xvchris! - Fixed #9357. Improved the information emitted by some diagnostics.

  • #9434 bf12092 Thanks @siketyan! - Fixed #9433: noBlankTarget now correctly handles dynamic href attributes, such as <a href={company?.website} target="_blank">.

  • #9351 [5046d2b]...

Read more

Biome CLI v2.4.6

05 Mar 14:47
cabc56c

Choose a tag to compare

2.4.6

Patch Changes

  • #9305 40869b5 Thanks @ematipico! - Fixed #4946: noUnreachable no longer reports code inside finally blocks as unreachable when there is a break, continue, or return in the corresponding try body.

  • #9303 464910c Thanks @ematipico! - Fixed #2786: The formatter no longer produces different output on subsequent runs when a case clause has a trailing line comment followed by a single block statement.

  • #9324 6294aa2 Thanks @arendjr! - Fixed #7730: useAnchorContent now recognises SolidJS's innerHTML the same way as React's dangerouslySetInnerHTML.

  • #9298 1003229 Thanks @Netail! - Fixed #9296, so comments are moved along with the attributes in the useSortedAttributes assist rule code fix.

  • #9329 855b451 Thanks @dyc3! - Improved performance of noEmptyBlockStatements. The rule is now smarter about short-circuiting its logic.

  • #9326 85dfe9b Thanks @dyc3! - Improved performance for noImportCycles by explicitly excluding node_modules from the cycle detection. The performance improvement is directly proportional to how big your dependency tree is.

  • #9323 d5ee469 Thanks @ematipico! - Fixed #9217 and biomejs/biome-vscode#959, where the Biome language server didn't correctly resolve the editor setting configurationPath when the provided value is a relative path.

  • #9302 86fbc70 Thanks @sepagian! - Fixed #9300: Lowercase component member expressions like <form.Field> in Svelte and Astro files are now correctly formatted.

    -<form .Field></form.Field>
    +<form.Field></form.Field>

What's Changed

  • fix(js_analyze): move comments with useSortedAttributes action by @Netail in #9298
  • fix(formatter): switch case comments by @ematipico in #9303
  • refactor(markdown-parser): promote list structural tokens from skipped trivia to explicit CST nodes by @jfmcdowell in #9274
  • fix(noUnreachable): handle dead implicit jumps in finally by @ematipico in #9305
  • refactor(markdown-parser): align newline/prescan paragraph-break checks by @jfmcdowell in #9197
  • refactor(markdown-parser): promote blank lines between list items to MdNewline nodes by @jfmcdowell in #9313
  • fix(linter): support SolidJS's innerHTML in useAnchorContent by @arendjr in #9324
  • fix(lsp): correctly resolve configurationPath by @ematipico in #9323
  • perf(noImportCycles): exclude node_modules from cycle detection by @dyc3 in #9326
  • refactor(css_parser): split function parser into modules by @denbezrukov in #9325
  • refactor(markdown-parser): promote fenced code block skipped trivia to explicit CST nodes by @jfmcdowell in #9321
  • refactor(css): rename operator_token field to operator by @denbezrukov in #9327
  • perf: add .skip(1) to .ancestors() calls in a bunch of places by @dyc3 in #9330
  • perf(noEmptyBlockStatements): short circuit to avoid traversing descendants for comments by @dyc3 in #9329
  • fix: lowercase component member expressions in Astro/Svelte by @sepagian in #9302
  • chore: align parser options struct name by @Netail in #9332
  • feat(css): use ScssExpression in ScssNestingDeclaration and CssGenericProperty by @denbezrukov in #9328
  • refactor(css): align scss expression node variants by @denbezrukov in #9340
  • feat(css): use expression in page by @denbezrukov in #9342
  • ci: release by @github-actions[bot] in #9301

New Contributors

Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/biome@2.4.5...@biomejs/biome@2.4.6

Biome CLI v2.4.5

02 Mar 14:24
3bc07ab

Choose a tag to compare

2.4.5

Patch Changes

  • #9185 e43e730 Thanks @dyc3! - Added the nursery rule useVueScopedStyles for Vue SFCs. This rule enforces that <style> blocks have the scoped attribute (or module for CSS Modules), preventing style leakage and conflicts between components.

  • #9184 49c8fde Thanks @chocky335! - Improved plugin performance by batching all plugins into a single syntax visitor with a kind-to-plugin lookup map, reducing per-node dispatch overhead from O(N) to O(1) where N is the number of plugins.

  • #9283 071c700 Thanks @dyc3! - Fixed noUndeclaredVariables erroneously flagging functions and variables defined in the <script setup> section of Vue SFCs.

  • #9221 4612133 Thanks @ematipico! - Fixed an issue where the JSON reporter didn't contain the duration of the command.

  • #9294 1805c8f Thanks @Netail! - Extra rule source reference. biome migrate eslint should do a bit better detecting rules in your eslint configurations.

  • #9178 101b3bb Thanks @Bertie690! - Fixed #9172 and #9168:
    Biome now considers more constructs as valid test assertions.

    Previously, assert, expectTypeOf and assertType
    were not recognized as valid assertions by Biome's linting rules, producing false positives in lint/nursery/useExpect and other similar rules.

    Now, these rules will no longer produce errors in test cases that used these constructs instead of expect:

    import { expectTypeOf, assert, assertType } from "vitest";
    
    const myStr = "Hello from vitest!";
    it("should be a string", () => {
      expectTypeOf(myStr).toBeString();
    });
    test("should still be a string", () => {
      assertType<string>(myStr);
    });
    it.todo("should still still be a string", () => {
      assert(typeof myStr === "string");
    });
  • #9173 32dad2d Thanks @dyc3! - Added parsing support for Svelte's new comments-in-tags feature.

    The HTML parser will now accept JS style comments in tags in Svelte files.

    <button
      // single-line comment
      onclick={doTheThing}
    >click me</button>
    
    <div
      /* block comment */
      class="foo"
    >text</div>
  • #8952 1d2ca15 Thanks @pkallos! - Added the nursery rule useNullishCoalescing. This rule suggests using the nullish coalescing operator (??) instead of logical OR (||) when the left operand may be nullish. This prevents bugs where falsy values like 0, '', or false are incorrectly treated as missing. Addresses #8043

    // Invalid
    declare const x: string | null;
    const value = x || "default";
    
    // Valid
    const value = x ?? "default";
  • #9243 1992a85 Thanks @Netail! - Fixed #7813: improved the diagnostic of the rule useExhaustiveDependencies. The diagnostic now shows the name of the variable to add to the dependency array.

  • #9063 3d0648f Thanks @taga3s! - Added the nursery rule noVueRefAsOperand. This rule disallows cases where a ref is used as an operand.

    The following code is now flagged:

    import { ref } from "vue";
    
    const count = ref(0);
    count++; // Should be: count.value++
    import { ref } from "vue";
    
    const ok = ref(false);
    if (ok) {
      // Should be: if (ok.value)
      //
    }
  • #9273 f239e20 Thanks @denbezrukov! - Fixed #9253: parsing of @container scroll-state(...) queries.

    @container scroll-state(scrolled: bottom) {
    }
    @container scroll-state(stuck) {
    }
    @container scroll-state(not (stuck)) {
    }
    @container scroll-state((stuck) and (scrolled: bottom)) {
    }
    @container scroll-state((stuck) or (snapped: x)) {
    }
    @container main-layout scroll-state(not ((stuck) and (scrolled: bottom))) {
    }
  • #9259 96939c0 Thanks @ematipico! - Fixed CSS formatter incorrectly collapsing selectors when a BOM (Byte Order Mark) character is present at the start of the file. The formatter now correctly preserves line breaks between comments and selectors in BOM-prefixed CSS files, matching Prettier's behavior.

  • #9251 59e33fb Thanks @ematipico! - Fixed #9249: The CSS formatter no longer incorrectly breaks ratio values (like 1 / -1) across lines when followed by comments.

  • #9284 ec3a17f Thanks @denbezrukov! - Fixed #9253: removed false-positive diagnostics for valid @container/@supports general-enclosed queries.

    @container scroll-state(scrolled: bottom) {
    }
    @supports foo(bar: baz) {
    }
  • #9215 b2619a1 Thanks @FrederickStempfle! - Fixed #9189: biome ci in GitHub Actions now correctly disables colors so that ::error/::warning workflow commands are not wrapped in ANSI escape codes.

  • #9256 65ae4c1 Thanks @ematipico! - Fixed JSON reporter escaping of special characters in diagnostic messages. The JSON reporter now properly escapes double quotes, backslashes, and control characters in error messages and advice text, preventing invalid JSON output when diagnostics contain these characters.

  • #9223 5b9da81 Thanks @ematipico! - Fixed an issue where the JSON reporter didn't write output to a file when --reporter-file was specified. The output is now correctly written to the specified file instead of always going to stdout.

  • #9154 c487e54 Thanks @abossenbroek! - Fixed #9115: The noPlaywrightMissingAwait rule no longer produces false positives on jest-dom matchers like toBeVisible, toBeChecked, toHaveAttribute, etc. For matchers shared between Playwright and jest-dom, the rule now checks whether expect()'s argument is a Playwright locator or page object before flagging. Added semantic variable resolution so that extracted Playwright locators (e.g. const loc = page.locator('.item'); expect(loc).toBeVisible()) are still correctly flagged.

  • #9269 33e5cdf Thanks @dyc3! - Fixed a false positive where noUndeclaredVariables reported bindings from Vue <script setup> as undeclared when used in <template>.

    This change ensures embedded bindings collected from script snippets (like imports and defineModel results...

Read more

Biome CLI v2.4.4

20 Feb 21:30
6c296ea

Choose a tag to compare

2.4.4

Patch Changes

  • #9150 6946835 Thanks @dyc3! - Fixed #9138: Astro files containing --- in HTML content (e.g., <h1>---Hi</h1>) are now parsed correctly, both when a frontmatter block is present and when there is no frontmatter at all.

  • #9150 aa6f837 Thanks @dyc3! - Fixed #9138: The HTML parser incorrectly failing to parse bracket characters ([ and ]) in text content (e.g. <div>[Foo]</div>).

  • #9151 c0d4b0c Thanks @dyc3! - Fixed parsing of Svelte directive keywords (use, style) when used as plain text content in HTML/Svelte files. Previously, <p>use JavaScript</p> or <p>style it</p> would incorrectly produce a bogus element instead of proper text content.

  • #9162 7f1e060 Thanks @dyc3! - Fixed #9161: The Vue parser now correctly handles colon attributes like xlink:href and xmlns:xlink by parsing them as single attributes instead of splitting them into separate tokens.

  • #9164 458211b Thanks @dyc3! - Fixed #9161: The noAssignInExpressions rule no longer flags assignments in Vue v-on directives (e.g., @click="counter += 1"). Assignments in event handlers are idiomatic Vue patterns and are now skipped by the rule.

What's Changed

  • chore(scss): cherry-picks by @denbezrukov in #9149
  • fix(parse/html): don't lex square brackets as special tokens in contexts where they don't mean anything by @dyc3 in #9150
  • refactor(parse/html): use token_set! instead of matches! for svelte keywords and directives helpers by @dyc3 in #9148
  • fix(parse/html): don't lex "use" as USE_KW when in html text content by @dyc3 in #9151
  • feat(css): enhance SCSS qualified name detection by @denbezrukov in #9159
  • chore(html): more html benchmarks by @dyc3 in #8153
  • fix(parse/html/vue): don't treat : as special token outside of vue directives by @dyc3 in #9162
  • feat(lint/vue): automatically ignore noAssignInExpressions for vue v-on directives by @dyc3 in #9164
  • ci: release by @github-actions[bot] in #9160

Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/biome@2.4.3...@biomejs/biome@2.4.4

Biome CLI v2.4.3

19 Feb 19:24
312b6db

Choose a tag to compare

2.4.3

Patch Changes

  • #9120 aa40fc2 Thanks @ematipico! - Fixed #9109, where the GitHub reporter wasn't correctly enabled when biome ci runs on GitHub Actions.

  • #9128 8ca3f7f Thanks @dyc3! - Fixed #9107: The HTML parser can now correctly parse Astro directives (client/set/class/is/server), which fixes the formatting for Astro directives.

  • #9124 f5b0e8d Thanks @ematipico! - Fixed #8882 and #9108: The Astro frontmatter lexer now correctly identifies the closing --- fence when the frontmatter contains multi-line block comments with quote characters, strings that mix quote types (e.g. "it's"), or escaped quote characters (e.g. "\").

  • #9142 3ca066b Thanks @THernandez03! - Fixed #9141: The noUnknownAttribute rule no longer reports closedby as an unknown attribute on <dialog> elements.

  • #9126 792013e Thanks @ematipico! - Added missing Mocha globals to the Test domain: context, run, setup, specify, suite, suiteSetup, suiteTeardown, teardown, xcontext, xdescribe, xit, and xspecify. These are injected by Mocha's BDD and TDD interfaces and were previously flagged as undeclared variables in projects using Mocha.

  • #8855 6918c9e Thanks @ruidosujeira! - Fixed #8840. Now the Biome CSS parser correctly parses not + scroll-state inside @container queries.

  • #9111 4fb55cf Thanks @Jayllyz! - Slightly improved performance of noIrregularWhitespace by adding early return optimization and simplifying character detection logic.

  • #8975 086a0c5 Thanks @FrankFMY! - Fixed #8478: useDestructuring no longer suggests destructuring when the variable has a type annotation, like const foo: string = object.foo.

What's Changed

New Contributors

Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/biome@2.4.2...@biomejs/biome@2.4.3

Biome CLI v2.4.2

16 Feb 23:25
b99e7db

Choose a tag to compare

2.4.2

Patch Changes

What's Changed

  • fix(lint): don't report Props interface as unused in Astro files by @siketyan in #9101
  • fix(service): parse text expressions in svelte control flow blocks by @dyc3 in #9103
  • feat(migrate): more metadata for rules from html-eslint by @dyc3 in #9106
  • feat(lint): add Playwright ESLint rules by @abossenbroek in #8960
  • ci: release by @github-actions[bot] in #9104

New Contributors

Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/biome@2.4.1...@biomejs/biome@2.4.2

Biome CLI v2.4.1

16 Feb 15:58
5153f2f

Choose a tag to compare

2.4.1

Patch Changes

  • #9092 6edd600 Thanks @ematipico! - Fixed #9052. This PR reverts changes introduced by #8519, which caused unwanted changes on how paths are resolved.

  • #9091 3bf674d Thanks @ematipico! - Fixed #9090, where SCSS files were incorrectly processed by Biome. This was a regressions caused by the latest developments for supporting SCSS out of the box.

  • #9100 66931a8 Thanks @siketyan! - Fixed #9081: The noUnknownPseudoElement rule no longer reports false positives for any known pseudo elements in CSS modules. This was a regression introduced in v2.4.0.

  • #9102 d01b903 Thanks @ematipico! - Fixed #9095, where Biome didn't print anything in stdin mode. This was a regression caused by a recent, internal refactor.

What's Changed

Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/biome@2.4.0...@biomejs/biome@2.4.1

Biome CLI v2.4.0

15 Feb 16:14
bf6e5f9

Choose a tag to compare

2.4.0

Minor Changes

  • #8964 0353fa0 Thanks @dyc3! - Added ignore option to the useHookAtTopLevel rule.

    You can now specify function names that should not be treated as hooks, even if they follow the use* naming convention.

    Example configuration:

    {
      "linter": {
        "rules": {
          "correctness": {
            "useHookAtTopLevel": {
              "options": {
                "ignore": ["useDebounce", "useCustomUtility"]
              }
            }
          }
        }
      }
    }
  • #8769 d0358b0 Thanks @rahuld109! - Added the rule useAnchorContent for HTML to enforce that anchor elements have accessible content for screen readers. The rule flags empty anchors, anchors with only whitespace, and anchors where all content is hidden with aria-hidden. Anchors with aria-label or title attributes providing a non-empty accessible name are considered valid.

  • #8742 6340ce6 Thanks @rahuld109! - Added the rule useMediaCaption to the HTML language. Enforces that audio and video elements have a track element with kind="captions" for accessibility. Muted videos are allowed without captions.

  • #8621 d11130b Thanks @Netail! - Added support for multiple reporters, and the ability to save reporters on arbitrary files.

    Combine two reporters in CI

    If you run Biome on GitHub, take advantage of the reporter and still see the errors in console, you can now use both reporters:

    biome ci --reporter=default --reporter=github

    Save reporter output to a file

    With the new --reporter-file CLI option, it's now possible to save the output of all reporters to a file. The file is a path,
    so you can pass a relative or an absolute path:

    biome ci --reporter=rdjson --reporter-file=/etc/tmp/report.json
    biome ci --reporter=summary --reporter-file=./reports/file.txt

    You can combine these two features. For example, have the default reporter written on terminal, and the rdjson reporter written on file:

    biome ci --reporter=default --reporter=rdjson --reporter-file=/etc/tmp/report.json

    The --reporter and --reporter-file flags must appear next to each other, otherwise an error is thrown.

  • #8399 ab88099 Thanks @ematipico! - The Biome CSS parser is now able to parse Vue SFC syntax such as :slotted and :deep. These pseudo functions are only correctly parsed when the CSS is defined inside .vue components. Otherwise, Biome will a emit a parse error.

    This capability is only available when experimentalFullHtmlSupportedEnabled is set to true.

  • #8663 3dfea16 Thanks @ematipico! - Added support for Cursor files. When Biome sees a Cursor JSON file, it will parse it with comments enabled and trailing commas enabled:

    • $PROJECT/.cursor/
    • %APPDATA%\Cursor\User\ on Windows
    • ~/Library/Application Support/Cursor/User/ on macOS
    • ~/.config/Cursor/User/ on Linux
  • #8723 fe2c642 Thanks @cbstns! - Added JSON as a target language for GritQL pattern matching. You can now write Grit plugins for JSON files.

    This enables users to write GritQL patterns that match against JSON files, useful for:

    • Searching and transforming JSON configuration files
    • Enforcing patterns in package.json and other JSON configs
    • Writing custom lint rules for JSON using GritQL

    Example patterns:

    Match all key-value pairs:

    language json
    
    pair(key = $k, value = $v)
    

    Match objects with specific structure:

    language json
    
    JsonObjectValue()
    

    Supports both native Biome AST names (JsonMember, JsonObjectValue) and TreeSitter-compatible names (pair, object, array) for compatibility with existing Grit patterns.

    For more details, see the GritQL documentation.

  • #8814 4d9c676 Thanks @Netail! - Added ignore option to noUnknownProperty. If an unknown property name matches any of the items provided in ignore, a diagnostic won't be emitted.

  • #8631 4d8f19d Thanks @Netail! - Add a new reporter --reporter=sarif, that emits diagnostics using the SARIF format.

  • #8270 4f7909d Thanks @lucasweng! - Added the useIframeTitle lint rule for HTML. The rule enforces the usage of the title attribute for the iframe element.

    Invalid:

    <iframe></iframe> <iframe title=""></iframe>

    Valid:

    <iframe title="title"></iframe>
  • #8164 1d25856 Thanks @ematipico! - Added a new assist action useSortedInterfaceMembers that sorts TypeScript interface members, for readability.

    It includes an autofix.

    Invalid example.

    interface MixedMembers {
      z: string;
      a: number;
      (): void;
      y: boolean;
    }

    Valid example (after using the assist).

    interface MixedMembers {
      a: number;
      y: boolean;
      z: string;
      (): void;
    }
  • #8647 4c7c06f Thanks @siketyan! - It's now possible to provide the stacktrace for a fatal error. The stacktrace is only available when the environment variable RUST_BACKTRACE=1 is set, either via the CLI or exported $PATH. This is useful when providing detailed information for debugging purposes:

    RUST_BACKTRACE=1 biome lint
  • #7961 a04c8df Thanks @siketyan! - The Biome Language Server now reports progress while scanning files and dependencies in the project.

  • #8289 a9025d4 Thanks @theshadow27! - Fixed #8024. The rule useIterableCallbackReturn now supports a checkForEach option. When set to false, the rule will skip checking for forEach() callbacks for returning values.

  • #8690 e06e5d1 Thanks @ematipico! - Added the rule useValidLang to the HTML language.

  • #7847 e90b14f Thanks @Jagget! - Added support for jsxFactory and jsxFragmentFactory.Biome now respects jsxFactory and jsxFragmentFactory settings from tsconfig.json when using the classic JSX runtime, preventing false positive noUnusedImports errors for custom JSX libraries like Preact.

    // tsconfig.json
    {
      compilerOptions: {
        jsx: "react",
        jsxFactory: "h",
        jsxFragmentFactory: "Fragment",
      },
    }
    // Component.jsx
    import { h, Fragment } from "preact";
    
    function App() {
      return <div>Hello</div>;
    }
  • #8071 7f5bcf4 Thanks @ematipico! - Added new CLI options to the commands lsp-proxy and start that allow to control the Biome file watcher.

    --watcher-kind

    Controls how the Biome file watcher should behave. By default, Biome chooses the best watcher strategy for the
    current OS, however sometimes this could result in some issues, such as folders locked.

    The option accepts the current values:

    • recommended: the de...
Read more

Biome CLI v2.3.15

12 Feb 11:54
df21006

Choose a tag to compare

2.3.15

Patch Changes

  • #9019 043b67c Thanks @dyc3! - Added the lint rule noNestedPromises. This rule detects nested .then() or .catch() calls that could be refactored into flat promise chains.

    // Invalid: nested promise that can be flattened
    doThing().then(function () {
      return doOtherThing().then(console.log);
    });
    
    // Valid: flat promise chain
    doThing()
      .then(() => doOtherThing())
      .then(console.log);

    The rule intelligently allows nesting when the inner callback references variables from the outer scope, as these cases cannot be safely flattened.

  • #9029 6ebf6c6 Thanks @ff1451! - Added the nursery rule noUselessReturn. The rule reports redundant return; statements that don't affect the function's control flow.

    // Invalid: return at end of function is redundant
    function foo() {
      doSomething();
      return;
    }
  • #9017 8bac2da Thanks @mdevils! - Reverted a behavior change in useExhaustiveDependencies that was accidentally included as part of the #8802 fix. The change made method calls on objects (e.g., props.data.forEach(...)) report only the object (props.data) as a missing dependency instead of the full member expression. This behavior change will be reconsidered separately.

  • #9005 c8dbbbe Thanks @corvid-agent! - Fixed #8790: The noAssignInExpressions rule no longer reports a false positive when an assignment is used as the expression body of an arrow function (e.g., const f = b => a += b).

  • #8519 ccdc602 Thanks @ruidosujeira! - Fixed #8518, where globally excluded files in a monorepo were still being processed when using "extends": "//".

    When a package-level configuration extends the root configuration with "extends": "//", glob patterns (such as those in files.includes) are now correctly resolved relative to the project root directory, instead of the current workspace directory.

  • #9033 0628e0a Thanks @mdevils! - Fixed #8967. useExhaustiveDependencies no longer reports false positives for variables destructured from a rest pattern.

  • #9023 8ef9d1d Thanks @siketyan! - Fixed #9020: When javascript.jsxRuntime is set to reactClassic, noUnusedImports and useImportType rules now allow importing the React identifier from a package other than react. This aligns the behavior with tsc (--jsx=react), which also allows importing React from any package.

  • #8646 16fd71d Thanks @siketyan! - Fixed #8605: Text expressions in some template languages ({{ expr }} or { expr }) at the top level of an HTML document no longer causes panicking.

  • #8930 51c158e Thanks @ANKANJAGTAP! - Fixed #8917
    useExhaustiveDependencies now correctly detects JSX component identifiers as hook dependencies.

  • #9009 7d229c7 Thanks @Netail! - Fixed typo in noPositiveTabindex's quick fix text.

  • #8758 8c789f1 Thanks @Pranav2612000! - Updated the useJsxKeyInIterable rule to not run inside Map constructors

  • #8977 bbe0e0c Thanks @FrankFMY! - Fixed #4888.
    noUnusedImports now adds export {} when removing the last import in a TypeScript file to prevent it from becoming an ambient module. This does not apply to embedded scripts in Vue, Svelte, or Astro files, which are already in a module context.

  • #9016 9d4cfa3 Thanks @dyc3! - Added eslint migration metadata for the rules @typescript/no-var-requires, @typescript/keyword-spacing, @typescript/func-call-spacing, vue/keyword-spacing, vue/func-call-spacing, and unicorn/empty-brace-spaces,

  • #8848 2cba2b3 Thanks @LouisLau-art! - Fixed #8845. Now useGenericFontNames doesn't trigger when font is declared inside the @supports at-rule.

  • #8997 a5f3212 Thanks @mldangelo! - Fixed #8476.
    useAwaitThenable no longer reports false positives for await on call expressions whose return type cannot be resolved (e.g., cross-module function calls to Node.js builtins or npm packages).

  • #8978 cc7a478 Thanks @FrankFMY! - Fixed #8645.
    useAwait no longer reports async generator functions that use yield*, since yield* in an async generator delegates to an AsyncIterable and requires the async modifier.

What's Changed

  • docs: fix website sync by @dyc3 in #8957
  • chore(deps): update rust crate git2 to v0.20.4 [security] by @renovate[bot] in #8965
  • fix: jsx dependency detection in useexhaustivedependencies (#8917) by @ANKANJAGTAP in #8930
  • chore(doc): update formatter contributing doc by @tidefield in #8972
  • fix(useAwait): treat yield* as async operation in async generators by @FrankFMY in #8978
  • fix(css): ignore @supports queries in useGenericFontNames rule by @LouisLau-art in #8848
  • fix(html/parser): distinguish interpolations inside and outside tags by @siketyan in #8646
  • chore(deps): update rust:1.93.0-bookworm docker digest to d0a4aa3 by @renovate[bot] in #8999
  • chore(deps): update rust:1.93.0-bullseye docker digest to 3ebcc2d by @renovate[bot] in #9000
  • fix(codegen): remove duplicate preamble in generated analyzer files by @mldangelo in #8993
  • chore(deps): update rust crate anyhow to 1.0.101 by @renovate[bot] in #9004
  • chore(deps): update rust crate bpaf to 0.9.23 by @renovate[bot] in #9006
  • chore(deps): update rust crate insta to 1.46.3 by @renovate[bot] in #9007
  • chore(deps): update dependency tombi to v0.7.27 by @renovate[bot] in #9002
  • chore(deps): update github-actions by @renovate[bot] in #9003
  • chore(deps): update dependency @types/node to v24.10.11 by @renovate[bot] in #9001
  • fix(js_analyze): typo in noPositiveTabindex's action suggestion by @Netail in #9009
  • fix(useAwaitThenable): treat unresolved call expressions as uninferred by @mldangelo in #8997
  • fix(linter):...
Read more

Biome CLI v2.3.14

03 Feb 15:57
3a38d5c

Choose a tag to compare

2.3.14

Patch Changes

  • #8921 29e2435 Thanks @siketyan! - Fixed #8759: The useConsistentTypeDefinitions rule no longer converts empty object type declarations into interfaces, as it will conflict with the noEmptyInterface rule and can cause an infinite loop when both rules are enabled.

  • #8928 ccaeac4 Thanks @taga3s! - Added the nursery rule useGlobalThis. This rule enforces using globalThis over window, self and global.

  • #8602 9a18daa Thanks @dyc3! - Added the new nursery rule noVueArrowFuncInWatch. This rule forbids using arrow functions in watchers in Vue components, because arrow functions do not give access to the component instance (via this), while regular functions do.

  • #8905 9b1eea8 Thanks @ryan-m-walker! - Fixed #8428: Improved parsing recovery when encountering qualified rules inside CSS @page at-rule blocks.

  • #8900 f788cff Thanks @mdevils! - Fixed #8802: useExhaustiveDependencies now correctly suggests dependencies without including callback-scoped variables or method names.

    When accessing object properties with a callback-scoped variable, only the object path is suggested:

    // Now correctly suggests `props.value` instead of `props.value[day]`
    useMemo(() => {
      return WeekdayValues.filter((day) => props.value[day]);
    }, [props.value]);

    When calling methods on objects, only the object is suggested as a dependency:

    // Now correctly suggests `props.data` instead of `props.data.forEach`
    useMemo(() => {
      props.data.forEach((item) => console.log(item));
    }, [props.data]);
  • #8913 e1e20ea Thanks @dyc3! - Fixed #8363: HTML parser no longer crashes when encountering a < character followed by a digit in text content (e.g., <12 months). The parser now correctly emits an "Unescaped < bracket character" error instead of treating <12 as a tag name and crashing.

  • #8910 2fb63a4 Thanks @dyc3! - Fixed #8774: Type aliases with generic parameters that have extends constraints now properly indent comments after the equals sign.

    Previously, comments after the = in type aliases with extends constraints were not indented:

    -type A<B, C extends D> = // Some comment
    -undefined;
    +type A<B, C extends D> =
    +    // Some comment
    +    undefined;
  • #8916 ea4bd04 Thanks @ryan-m-walker! - Fixed #4013, where comments in member chains caused unnecessary line breaks.

    // Before
    aFunction.b().c.d();
    
    // After
    aFunction.b().c.d();
  • #8945 fa66fe3 Thanks @fireairforce! - Fixed #8354: Don't remove quotes when type memeber is new.

    // Input:
    type X = {
      "new"(): string;
      "foo"(): string;
    };
    
    // Format Output:
    type X = {
      "new()": string;
      foo(): string;
    };
  • #8927 0ef3da5 Thanks @littleKitchen! - Fixed #8907: useExhaustiveDependencies now correctly recognizes stable hook results (like useState setters and useRef values) when declared with let.

  • #8931 4561751 Thanks @koshin01! - Added the new nursery rule noRedundantDefaultExport, which flags redundant default exports where the default export references the same identifier as a named export.

  • #8900 f788cff Thanks @mdevils! - Fixed #8883: useExhaustiveDependencies no longer produces false positives when props are destructured in the function body of arrow function components without parentheses around the parameter.

    type Props = { msg: string };
    
    // Arrow function without parentheses around `props`
    const Component: React.FC<Props> = (props) => {
      const { msg } = props;
      // Previously, this incorrectly reported `msg` as unnecessary
      useEffect(() => console.log(msg), [msg]);
    };
  • #8861 3531687 Thanks @dyc3! - Added the noDeprecatedMediaType CSS rule to flag deprecated media types like tv and handheld.

  • #8775 7ea71cd Thanks @igas! - Fixed the noUnnecessararyConditions rule to prevent trigger for optional fallback patterns.

  • #8860 95f1eea Thanks @dyc3! - Added the nursery rule noHexColors, which flags the use of hexadecimal color codes in CSS and suggests using named colors or RGB/RGBA/HSL/HSLA formats instead.

  • #8786 d876a38 Thanks @Bertie690! - Added the nursery rule useConsistentMethodSignatures.
    Inspired by the similarly named version from typescript-eslint, this rule aims to enforce a consistent style for methods used inside object types and interfaces.

    Examples

    Invalid code with style set to "property" (the default):

    interface Foo {
      method(a: string): void;
    }

    Invalid code with style set to "method":

    type Bar = {
      prop: (a: string) => void;
    }
  • #8864 5e97119 Thanks @dyc3! - Improved the summary provided by biome migrate eslint to be clearer on why rules were not migrated. Biome now specifies a reason when a rule is not migrated, such as being incompatible with the formatter or not implemented yet. This helps users make more informed decisions when migrating their ESLint configurations to Biome.

  • #8924 99b4cd1 Thanks @tmohammad78! - Fixed #8920: noUnknownFunction now knows about sibling-count, and sibling-index css functions

  • #8900 f788cff Thanks @mdevils! - Fixed #8885: useExhaustiveDependencies no longer incorrectly reports variables as unnecessary dependencies when they are derived from expressions containing post/pre-increment operators (++/--) or compound assignment operators (+=, -=, etc.).

    let renderCount = 0;
    
    export const MyComponent = () => {
      // `count` is now correctly recognized as a required dependency
      // because `renderCount++` can produce different values between renders
      const count = renderCount++;
    
      useEffect(() => {
        console.log(count);
      }, [count]); // no longer reports `count` as unnecessary
    };
  • #8619 [d78e01d](...

Read more