Skip to content

Conversation

@dyc3
Copy link
Contributor

@dyc3 dyc3 commented Nov 26, 2025

Summary

Caution

  • Do not rebase this branch. To bring it up to date, do a normal merge main -> next.
  • When merging this, do not squash and merge it.

Test Plan

Docs

siketyan and others added 10 commits November 5, 2025 22:18
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Naoki Ikeguchi <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Emanuele Stoppa <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

Co-authored-by: arendjr <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Carson McManus <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Nov 26, 2025

🦋 Changeset detected

Latest commit: 789b0e7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@biomejs/biome Minor
@biomejs/cli-win32-x64 Minor
@biomejs/cli-win32-arm64 Minor
@biomejs/cli-darwin-x64 Minor
@biomejs/cli-darwin-arm64 Minor
@biomejs/cli-linux-x64 Minor
@biomejs/cli-linux-arm64 Minor
@biomejs/cli-linux-x64-musl Minor
@biomejs/cli-linux-arm64-musl Minor
@biomejs/wasm-web Minor
@biomejs/wasm-bundler Minor
@biomejs/wasm-nodejs Minor
@biomejs/backend-jsonrpc Patch
@biomejs/js-api Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project A-Linter Area: linter A-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools A-LSP Area: language server protocol L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis L-HTML Language: HTML and super languages labels Nov 26, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

Walkthrough

This PR introduces multiple enhancements across Biome: new HTML accessibility lint rules (noAccessKey, useButtonType, useHtmlLang), a TypeScript interface member sorting assist, JSX factory configuration support from tsconfig.json, improvements to the useHookAtTopLevel rule for detecting module-level hook usage, custom extension mappings for useImportExtensions, configurable file watcher options, standardised logging configuration via LogOptions, LSP project-scanning progress reporting with UUID tokens, and a complete new YAML formatter crate. Additionally, KeyValuePair's API shifts from tuple-like construction to an explicit new() constructor with optional padding configuration.

Possibly related PRs

Suggested labels

A-Core

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'chore: merge next into main' clearly and accurately describes the primary action: merging the next branch into main.
Description check ✅ Passed The PR description relates to the changeset by providing explicit merge instructions and referencing the contribution guidelines, though it lacks specific details about Test Plan and Docs.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch next

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4186b83 and ce40337.

⛔ Files ignored due to path filters (4)
  • Cargo.lock is excluded by !**/*.lock and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/full_support.snap is excluded by !**/*.snap and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
📒 Files selected for processing (6)
  • Cargo.toml (1 hunks)
  • crates/biome_cli/src/cli_options.rs (0 hunks)
  • crates/biome_cli/src/commands/mod.rs (14 hunks)
  • crates/biome_cli/src/logging.rs (2 hunks)
  • crates/biome_configuration/src/analyzer/assist/actions.rs (9 hunks)
  • crates/biome_configuration/src/lib.rs (1 hunks)
💤 Files with no reviewable changes (1)
  • crates/biome_cli/src/cli_options.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • Cargo.toml
  • crates/biome_cli/src/logging.rs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use the Rust dbg!() macro for debugging output during test execution, and pass the --show-output flag to cargo test to display debug output.
Use snapshot testing with the insta crate for testing in Rust projects. Accept or reject snapshots using cargo insta accept, cargo insta reject, or cargo insta review.
Write doc comments as doc tests in Rust using code blocks with assertions that will be executed during the testing phase.
Use rustdoc inline documentation for rules, assists, and their options. Create corresponding documentation PRs for other documentation updates against the next branch of the website repository.
Set the version metadata field in linter rule implementations to 'next' for newly created rules. Update this field to the new version number when releasing a minor or major version.

