Skip to content

chore: refactor some codgen to use proc macros to avoid merge conflicts for new rules#8633

Merged
dyc3 merged 1 commit intomainfrom
dyc3/merge-conflict-mitigation
Jan 2, 2026
Merged

chore: refactor some codgen to use proc macros to avoid merge conflicts for new rules#8633
dyc3 merged 1 commit intomainfrom
dyc3/merge-conflict-mitigation

Conversation

@dyc3
Copy link
Contributor

@dyc3 dyc3 commented Dec 30, 2025

Summary

A frequent point of friction, particularly for contributors adding new rules, is the merge conflicts that occur as a result of merging other new rules.

This aims to make it so that in most cases, merging new rules will not require other PRs to rebase. Or at least start moving us in that direction.

This is not quite complete yet, because currently all json rules are excluded because of a circular dependency problem. Fixed lower in the PR stack.

Test Plan

it builds, ci should be green

Docs

@changeset-bot
Copy link

changeset-bot bot commented Dec 30, 2025

⚠️ No Changeset found

Latest commit: 7c51452

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions bot added A-Project Area: project A-Tooling Area: internal tools labels Dec 30, 2025
@dyc3 dyc3 force-pushed the dyc3/merge-conflict-mitigation branch from d446389 to 5f5506b Compare December 30, 2025 22:29
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 30, 2025

CodSpeed Performance Report

Merging #8633 will not alter performance

Comparing dyc3/merge-conflict-mitigation (7c51452) with main (e287eb6)

Summary

✅ 58 untouched
⏩ 95 skipped1

Footnotes

  1. 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

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 52650 52650 0
Passed 51437 51437 0
Failed 1171 1171 0
Panics 42 42 0
Coverage 97.70% 97.70% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 38 38 0
Passed 37 37 0
Failed 1 1 0
Panics 0 0 0
Coverage 97.37% 97.37% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6339 6339 0
Passed 2110 2110 0
Failed 4229 4229 0
Panics 0 0 0
Coverage 33.29% 33.29% 0.00%

ts/babel

Test result main count This PR count Difference
Total 626 626 0
Passed 561 561 0
Failed 65 65 0
Panics 0 0 0
Coverage 89.62% 89.62% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18849 18849 0
Passed 14092 14092 0
Failed 4756 4756 0
Panics 1 1 0
Coverage 74.76% 74.76% 0.00%

@dyc3 dyc3 changed the base branch from main to graphite-base/8633 December 31, 2025 12:14
@dyc3 dyc3 force-pushed the graphite-base/8633 branch from 17a6156 to d77e7a2 Compare December 31, 2025 12:14
@dyc3 dyc3 force-pushed the dyc3/merge-conflict-mitigation branch from 73d7dd7 to b436611 Compare December 31, 2025 12:14
@dyc3 dyc3 changed the base branch from graphite-base/8633 to dyc3/refactor-out-config-dep December 31, 2025 12:15
Copy link
Contributor Author

dyc3 commented Dec 31, 2025

@dyc3 dyc3 marked this pull request as ready for review December 31, 2025 16:47
@dyc3 dyc3 requested review from a team December 31, 2025 16:47
Base automatically changed from dyc3/refactor-out-config-dep to main January 2, 2026 13:43
@dyc3 dyc3 force-pushed the dyc3/merge-conflict-mitigation branch from b436611 to 27f8e24 Compare January 2, 2026 14:04
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2026

Walkthrough

This change extracts hardcoded group struct generation into a new procedural-macro crate (crates/biome_configuration_macros). The inline Source group struct and its impl in the assist actions module were removed and replaced by a macro invocation. The macros collect rule metadata via new visitors and emit per-group structs and helpers. The xtask codegen now invokes these macros instead of generating group structs inline. A new proc-macro crate manifest and supporting files were added.

Possibly related PRs

  • feat(html): analyzer #5814 — Also touches the configuration code-generation pipeline; related through group-struct generation and codegen changes.

