github biomejs/biome @biomejs/biome@2.4.7
Biome CLI v2.4.7

5 hours ago

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 Thanks @Netail! - Expanded the noNegationElse rule to cover the inequality & strict inequality operator.

  • #9353 2a29e0d Thanks @Conaclos! - Fixed #7583:
    organizeImports now
    sorts named specifiers inside bare exports and merges bare exports.

    - export { b, a };
    - export { c };
    + export { a, b, c };

    Also, organizeImports now correctly adds a blank line between an import chunk
    and an export chunk.

      import { A } from "package";
    +
      export { A };
  • #8658 bdcc934 Thanks @rksvc! - When the domains field is set in the configuration file, domains is now automatically enabled when Biome detects certain dependencies in package.json.

  • #9383 f5c8bf0 Thanks @ematipico! - Fixed #6606: The type inference engine now resolves Record<K, V> types, synthesizing them as object types with index signatures. This improves accuracy for type-aware lint rules such as noFloatingPromises, noMisusedPromises, useAwaitThenable, and useArraySortCompare when operating on Record-typed values.

  • #9359 701ddd3 Thanks @ematipico! - Fixed #7516: noUnusedImports no longer reports a false positive when a local variable shadows an imported type namespace that is still used in a type annotation.

  • #9473 50e93bd Thanks @ematipico! - Improved the detection of variables inside Astro files. Now the rule noUnusedVariables and others will trigger fewer false positives.

  • #9459 171b2ee Thanks @ematipico! - Fixed #9314. Now Biome doesn't panic when useAriaPropsForRole is configured using an object.

  • #9465 c8918d6 Thanks @Netail! - Fixed #9464: Temporal is now correctly detected as a global.

  • #9367 722f0da Thanks @Netail! - Added the nursery rule noTopLevelLiterals. It requires the root-level value to be an array or object.

    Invalid:

    "just a string"
  • #9333 a294b89 Thanks @terror! - Fixed #9310. Now the HTML formatter doesn't mangle elements that are followed by self-closing elements such as <br> or <img>.

  • #9391 4bffb66 Thanks @ematipico! - Slightly increased the performance of the CLI in projects that have more than ~2K files.

  • #9365 776cb64 Thanks @Netail! - Added the nursery rule noEmptyObjectKeys, which disallows the use of empty keys in JSON objects.

    Invalid:

    {
      "": "value"
    }