Files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_configuration/src/lib.rs
🧠 Learnings (35)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.014Z
Learning: Target PRs to the `main` branch for bugfixes, new nursery rules, and features that don't affect end users. Target PRs to the `next` branch for promoted rules and features affecting end users.
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.036Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.014Z
Learning: For bugfix/feature PRs visible to Biome toolchain users or affecting published crates, create a changeset using the `just new-changeset` command with appropriate package selection, change type (major/minor/patch), and description.
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule option fields should be wrapped in 'Option<_>' to properly track set and unset options during configuration merging

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_configuration/src/lib.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : The rule option serde configuration must include 'rename_all = "camelCase"' to match biome.json naming conventions

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_configuration/src/lib.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule option structs must implement the 'biome_deserialize::Merge' trait to handle merging shared and user configurations

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options must be defined in the `biome_rule_options` crate in a file matching the rule name (e.g., 'use_this_convention.rs' for rule `useThisConvention`)

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule option structs must derive 'Deserializable', 'Serialize', 'Deserialize', and optionally 'JsonSchema' traits with serde attributes

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule option fields should use 'Box<[Box<str>]>' instead of 'Vec<String>' for array types to save memory

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Rules that ensure consistency across the codebase should use the 'useConsistent<Concept>' naming convention (e.g., `useConsistentArrayType`)

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Rule diagnostic and action functions must set the category using 'rule_category!()' macro instead of dynamically parsing string names

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : The rule option serde configuration must include 'deny_unknown_fields' to raise errors for extraneous fields in configuration

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration/src/lib.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Rules should be implemented with the 'impl Rule for RuleName' trait, including 'run' function that returns signals and optional 'diagnostic' and 'action' functions

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Rules ported from other ecosystems should include a 'sources' field in the 'declare_lint_rule!' macro with RuleSource metadata (e.g., '::ESLint')

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Rule names should follow the 'use<Concept>' prefix when a rule's sole intention is to mandate a single concept (e.g., `useValidLang` for valid HTML lang attribute values)

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Rules that provide code actions must declare a 'fix_kind' field in the 'declare_lint_rule!' macro with either 'FixKind::Safe' or 'FixKind::Unsafe'

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Use 'let else' pattern to reduce code branching when the rule's run function returns 'Vec'

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Avoid deep indentation in rule implementations by using Rust helper functions like 'map', 'filter', and 'and_then' instead of nested if-let statements

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:06:03.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.536Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Parse rule functions must be prefixed with `parse_` and use the name defined in the grammar file, e.g., `parse_for_statement` or `parse_expression`

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Code blocks in documentation marked with 'options' should contain only rule-specific options in JSON/JSONC format, while 'full_options' contains complete biome.json configuration

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Rule documentation must have a '## Options' section after the '## Examples' section if the rule supports options, with each option having its own h3 header

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Rules that overwhelmingly apply to a specific framework should be named using 'use<Framework>...' or 'no<Framework>...' prefix (e.g., `noVueReservedProps`)

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Rules should only have severity set to 'error' if they report hard errors, dangerous code, or accessibility issues; use 'warn' for possibly erroneous code; use 'info' for stylistic suggestions

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration/src/lib.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Code blocks in documentation marked with 'use_options' must follow a preceding configuration block marked with 'options' or 'full_options'

Applied to files:

  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:04:57.290Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.290Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper types from the biome_diagnostics::v2 module (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) or implement the Advices trait yourself for custom advice handling

Applied to files:

  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_configuration/src/lib.rs
📚 Learning: 2025-11-24T18:06:12.017Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.017Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Implement watcher tests for workspace methods in watcher.tests.rs and end-to-end tests in LSP tests

Applied to files:

  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:06:12.017Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.017Z
Learning: Debug the WorkspaceWatcher by starting the daemon with cargo run --bin=biome -- start and running commands such as cargo run --bin=biome -- lint --use-server <path>

Applied to files:

  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:03:52.014Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.014Z
Learning: For bugfix/feature PRs visible to Biome toolchain users or affecting published crates, create a changeset using the `just new-changeset` command with appropriate package selection, change type (major/minor/patch), and description.