Suggested reviewers

  • ematipico
  • arendjr

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring code generation to use proc macros to reduce merge conflicts when adding new rules.
Description check ✅ Passed The description clearly explains the motivation (reducing merge conflicts for new rules) and aligns with the changeset that introduces procedural macros for code generation.
✨ Finishing touches
  • 📝 Generate docstrings

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 (3)
crates/biome_configuration_macros/src/visitors.rs (1)

1-219: Consider extracting shared visitor logic to a separate crate.

The LintRulesVisitor and AssistActionsVisitor implementations here are identical to those in xtask/codegen/src/generate_configuration.rs. Extracting these to a third library crate would eliminate duplication, though this would require additional setup. For now, accepting this duplication is reasonable given the proc-macro constraint and the PR's goal of reducing merge conflicts.

crates/biome_configuration_macros/src/group_struct.rs (2)

47-59: Consider improving error messages for unhandled Markdown elements.

The panics are acceptable in a proc-macro context as they surface as compile errors. However, including the rule name in the panic message would help developers identify which rule's documentation contains unsupported Markdown.

🔎 Proposed improvement
                     Event::Start(tag) => match tag {
                         Tag::Emphasis | Tag::Strong | Tag::Paragraph => {}
-                        _ => panic!("Unimplemented tag {:?}", { tag }),
+                        _ => panic!("Unimplemented tag {:?} in docs for rule '{}'", tag, rule),
                     },

                     Event::End(tag) => match tag {
                         TagEnd::Emphasis | TagEnd::Strong | TagEnd::Paragraph => {}
-                        _ => panic!("Unimplemented tag {:?}", { tag }),
+                        _ => panic!("Unimplemented tag {:?} in docs for rule '{}'", tag, rule),
                     },

                     _ => {
-                        panic!("Unimplemented event {:?}", { event })
+                        panic!("Unimplemented event {:?} in docs for rule '{}'", event, rule)
                     }

234-239: Add explicit parentheses for clarity.

The current expression relies on && having higher precedence than ||. While the evaluation is likely correct, explicit parentheses would make the intent immediately clear.