What's Changed

  • fix(useOptionalChain): correctly track prefix expression by @ematipico in #9345
  • feat(css): add support for SCSS binary expressions in lexer and parser by @denbezrukov in #9343
  • fix(noShadow): detect destructured patterns in sibling scopes by @ematipico in #9344
  • feat(js_analyze): noNegationElse support inequality & strict inequality operator by @Netail in #9351
  • feat(css): improve scss declaration modifier recovery by @denbezrukov in #9352
  • fix(css): improve unicode wildcard range recovery by @denbezrukov in #9354
  • chore: rust 1.94.0 by @Netail in #9356
  • chore: improve internal skills by @ematipico in #9361
  • fix(organizeImports): sort specifiers in bare exports by @Conaclos in #9353
  • chore: add extra eslint plugin sources by @Netail in #9362
  • feat(md): formatter plumbing by @ematipico in #9331
  • fix(noUndeclaredVariables): track vue props as bindings by @dyc3 in #9285
  • fix(cli): tab printing by @ematipico in #9371
  • fix(noShadow): ts overloads by @ematipico in #9360
  • fix(html/useAltText): handle Vue dynamic :alt and v-bind:alt bindings by @SchahinRohani in #9355
  • feat(json_analyze): implement noTopLevelLiterals by @Netail in #9367
  • fix(organizeImports): merge bare exports by @Conaclos in #9373
  • chore: update rule count in readme by @dyc3 in #9374
  • fix(noUnusedImports): edge case ambient type by @ematipico in #9359
  • fix(useSemanticElements): don't flag elements and roles by @ematipico in #9363
  • test: iife inference by @ematipico in #9382
  • feat(json_analyze): implement noEmptyObjectKeys by @Netail in #9365
  • feat(biome_service): include file path in NotFound diagnostic by @xvchris in #9364
  • feat(css): improve SCSS expression parsing by @denbezrukov in #9396
  • chore(deps): update dependency eslint to v9.39.3 by @renovate[bot] in #9403
  • chore(deps): update pnpm to v10.30.3 by @renovate[bot] in #9404
  • chore(deps): update rust crate jiff to 0.2.23 by @renovate[bot] in #9405
  • fix(deps): update @biomejs packages by @renovate[bot] in #9408
  • chore(deps): update rust crate libc to 0.2.183 by @renovate[bot] in #9406
  • chore(deps): update rust crate quote to 1.0.45 by @renovate[bot] in #9407
  • chore(deps): update dependency @changesets/changelog-github to v0.6.0 by @renovate[bot] in #9409
  • chore(deps): update dependency @changesets/cli to v2.30.0 by @renovate[bot] in #9410
  • chore(deps): update dependency dprint to v0.52.0 by @renovate[bot] in #9413
  • chore(deps): update dependency @types/node to v24.11.2 by @renovate[bot] in #9412
  • feat(css): add support for sass() in SCSS conditional expressions by @denbezrukov in #9414
  • feat(css): add support for @debug, @warn, and @error SCSS at-rules by @denbezrukov in #9415
  • refactor(markdown-parser): promote thematic break skipped trivia to explicit CST nodes by @jfmcdowell in #9337
  • feat(css): add support for SCSS @if, @else, and @while at-rules by @denbezrukov in #9417
  • feat(css): add support for SCSS @each at-rule (#9418) by @denbezrukov in #9419
  • fix(lint): enable rules via dependencies when setting domains in config by @rksvc in #8658
  • refactor(core): embed detectors by @ematipico in #9416
  • fix(noUselessEscapeInString): correctly flag chars by @ematipico in #9420
  • chore: accept snapshot on main by @dyc3 in #9422
  • feat(css): add support for SCSS @for at-rule by @denbezrukov in #9421
  • fix(parse/css): parse tailwind @utility with slash in the name by @dyc3 in #9043
  • feat(css): add support for SCSS @mixin at-rule by @denbezrukov in #9423
  • feat(css): add support for SCSS @include at-rule by @denbezrukov in #9424
  • feat(lint): add nursery rule useImportsFirst by @terror in #9272
  • feat(css): add support for SCSS @content at-rule by @denbezrukov in #9425
  • fix(useOptionalChain): regression by @ematipico in #9430
  • feat(css): add support for SCSS @function and @return at-rules by @denbezrukov in #9431
  • feat(inference): infer Recored<K, V> by @ematipico in #9383
  • feat(ast): increase SyntaxKindSet bitfield size to 6 elements for extended node support by @denbezrukov in #9438
  • fix(a11y): only use baseConcepts in useSemanticElements rule (#9245) by @ruidosujeira in #9311
  • fix(core): detect JSX reference identifiers in Astro/Vue/Svelte templates by @siketyan in #9435
  • fix(lint/noBlankTarget): still report when the href attribute is dynamic by @siketyan in #9434
  • ci: publish to pkg pr new before disatpch event by @ematipico in #9439
  • feat(css/lint): useBaseline by @ematipico in #9318
  • fix: compilation issue due to merge by @ematipico in #9442
  • refactor(markdown-parser): promote remaining skipped trivia to explicit CST nodes by @jfmcdowell in #9427
  • docs(markdown-parser): add code-version comments to ungram nodes by @jfmcdowell in #9444
  • feat(css): add support for SCSS @use and @forward at-rules by @denbezrukov in #9440
  • refactor(markdown-parser): simplify inline newline handling by @jfmcdowell in #9446
  • ci: trigger parser conformance tests on markdown crate changes by @jfmcdowell in #9447
  • chore: new labels by @Netail in #9448
  • perf(cli): lock-free storage, and reduce system calls by @ematipico in #9391
  • fix(html/formatter): preserve closing > before self-closing elements by @terror in #9333
  • perf(inference): reduce type widening by @ematipico in #8374
  • refactor(markdown-parser): decompose parse_link_or_image into phase helpers by @jfmcdowell in #9452
  • refactor(markdown-parser): decompose handle_blank_lines into phase helpers by @jfmcdowell in #9453
  • refactor(semantic): dual binding by @ematipico in #9451
  • fix(lsp): fix incorrect project dir when configurationPath points to config outside of workspace by @g-ortuno in #9392
  • fix(biome_html_analyze): recognize Astro Image component in useAnchorContent by @costajohnt in #9369
  • feat(css): add support for SCSS @import and @extend at-rules by @denbezrukov in #9458
  • feat(css): add support for SCSS @at-root at-rule by @denbezrukov in #9461
  • fix(js_analyze): temporal global by @Netail in #9465
  • fix: bad options by @ematipico in #9459
  • docs: fix markdown rule wording by @ematipico in #9470
  • feat(css): parse scss interpolation expressions by @denbezrukov in #9472
  • fix(embeds): improve detection of bindings in Astro files by @ematipico in #9473
  • ci: release by @github-actions[bot] in #9346

New Contributors

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

Don't miss a new biome release

NewReleases is sending notifications on new releases.