Applied to files:

  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:06:12.017Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.017Z
Learning: Applies to crates/biome_service/src/workspace*.rs : Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances

Applied to files:

  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:06:12.017Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.017Z
Learning: Applies to crates/biome_service/src/workspace_watcher.rs : Use WorkspaceWatcher to keep workspace state in sync with the filesystem, and only activate it in daemon mode

Applied to files:

  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:06:12.017Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.017Z
Learning: Applies to crates/biome_service/src/workspace/server.rs : Use WorkspaceServer implementation for maintaining workspace state in daemon mode and CLI daemonless mode

Applied to files:

  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:06:12.017Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.017Z
Learning: Applies to crates/biome_service/src/workspace/client.rs : Use WorkspaceClient implementation for creating connections to the daemon and communicating with WorkspaceServer

Applied to files:

  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : The 'declare_lint_rule!' macro must include a 'version' field set to 'next' to allow flexibility for the actual release version

Applied to files:

  • crates/biome_configuration/src/lib.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Code blocks in documentation marked with 'expect_diagnostic' must emit exactly one diagnostic for the build system to generate it automatically

Applied to files:

  • crates/biome_configuration/src/lib.rs
📚 Learning: 2025-11-24T18:04:57.290Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.290Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Implement the Diagnostic trait on types, or use the #[derive(Diagnostic)] procedural macro to implement the trait. Configure category, severity, description, message, location, and tags using the #[diagnostic] attribute

Applied to files:

  • crates/biome_configuration/src/lib.rs
📚 Learning: 2025-11-24T18:04:57.290Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.290Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use #[derive(Diagnostic)] on enums when every variant contains a type that is itself a diagnostic

Applied to files:

  • crates/biome_configuration/src/lib.rs
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Code blocks in rule documentation must specify a language and use 'expect_diagnostic' property for invalid snippets that should emit exactly one diagnostic

Applied to files:

  • crates/biome_configuration/src/lib.rs
🧬 Code graph analysis (2)
crates/biome_configuration/src/analyzer/assist/actions.rs (2)
crates/biome_service/src/workspace_types.rs (1)
  • Self (748-748)
crates/biome_configuration/src/analyzer/mod.rs (1)
  • RuleFilter (722-722)
crates/biome_cli/src/commands/mod.rs (3)
crates/biome_cli/src/logging.rs (2)
  • default (75-83)
  • setup_cli_subscriber (86-127)
crates/biome_service/src/scanner/watcher.rs (2)
  • default (47-52)
  • run (208-252)
crates/biome_cli/src/lib.rs (1)
  • run (68-311)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (43)
  • GitHub Check: Parser conformance
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_tailwind_parser)
  • GitHub Check: Check JS Files
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Validate rules documentation
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Build @biomejs/wasm-web
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_tailwind_parser)
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_configuration)
🔇 Additional comments (10)
crates/biome_configuration/src/lib.rs (1)

474-476: Constructor-based KeyValuePair usage looks spot on

Switching to KeyValuePair::new keeps this diagnostic aligned with the updated API, without changing behaviour. No notes from me here.

crates/biome_configuration/src/analyzer/assist/actions.rs (4)

221-227: GROUP_RULES ordering is correct for binary search.

The array maintains alphabetical order (organizeImports < useSortedAttributes < useSortedInterfaceMembers < useSortedKeys < useSortedProperties), which is required by the binary_search call in has_rule (line 300). The existing test at lines 341-346 will catch any ordering regressions.


252-266: Index mappings are consistent.

The indices used in get_enabled_rules and get_disabled_rules correctly align with the positions in GROUP_RULES:

  • Index 0: organizeImports
  • Index 1: useSortedAttributes
  • Index 2: useSortedInterfaceMembers (new)
  • Index 3: useSortedKeys (shifted)
  • Index 4: useSortedProperties (shifted)

Also applies to: 281-295