🔎 Proposed improvement
-                    if self.is_recommended_true() || self.is_recommended_unset() && parent_is_recommended {
+                    if self.is_recommended_true() || (self.is_recommended_unset() && parent_is_recommended) {

Same applies to line 321.

📜 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 e287eb6 and 27f8e24.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
📒 Files selected for processing (8)
  • Cargo.toml
  • crates/biome_configuration/Cargo.toml
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/Cargo.toml
  • crates/biome_configuration_macros/src/group_struct.rs
  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
🧰 Additional context used
📓 Path-based instructions (2)
**/Cargo.toml

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/Cargo.toml: Use workspace dependencies with workspace = true for internal crates in Cargo.toml
Use path dependencies for dev-dependencies in crates to avoid requiring published versions

Files:

  • crates/biome_configuration_macros/Cargo.toml
  • Cargo.toml
  • crates/biome_configuration/Cargo.toml
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use the dbg!() macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests

Files:

  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/group_struct.rs
🧠 Learnings (48)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/context.rs : Define `<Language>FormatContext` struct in a `context.rs` file containing `comments` and `source_map` fields, implementing `FormatContext` and `CstFormatContext` traits
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/Cargo.toml : Include development dependencies in `Cargo.toml` for formatter tests: `biome_formatter_test`, `biome_<language>_factory`, `biome_<language>_parser`, `biome_parser`, `biome_service`, `countme`, `iai`, `quickcheck`, `quickcheck_macros`, and `tests_macros`

Applied to files:

  • crates/biome_configuration_macros/Cargo.toml
  • Cargo.toml
  • crates/biome_configuration/Cargo.toml
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro

Applied to files:

  • crates/biome_configuration_macros/Cargo.toml
  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration/Cargo.toml
  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Create two new crates `biome_{language}_syntax` and `biome_{language}_factory` using `cargo new --lib` for new language parsers

Applied to files:

  • crates/biome_configuration_macros/Cargo.toml
  • Cargo.toml
  • crates/biome_configuration/Cargo.toml
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Applies to **/Cargo.toml : Use workspace dependencies with `workspace = true` for internal crates in Cargo.toml

Applied to files:

  • crates/biome_configuration_macros/Cargo.toml
  • Cargo.toml
  • crates/biome_configuration/Cargo.toml
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` field in `declare_lint_rule!` macro to the language the rule primarily applies to

Applied to files:

  • crates/biome_configuration_macros/Cargo.toml
  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
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_configuration_macros/Cargo.toml
  • Cargo.toml
  • crates/biome_configuration/Cargo.toml
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `deprecated` field to `declare_lint_rule!` macro when deprecating a rule

Applied to files:

  • crates/biome_configuration_macros/Cargo.toml
  • crates/biome_configuration_macros/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_lint_rule!` macro to declare analyzer rule types and implement the RuleMeta trait

Applied to files:

  • crates/biome_configuration_macros/Cargo.toml
  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation

Applied to files:

  • crates/biome_configuration_macros/Cargo.toml
  • Cargo.toml
  • crates/biome_configuration/Cargo.toml
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance

Applied to files:

  • crates/biome_configuration_macros/Cargo.toml
  • Cargo.toml
  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration/Cargo.toml
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Build debug binaries using `cargo build --bin biome` for development and triaging

Applied to files:

  • crates/biome_configuration_macros/Cargo.toml
  • Cargo.toml
  • crates/biome_configuration/Cargo.toml
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation

Applied to files:

  • crates/biome_configuration_macros/Cargo.toml
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options must be placed inside the `biome_rule_options` crate

Applied to files:

  • crates/biome_configuration_macros/Cargo.toml
  • Cargo.toml
  • crates/biome_configuration/Cargo.toml
  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
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:

  • Cargo.toml
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Applies to **/Cargo.toml : Use path dependencies for dev-dependencies in crates to avoid requiring published versions

Applied to files:

  • Cargo.toml
  • crates/biome_configuration/Cargo.toml
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
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:

  • Cargo.toml
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output

Applied to files:

  • Cargo.toml
  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options

Applied to files:

  • Cargo.toml
  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration/Cargo.toml
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : No module may copy or clone data from another module in the module graph, not even behind an `Arc`

Applied to files:

  • Cargo.toml
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `domains` field in `declare_lint_rule!` to tag rules that belong to specific concepts like testing or frameworks

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use generic rule names if the rule could potentially be implemented for multiple languages

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-22T09:27:13.161Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:27:13.161Z
Learning: In crates/biome_analyze/**/*analyze/src/**/*.rs, the `fix_kind` field in `declare_lint_rule!` should only be specified when the rule implements the `action` function. Rules that only emit diagnostics without providing code fixes should not include `fix_kind` in their metadata.

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new language prefix to the `LANGUAGE_PREFIXES` constant in `language_kind.rs` file

Applied to files:

  • crates/biome_configuration/Cargo.toml
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options struct must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema`

Applied to files:

  • crates/biome_configuration/Cargo.toml
  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rules with `recommended: true` and no domains are enabled by default

Applied to files:

  • crates/biome_configuration/Cargo.toml
  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rules with `recommended: true` and domains are only enabled when the domain is enabled

Applied to files:

  • crates/biome_configuration/Cargo.toml
  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `deny_unknown_fields` in serde derive macro for rule options

Applied to files:

  • crates/biome_configuration/Cargo.toml
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Implement `action` function in Rule trait to provide code actions

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/visitors.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `info` for code action rules in analyzer

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Implement custom Visitor by implementing the Visitor trait for complex rule logic

Applied to files:

  • crates/biome_configuration_macros/src/visitors.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use language-specific rule names if the rule is meant for a specific language only

Applied to files:

  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`

Applied to files:

  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `warn` or `info` for rules in complexity group

Applied to files:

  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions

Applied to files:

  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `error` for rules in correctness, security, and a11y groups

Applied to files:

  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `info` or `warn` for rules in style group

Applied to files:

  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `warn` or `error` for rules in suspicious group

Applied to files:

  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each rule option must have its own h3 header with description, default value, options block, and code example

Applied to files:

  • crates/biome_configuration_macros/src/group_struct.rs
🧬 Code graph analysis (4)
crates/biome_configuration_macros/src/lib.rs (3)
crates/biome_configuration_macros/src/group_struct.rs (1)
  • generate_group_struct (10-343)
crates/biome_configuration/src/analyzer/assist/actions.rs (1)
  • group (82-89)
crates/biome_html_analyze/src/registry.rs (1)
  • visit_registry (5-7)
crates/biome_configuration/src/analyzer/assist/actions.rs (1)
crates/biome_configuration_macros/src/lib.rs (1)
  • assist_group_structs (54-73)
crates/biome_configuration_macros/src/visitors.rs (1)
xtask/codegen/src/generate_configuration.rs (20)
  • record_category (28-32)
  • record_category (53-57)
  • record_category (72-76)
  • record_category (91-95)
  • record_category (110-114)
  • record_category (135-139)
  • record_category (153-157)
  • record_category (172-176)
  • record_category (191-195)
  • record_category (210-214)
  • record_rule (34-49)
  • record_rule (59-68)
  • record_rule (78-87)
  • record_rule (97-106)
  • record_rule (116-125)
  • record_rule (141-149)
  • record_rule (159-168)
  • record_rule (178-187)
  • record_rule (197-206)
  • record_rule (216-225)
xtask/codegen/src/generate_configuration.rs (2)
xtask/codegen/src/lib.rs (1)
  • update (58-78)
crates/biome_configuration_macros/src/lib.rs (2)
  • lint_group_structs (12-40)
  • assist_group_structs (54-73)
⏰ 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). (25)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Test Node.js API
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: End-to-end tests
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_tailwind_parser)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Parser conformance
  • GitHub Check: Bench (biome_package)