200-206: New field and configuration retrieval wired correctly.

The use_sorted_interface_members field follows the established pattern with proper serde attributes and doc comment linking to the documentation URL. The get_rule_configuration match arm correctly retrieves the options.

Also applies to: 325-328


1-1: Review comment concern is not valid — assist rule is properly registered and codegen sources are up-to-date.

The generated file is correctly built from the assist registry. The new UseSortedInterfaceMembers action is:

  1. Implemented in crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
  2. Registered in the assist group in crates/biome_js_analyze/src/assist/source.rs (also auto-generated)
  3. Properly pulled into the configuration file during codegen

Running codegen again will not clobber these changes — it will regenerate them correctly from the registry. No manual template updates are needed.

crates/biome_cli/src/commands/mod.rs (5)

5-6: LGTM!

The new imports for centralized logging configuration (LogOptions, log_options, LoggingKind, WatcherOptions, watcher_options) are clean and align with the refactoring objectives.

Also applies to: 53-53


692-700: LGTM!

The refactoring of log_level() and log_kind() to read from the centralized log_options() accessor is clean and maintains sensible defaults. The implementation correctly handles the Option type with map_or.


897-908: LGTM!

The updated CommandRunner::run signature correctly threads log_options through to setup_cli_subscriber, replacing the previous reading from cli_options. The implementation is sound and aligns with the centralized logging configuration pattern.


86-86: LGTM!

The addition of log_options and watcher_options fields across the command variants is consistent and properly annotated with bpaf attributes. The pattern is uniform: commands that need watcher functionality get both options, whilst others get logging only. Well-structured refactoring.

Also applies to: 100-104, 161-162, 252-253, 350-351, 416-417, 459-463, 471-472, 502-503, 570-571, 576-577


632-652: This accessor pattern is intentional—daemon commands bypass it entirely.

Verification confirms this is correct design, not an oversight:

  1. Daemon commands receive log_options as direct parameters in their handlers (lib.rs lines 75, 254, 296) and pass them directly to daemon functions (daemon::start, daemon::lsp_proxy, daemon::run_server)

  2. Daemon handlers use log_options fields directly, not through the accessor:

    • daemon::start() passes to ensure_daemon()
    • daemon::lsp_proxy() passes to ensure_daemon()
    • daemon::run_server() accesses log_options.log_path and log_options.log_prefix_name directly for tracing setup
  3. The accessor methods log_level() and log_kind() are never called on daemon commands—they exist only for non-daemon commands that need to query these values

  4. This mirrors the cli_options() pattern for the same architectural reason: daemon commands have separate execution pathways that bypass accessor layers

The design separates concerns: non-daemon commands use the accessor API for flexibility and defaults; daemon commands own their configuration lifecycle and pass it through directly. Including daemon variants in the accessor would be misleading since nothing actually calls these methods on them.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (12)
crates/biome_yaml_formatter/src/verbatim.rs (1)

97-106: Consider using .find() instead of .take_while().next().

The current chain achieves the same result as .find(), but the latter expresses intent more directly.

         let start_source = self
             .node
             .first_leading_trivia()
             .into_iter()
             .flat_map(|trivia| trivia.pieces())
             .filter(|trivia| trivia.is_skipped())
             .map(|trivia| source_range(f, trivia.text_range()).start())
-            .take_while(|start| *start < trimmed_source_range.start())
-            .next()
+            .find(|start| *start < trimmed_source_range.start())
             .unwrap_or_else(|| trimmed_source_range.start());
.changeset/witty-ears-hammer.md (1)

1-22: Good, rule-focused changeset with examples

Nice user-facing summary: past tense for the addition, present tense for behaviour, plus clear invalid/valid examples. If there’s a public rule doc URL handy, you could optionally link it here for quicker discoverability, but it’s not required.

crates/biome_cli/tests/snap_test.rs (1)

271-303: Be careful: trim() here may eat newlines/indentation