🔇 Additional comments (15)
crates/biome_configuration_macros/Cargo.toml (1)

1-34: LGTM!

The manifest correctly uses workspace = true for all internal biome_* crates and proc-macro tooling. The pulldown-cmark dependency with a hardcoded version is fine since it's an external crate not defined in the workspace dependencies.

crates/biome_configuration/Cargo.toml (1)

25-26: LGTM!

The biome_configuration_macros dependency is correctly added with workspace = true, following the project conventions.

Cargo.toml (1)

26-26: LGTM!

Workspace dependency correctly added without a version, consistent with other non-published internal crates.

xtask/codegen/src/generate_configuration.rs (1)

387-395: LGTM!

The conditional macro invocations cleanly delegate group struct generation to the new proc-macro crate, achieving the PR's goal of reducing merge conflicts.

crates/biome_configuration_macros/src/lib.rs (2)

11-40: LGTM!

The lint_group_structs macro is well-structured. It collects rules, iterates over the predefined groups, and generates the appropriate structs.


86-92: LGTM!

The to_capitalized helper is a clean, idiomatic implementation.

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

176-176: LGTM!

The macro invocation neatly replaces the hand-coded Source struct whilst maintaining compatibility with the rest of the generated file.

crates/biome_configuration_macros/src/group_struct.rs (8)

1-9: LGTM!

Imports are appropriate for the proc-macro context. Good use of BTreeMap from std::collections to ensure deterministic iteration order.


10-24: LGTM!

Clear function signature and well-organised collectors for the generated code tokens.


79-146: LGTM!

The token generation logic is well-structured. The conditional for recommended rules (requiring both recommended flag and empty domains) aligns with the domain-specific rule handling pattern.


149-169: LGTM!

Appropriate visibility modifiers: pub(crate) for Action's inherent method, and default visibility for Lint's trait implementation.


222-225: LGTM!

The binary_search works correctly here since GROUP_RULES is populated from BTreeMap iteration, which maintains sorted key order.


171-243: LGTM!

The Action branch generates a well-structured configuration struct with appropriate serde attributes and helper methods. The direct implementation (rather than trait) makes sense for the simpler Action case.


276-331: LGTM!

Clean RuleGroupExt trait implementation. The trait-based approach for Lint groups enables polymorphic handling of different rule groups.


333-340: LGTM!

The From<GroupPlainConfiguration> implementation correctly initialises all rule fields while leaving recommended as None, allowing the plain configuration to be applied without overriding recommendation settings.

}
};