Using before.trim() normalises all surrounding whitespace, including leading newlines/indentation, then forces a single space before <BIOME_DIR>. That can join the placeholder onto the previous line rather than keeping it on its own/indented line.

If the goal is just to avoid duplicated spaces before the placeholder while preserving line breaks and leading indentation, consider something like:

-        result.push_str(before.trim());
-        result.push(' ');
+        result.push_str(before.trim_end());
+        if !before.ends_with(char::is_whitespace) {
+            result.push(' ');
+        }

Or a similar trim_end‑based approach, depending on exactly how you want the snapshots to look.

crates/biome_flags/src/lib.rs (1)

104-223: Consider extracting the repetitive Display logic.

The match-based formatting for each env variable is quite repetitive. A helper method on BiomeEnvVariable could reduce boilerplate:

impl BiomeEnvVariable {
    fn fmt_with_padding(&self, fmt: &mut Formatter, padding: usize) -> std::io::Result<()> {
        match self.value() {
            None => KeyValuePair::new(self.name, markup! { <Dim>"unset"</Dim> })
                .with_padding(padding)
                .fmt(fmt),
            Some(value) => KeyValuePair::new(self.name, markup! {{DebugDisplay(value)}})
                .with_padding(padding)
                .fmt(fmt),
        }
    }
}

Then the Display impl becomes a series of self.biome_*.fmt_with_padding(fmt, padding)?; calls.

.changeset/six-plants-lie.md (1)

9-17: Minor: Trailing comma in example.

The JSON example has a trailing comma on line 13 that makes it invalid JSON. Consider removing it for clarity, though users will understand the intent.

Apply this diff:

         "extensionMappings": {
-            "ts": "js",
+            "ts": "js"
         }
.changeset/every-beers-sleep.md (1)

1-24: Minor wording polish for watcher option description

The description is clear, but you could make it read a touch more naturally with tiny edits like:

- The option accepts the current values:
+ The option accepts the following values:
@@
-- `none`: it doesn't enable the watcher. When the watcher is disabled, changes to files aren't recorded anymore by Biome. This might have
-  repercussions on some lint rules that might rely on updated types or updated paths.
+- `none`: it doesn't enable the watcher. When the watcher is disabled, changes to files are no longer recorded by Biome. This might have
+  repercussions for some lint rules that rely on updated types or paths.

Purely optional, the existing text is already understandable.

crates/biome_js_analyze/src/lint/correctness/use_import_extensions.rs (1)

80-105: extensionMappings behaviour matches docs; consider clarifying precedence with forceJsExtensions

The new extensionMappings option and its use in get_extensionless_import look sound: when a mapping exists for the resolved extension, that mapped extension is suggested; otherwise you fall back to the resolved extension, preserving the existing .d.ts and sub‑extension handling.

Note that forceJsExtensions is evaluated first, so if both forceJsExtensions: true and extensionMappings are set, forceJsExtensions always wins and mappings are effectively ignored. If you intend mappings to be the more specific override, it might be worth either swapping the order or explicitly documenting that forceJsExtensions takes precedence.

Also applies to: 286-295

crates/biome_js_analyze/tests/specs/correctness/useHookAtTopLevel/hookLocations.js (1)

1-48: Nice coverage of hook locations across contexts

This fixture exercises a good spread of cases for useHookAtTopLevel (module scope, non‑components, components/hooks by naming convention, object/class methods, and various test callback shapes including renderHook). The mixed valid/invalid examples in a single file are fine here; just be aware it diverges from the valid/invalid file‑prefix convention if you ever rely on that mechanically.

crates/biome_cli/src/logging.rs (1)

1-3: Avoid drifting defaults between bpaf fallbacks and LogOptions::default

LogOptions nicely centralises logging configuration, but the default values are now encoded twice: once via the #[bpaf(fallback(...))] attributes and again in the manual Default impl. If one side changes (e.g. log path or prefix) it’s easy for the two to diverge.