let rule_position = Literal::u8_unsuffixed(index as u8);
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

Potential overflow when casting index to u8.

If a group ever contains more than 255 rules, this cast will silently truncate. While unlikely today, a compile-time assertion or using u16 would future-proof this.

🔎 Proposed fix
-        let rule_position = Literal::u8_unsuffixed(index as u8);
+        let rule_position = Literal::usize_unsuffixed(index);

Or add a compile-time check:

+        assert!(
+            index <= u8::MAX as usize,
+            "Group '{}' has more than 255 rules, which exceeds the u8 limit",
+            group
+        );
         let rule_position = Literal::u8_unsuffixed(index as u8);
📝 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
let rule_position = Literal::u8_unsuffixed(index as u8);
let rule_position = Literal::usize_unsuffixed(index);
🤖 Prompt for AI Agents
In crates/biome_configuration_macros/src/group_struct.rs around line 78, the
code casts index to u8 which can silently truncate for groups with >255 rules;
replace the u8 literal with a wider type (e.g., use a u16 unsuffixed literal and
cast index as u16) to future-proof, and update any downstream consumers/types if
needed; alternatively, if u8 is required, add a runtime/compile-time check
(assert or const_assert) that index <= u8::MAX before the cast to prevent silent
truncation.

Comment on lines +60 to +64
let Some(group) = input_assist.groups.get(group_name) else {
return TokenStream::from(quote! {
compile_error!(concat!("no such lint rule group found: ", group_name));
});
};
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

Inconsistent error message.

The error message says "lint rule group" but this is the assist_group_structs macro. Should read "assist rule group" for clarity.

🔎 Proposed fix
         let Some(group) = input_assist.groups.get(group_name) else {
             return TokenStream::from(quote! {
-                compile_error!(concat!("no such lint rule group found: ", group_name));
+                compile_error!(concat!("no such assist rule group found: ", group_name));
             });
         };
📝 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
let Some(group) = input_assist.groups.get(group_name) else {
return TokenStream::from(quote! {
compile_error!(concat!("no such lint rule group found: ", group_name));
});
};
let Some(group) = input_assist.groups.get(group_name) else {
return TokenStream::from(quote! {
compile_error!(concat!("no such assist rule group found: ", group_name));
});
};
🤖 Prompt for AI Agents
In crates/biome_configuration_macros/src/lib.rs around lines 60 to 64, the
compile_error message incorrectly refers to "lint rule group" but this is inside
the assist_group_structs macro; change the error string to read "assist rule
group" instead. Update the concat! literal so the emitted compile_error is
concat!("no such assist rule group found: ", group_name) (preserve existing
formatting and TokenStream construction).

@dyc3 dyc3 force-pushed the dyc3/merge-conflict-mitigation branch from 27f8e24 to 7c51452 Compare January 2, 2026 14:21
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: 0

♻️ Duplicate comments (3)
xtask/codegen/src/generate_configuration.rs (1)

375-381: Remove commented-out code.

This block appears to be leftover development code. The past review noted this was addressed in commit 7c51452, but the commented lines remain. Please remove them.

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

60-64: Inconsistent error message.

The error message says "lint rule group" but this is the assist_group_structs macro. Should read "assist rule group" for clarity.

🔎 Proposed fix
         let Some(group) = input_assist.groups.get(group_name) else {
             return TokenStream::from(quote! {
-                compile_error!(concat!("no such lint rule group found: ", group_name));
+                compile_error!(concat!("no such assist rule group found: ", group_name));
             });
         };
crates/biome_configuration_macros/src/group_struct.rs (1)

79-79: Potential overflow when casting index to u8.

If a group ever contains more than 255 rules, this cast will silently truncate. While unlikely today, consider a compile-time assertion or using usize.

🔎 Proposed fix
+        assert!(
+            index <= u8::MAX as usize,
+            "Group '{}' has more than 255 rules, which exceeds the u8 limit",
+            group
+        );
         let rule_position = Literal::u8_unsuffixed(index as u8);
🧹 Nitpick comments (1)
crates/biome_configuration_macros/src/group_struct.rs (1)

48-61: Panics on unhandled Markdown events during macro expansion.

These panic! calls will cause a compile-time error if rule documentation contains unsupported Markdown elements (e.g., links, images, lists). This is probably fine as a compile-time guard, but consider whether a more graceful fallback or skip would be preferable for robustness.

📜 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 27f8e24 and 7c51452.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
📒 Files selected for processing (8)
  • Cargo.toml
  • crates/biome_configuration/Cargo.toml
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/Cargo.toml
  • crates/biome_configuration_macros/src/group_struct.rs
  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • xtask/codegen/src/generate_configuration.rs
🚧 Files skipped from review as they are similar to previous changes (3)
  • Cargo.toml
  • crates/biome_configuration/Cargo.toml
  • crates/biome_configuration_macros/Cargo.toml
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use the dbg!() macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests

Files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • crates/biome_configuration_macros/src/group_struct.rs
🧠 Learnings (40)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/context.rs : Define `<Language>FormatContext` struct in a `context.rs` file containing `comments` and `source_map` fields, implementing `FormatContext` and `CstFormatContext` traits
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Implement a token source struct that wraps the lexer and implements `TokenSourceWithBufferedLexer` and `LexerWithCheckpoint` for lookahead and re-lexing capabilities
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_lint_rule!` macro to declare analyzer rule types and implement the RuleMeta trait

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/visitors.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` field in `declare_lint_rule!` macro to the language the rule primarily applies to

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/visitors.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `deprecated` field to `declare_lint_rule!` macro when deprecating a rule

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `domains` field in `declare_lint_rule!` to tag rules that belong to specific concepts like testing or frameworks

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/visitors.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/visitors.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-12-22T09:27:13.161Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:27:13.161Z
Learning: In crates/biome_analyze/**/*analyze/src/**/*.rs, the `fix_kind` field in `declare_lint_rule!` should only be specified when the rule implements the `action` function. Rules that only emit diagnostics without providing code fixes should not include `fix_kind` in their metadata.

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/visitors.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `error` for rules in correctness, security, and a11y groups

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `warn` or `error` for rules in suspicious group

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-31T15:35:41.261Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:41.261Z
Learning: In crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs, the `issue_number` field in `declare_lint_rule!` macro is optional and the vast majority of nursery rules do not need it. Do not recommend adding `issue_number` unless there's a specific reason.

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each invalid code example in rule documentation must emit exactly one diagnostic

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `info` or `warn` for rules in style group

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use generic rule names if the rule could potentially be implemented for multiple languages

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file

Applied to files:

  • crates/biome_configuration_macros/src/lib.rs
  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output

Applied to files:

  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation

Applied to files:

  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge

Applied to files:

  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Implement `action` function in Rule trait to provide code actions

Applied to files:

  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/visitors.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use language-specific rule names if the rule is meant for a specific language only

Applied to files:

  • xtask/codegen/src/generate_configuration.rs
  • crates/biome_configuration_macros/src/visitors.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rules with `recommended: true` and domains are only enabled when the domain is enabled

Applied to files:

  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rules with `recommended: true` and no domains are enabled by default