Consider factoring the defaults into associated constants or a fn default_log_options() -> LogOptions used both by bpaf (via fallback) and by the Default impl, so there’s a single source of truth.

Also applies to: 15-83

crates/biome_js_analyze/src/lint/style/use_import_type.rs (1)

1-4: JSX factory detection in useImportType correctly avoids flagging runtime-only imports

The new is_jsx_factory_binding helper and its use at the various import sites mean:

  • Under JsxRuntime::ReactClassic, default/namespace bindings that are either:

    • the standard React global, or
    • match configured jsxFactory/jsxFragmentFactory

    are treated as value imports and exempt from the “only used as a type” checks.

That should eliminate spurious import type suggestions for React or custom JSX factory imports that are only referenced via JSX. The helper being gated on ReactClassic also matches how custom factories are used today; if you later support custom factories under other runtimes, this will be the natural place to extend.

Also applies to: 195-201, 251-268, 277-282, 343-349, 1100-1129

crates/biome_html_analyze/src/lint/a11y/use_button_type.rs (1)

111-115: Minor inconsistency with sibling rule helper.

The is_button_element helper uses name.text() whilst is_html_element in use_html_lang.rs uses token_text. Both operate on AnyHtmlElement::name(). Consider aligning the approach for consistency across the a11y rules.

 fn is_button_element(element: &AnyHtmlElement) -> bool {
     element
         .name()
-        .is_some_and(|name| name.text().eq_ignore_ascii_case("button"))
+        .is_some_and(|token_text| token_text.eq_ignore_ascii_case("button"))
 }
crates/biome_cli/src/service/unix.rs (1)

56-84: LGTM! Clean consolidation of daemon spawn arguments.

The refactor from individual parameters to structured WatcherOptions and LogOptions improves maintainability. The command-line argument construction properly forwards all relevant configuration.

One minor observation: the parameter is named watcher_configuration here (line 58) but watcher_options in the Windows counterpart (crates/biome_cli/src/service/windows.rs, line 190). Consider aligning the naming for consistency across platforms.

 fn spawn_daemon(
     stop_on_disconnect: bool,
-    watcher_configuration: WatcherOptions,
+    watcher_options: WatcherOptions,
     log_options: LogOptions,
 ) -> io::Result<Child> {

"@biomejs/biome": minor
---

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](https://biomejs.dev/linter/rules/no-unused-imports/) errors for custom JSX libraries like Preact.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix spacing in description text.

Line 5 has a missing space after the closing backtick. Should be:

-Added support for `jsxFactory` and `jsxFragmentFactory`.Biome now respects...
+Added support for `jsxFactory` and `jsxFragmentFactory`. Biome now respects...

Otherwise, the changeset is well-structured with good examples and a helpful rule link. Nice work! ✓

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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](https://biomejs.dev/linter/rules/no-unused-imports/) errors for custom JSX libraries like Preact.
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](https://biomejs.dev/linter/rules/no-unused-imports/) errors for custom JSX libraries like Preact.
🤖 Prompt for AI Agents
In .changeset/eight-eels-pull.md around line 5, the sentence "Added support for
`jsxFactory` and `jsxFragmentFactory`.Biome now respects..." is missing a space
after the closing backtick; edit that line to insert a space after the backtick
so it reads "...`jsxFragmentFactory`. Biome now respects..." to fix the spacing.

Comment on lines +45 to +47
fn source_map(&self) -> Option<&TransformSourceMap> {
None
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Bug: source_map() always returns None despite the field being set.

The with_source_map method on line 32 sets self.source_map, but this accessor ignores it and always returns None. This breaks source map functionality used in verbatim.rs (lines 60-63, 108-116).

     fn source_map(&self) -> Option<&TransformSourceMap> {
-        None
+        self.source_map.as_ref()
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fn source_map(&self) -> Option<&TransformSourceMap> {
None
}
fn source_map(&self) -> Option<&TransformSourceMap> {
self.source_map.as_ref()
}
🤖 Prompt for AI Agents
In crates/biome_yaml_formatter/src/context.rs around lines 45-47, the
source_map() accessor currently always returns None even though with_source_map
sets self.source_map; change the method to return a reference to the stored
Option by returning self.source_map.as_ref() (or Some(&self.source_map) if the
field is not an Option) so callers receive the actual TransformSourceMap; ensure
the function signature remains fn source_map(&self) ->
Option<&TransformSourceMap> and compile.

Comment on lines +234 to +242
/// Rule for formatting an bogus nodes.
pub(crate) trait FormatBogusNodeRule<N>
where
N: AstNode<Language = YamlLanguage>,
{
fn fmt(&self, node: &N, f: &mut YamlFormatter) -> FormatResult<()> {
format_bogus_node(node.syntax()).fmt(f)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Minor typo in doc comment.

"an bogus nodes" → "a bogus node" or "bogus nodes".

-/// Rule for formatting an bogus nodes.
+/// Rule for formatting bogus nodes.
 pub(crate) trait FormatBogusNodeRule<N>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/// Rule for formatting an bogus nodes.
pub(crate) trait FormatBogusNodeRule<N>
where
N: AstNode<Language = YamlLanguage>,
{
fn fmt(&self, node: &N, f: &mut YamlFormatter) -> FormatResult<()> {
format_bogus_node(node.syntax()).fmt(f)
}
}
/// Rule for formatting bogus nodes.
pub(crate) trait FormatBogusNodeRule<N>
where
N: AstNode<Language = YamlLanguage>,
{
fn fmt(&self, node: &N, f: &mut YamlFormatter) -> FormatResult<()> {
format_bogus_node(node.syntax()).fmt(f)
}
}
🤖 Prompt for AI Agents
In crates/biome_yaml_formatter/src/lib.rs around lines 234 to 242, the doc
comment for the trait reads "Rule for formatting an bogus nodes" which contains
a typo and grammatical error; update the comment to use correct article and
number, e.g. "Rule for formatting a bogus node" or "Rule for formatting bogus
nodes" to match intended meaning and keep it consistent with surrounding docs.

@dyc3 dyc3 marked this pull request as draft November 26, 2025 14:55
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 26, 2025

Open in StackBlitz

npm i https://pkg.pr.new/biomejs/biome/@biomejs/wasm-web@8275

commit: 789b0e7

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 26, 2025

CodSpeed Performance Report

Merging #8275 will not alter performance

Comparing next (a248e88) with main (2a229e4)1

Summary

✅ 58 untouched
⏩ 95 skipped2

Footnotes

  1. No successful run was found on main (ac0fb2d) during the generation of this report, so 2a229e4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 95 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 51887 51887 0
Passed 50674 50674 0
Failed 1171 1171 0
Panics 42 42 0
Coverage 97.66% 97.66% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6323 6323 0
Passed 2106 2106 0
Failed 4217 4217 0
Panics 0 0 0
Coverage 33.31% 33.31% 0.00%

ts/babel

Test result main count This PR count Difference
Total 835 835 0
Passed 742 742 0
Failed 93 93 0
Panics 0 0 0
Coverage 88.86% 88.86% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18823 18823 0
Passed 14069 14069 0
Failed 4753 4753 0
Panics 1 1 0
Coverage 74.74% 74.74% 0.00%

@github-actions github-actions bot added L-CSS Language: CSS L-Grit Language: GritQL labels Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Diagnostic Area: diagnostocis A-Formatter Area: formatter A-Linter Area: linter A-LSP Area: language server protocol A-Parser Area: parser A-Project Area: project A-Tooling Area: internal tools L-CSS Language: CSS L-Grit Language: GritQL L-HTML Language: HTML and super languages L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.