Applied to files:

  • xtask/codegen/src/generate_configuration.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/visitors.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `info` for code action rules in analyzer

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options must be placed inside the `biome_rule_options` crate

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options struct must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema`

Applied to files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Implement custom Visitor by implementing the Visitor trait for complex rule logic

Applied to files:

  • crates/biome_configuration_macros/src/visitors.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `warn` or `info` for rules in complexity group

Applied to files:

  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `warn` for rules in performance group

Applied to files:

  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each rule option must have its own h3 header with description, default value, options block, and code example

Applied to files:

  • crates/biome_configuration_macros/src/group_struct.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
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_macros/src/group_struct.rs
🧬 Code graph analysis (5)
crates/biome_configuration_macros/src/lib.rs (3)
crates/biome_configuration_macros/src/group_struct.rs (1)
  • generate_group_struct (11-344)
crates/biome_configuration/src/analyzer/assist/actions.rs (1)
  • group (82-89)
crates/biome_html_analyze/src/registry.rs (1)
  • visit_registry (5-7)
xtask/codegen/src/generate_configuration.rs (2)
xtask/codegen/src/lib.rs (1)
  • update (58-78)
crates/biome_configuration_macros/src/lib.rs (2)
  • lint_group_structs (12-40)
  • assist_group_structs (54-73)
crates/biome_configuration/src/analyzer/assist/actions.rs (1)
crates/biome_configuration_macros/src/lib.rs (1)
  • assist_group_structs (54-73)
crates/biome_configuration_macros/src/visitors.rs (1)
xtask/codegen/src/generate_configuration.rs (20)
  • record_category (28-32)
  • record_category (53-57)
  • record_category (72-76)
  • record_category (91-95)
  • record_category (110-114)
  • record_category (135-139)
  • record_category (153-157)
  • record_category (172-176)
  • record_category (191-195)
  • record_category (210-214)
  • record_rule (34-49)
  • record_rule (59-68)
  • record_rule (78-87)
  • record_rule (97-106)
  • record_rule (116-125)
  • record_rule (141-149)
  • record_rule (159-168)
  • record_rule (178-187)
  • record_rule (197-206)
  • record_rule (216-225)
crates/biome_configuration_macros/src/group_struct.rs (2)
crates/biome_configuration_macros/src/lib.rs (1)
  • to_capitalized (86-92)
crates/biome_configuration/src/analyzer/mod.rs (3)
  • RuleFilter (722-722)
  • recommended_rules_as_filters (936-936)
  • is_recommended_true (927-927)
⏰ 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). (26)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Parser conformance
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Documentation
  • GitHub Check: End-to-end tests
  • GitHub Check: Bench (biome_tailwind_parser)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: triage
🔇 Additional comments (8)
xtask/codegen/src/generate_configuration.rs (1)

387-395: Clean macro-based generation flow.

Good work delegating group struct generation to the proc macros. The branching on RuleCategory::Lint vs RuleCategory::Action is clear and aligns with the macro implementations in biome_configuration_macros.

crates/biome_configuration_macros/src/lib.rs (2)

11-40: Well-structured macro with explicit group enumeration.

The explicit list of group names is intentional for the merge conflict mitigation goal. This ensures that adding a new rule to an existing group won't cause conflicts—only adding an entirely new group would require updating this list.


86-91: Simple capitalisation helper.

This works for ASCII rule names. If rule names ever contain non-ASCII characters, the behaviour might be unexpected (e.g., ßSS), but this is unlikely for this codebase.

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

176-176: Clean macro delegation.

The Source struct and its associated impl are now generated by the macro. This achieves the PR's goal of reducing merge conflicts when adding new assist rules.

crates/biome_configuration_macros/src/group_struct.rs (1)

172-244: Comprehensive group struct generation.

The branching between RuleCategory::Action and Lint is well-handled. The Action variant uses inherent methods whilst Lint implements RuleGroupExt, which aligns with the existing codebase patterns. The From<GroupPlainConfiguration> impl for Lint groups is a nice touch for configuration ergonomics.

Also applies to: 245-343

crates/biome_configuration_macros/src/visitors.rs (3)

21-43: JsLanguage visitor correctly tracks domains.

The LintRulesVisitor for JsLanguage is the only implementation that populates the domains field. This is consistent with the original codegen—only JS rules have domain metadata tracked. Good consistency.


122-220: AssistActionsVisitor implementations are straightforward.

Clean multi-language visitor implementations. No domain tracking needed for assist rules.


12-120: Visitor implementations are duplicated across the proc-macro and xtask codegen.

The LintRulesVisitor implementations here mirror those in xtask/codegen/src/generate_configuration.rs exactly. This duplication is unavoidable due to architectural constraints: xtask is a build tool that cannot be depended upon by the proc-macro crate, so extracting to a shared library isn't feasible. This is an acceptable trade-off.

@dyc3 dyc3 merged commit f517a24 into main Jan 2, 2026
30 checks passed
@dyc3 dyc3 deleted the dyc3/merge-conflict-mitigation branch January 2, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Project Area: project A-Tooling Area: internal tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants