+
Skip to content

Conversation

siketyan
Copy link
Member

Summary

The following rules are now a part of the react domain. It will prevent the rules to be applied where it's not a React world.

  • lint/correctness/noChildrenProp
  • lint/correctness/noReactPropAssignments
  • lint/security/noDangerouslySetInnerHtml
  • lint/security/noDangerouslySetInnerHtmlWithChildren
  • lint/style/useComponentExportOnlyModules
  • lint/suspicious/noArrayIndexKey

Migration is unlikely needed as Biome will enable the react domain automatically when it detects React in the dependencies.

Test Plan

N/A

Docs

N/A

@siketyan siketyan requested review from a team September 21, 2025 05:57
@siketyan siketyan self-assigned this Sep 21, 2025
Copy link

changeset-bot bot commented Sep 21, 2025

🦋 Changeset detected

Latest commit: 6669b34

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-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Sep 21, 2025
Copy link
Contributor

coderabbitai bot commented Sep 21, 2025

Walkthrough

Scopes several existing lint rules to the React domain by importing RuleDomain and adding domains: &[RuleDomain::React] in their declare_lint_rule! metadata (noChildrenProp, noReactPropAssignments, noDangerouslySetInnerHtml, noDangerouslySetInnerHtmlWithChildren, useComponentExportOnlyModules, noArrayIndexKey). Adds two changeset entries for a minor @biomejs/biome release. Updates service logic to require a rule be both recommended and recommended_enabled before processing domain rules. No public API signatures were changed.

Possibly related PRs

Suggested labels

A-Diagnostic

Suggested reviewers

  • arendjr

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title concisely and accurately summarises the primary change (moving several lint rules into the react domain), is specific and free of noise, and communicates the developer's intent clearly for a reviewer scanning history.
Description Check ✅ Passed The description directly matches the changeset by listing the rules moved to the react domain and noting automatic domain enablement, so it is on-topic and sufficient for this lenient check; marking Test Plan and Docs as N/A aligns with the diff.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 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 89008a9 and 6669b34.

📒 Files selected for processing (1)
  • .changeset/seven-beans-cough.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/seven-beans-cough.md
⏰ 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). (22)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_html_formatter)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_html_parser)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: autofix

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: 0

🧹 Nitpick comments (8)
crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs (1)

4-4: React domain scoping looks right; bump rule version metadata.

Per the contributor guide, mark updated rules with version: "next" when changing rule metadata (domains). Everything else LGTM.

Apply:

-        version: "1.0.0",
+        version: "next",

Please confirm this rule’s docs mention it now lives under the React domain.

Also applies to: 35-35

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

5-7: Scoped to React domain — good; update version to next.

Metadata-only change warrants version: "next". No logic changes spotted.

Use:

-        version: "2.0.0",
+        version: "next",

Double‑check docs/release notes reflect the new domain gating.

Also applies to: 47-47

crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs (1)

4-4: Domain assignment is appropriate; please flip version to next.

Keeps noise out of non‑React projects. Version metadata should signal the update.

Patch:

-        version: "1.0.0",
+        version: "next",

Confirm the rule doc calls out React domain scoping.

Also applies to: 44-44

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

4-4: Good move to React domain; align version metadata.

Switch the rule header to version: "next" for this metadata change.

Change:

-        version: "1.0.0",
+        version: "next",

Please ensure the docs snippet for this rule is still valid under domain scoping.

Also applies to: 33-33

crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs (2)

4-4: React‑only domain makes sense; nudge version to next.

No behavioural changes detected—just metadata—so mark as next.

Apply:

-        version: "1.0.0",
+        version: "next",

Confirm any rule docs or examples haven’t drifted with the new domain gating.

Also applies to: 73-73


21-26: Tiny docs polish: link and wording.

Consider updating the React docs link to the current site and tweak “performances” → “performance” in the diagnostic notes for clarity.

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

3-3: Nicely scoped to React; please set version to next.

Tracks the metadata change properly; rest looks tidy.

Diff:

-        version: "1.9.2",
+        version: "next",

Shall we add a brief note in the rule docs that it’s only active when the React domain is enabled/detected?

Also applies to: 104-104

.changeset/seven-beans-cough.md (1)

5-12: Tighten the changeset: tense, auto‑detection note, links, and a minimal example.

  • Use past tense for what you did and present tense for current behaviour.
  • Fix “unless you enabled” → “unless you enable”.
  • Add a one‑liner about React domain auto‑detection to avoid confusion with the PR description.
  • Include rule doc links and a minimal example snippet.

Proposed rewrite:

 The following rules are now a part of the `react` domain, and they won't be enabled automatically unless you enabled the domain:
+Moved the following rules into the `react` domain.
+
+Biome automatically enables the `react` domain when React is detected in your dependencies. Otherwise, enable the domain to use these rules.
+
 - `lint/correctness/noChildrenProp` (recommended)
 - `lint/correctness/noReactPropAssignments`
 - `lint/security/noDangerouslySetInnerHtml` (recommended)
 - `lint/security/noDangerouslySetInnerHtmlWithChildren` (recommended)
 - `lint/style/useComponentExportOnlyModules`
 - `lint/suspicious/noArrayIndexKey` (recommended)
+
+#### Example
+
+```jsx
+// Triggers lint/suspicious/noArrayIndexKey.
+items.map((item, index) => <li key={index}>{item}</li>);
+```
+
+#### Rule docs
+
+- lint/correctness/noChildrenProp — https://biomejs.dev/linter/rules/no-children-prop.
+- lint/correctness/noReactPropAssignments — https://biomejs.dev/linter/rules/no-react-prop-assignments.
+- lint/security/noDangerouslySetInnerHtml — https://biomejs.dev/linter/rules/no-dangerously-set-inner-html.
+- lint/security/noDangerouslySetInnerHtmlWithChildren — https://biomejs.dev/linter/rules/no-dangerously-set-inner-html-with-children.
+- lint/style/useComponentExportOnlyModules — https://biomejs.dev/linter/rules/use-component-export-only-modules.
+- lint/suspicious/noArrayIndexKey — https://biomejs.dev/linter/rules/no-array-index-key.

Kindly verify the doc URLs and the exact phrasing Biome uses for enabling domains.

📜 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 ea23d15 and b82f4ad.

📒 Files selected for processing (7)
  • .changeset/seven-beans-cough.md (1 hunks)
  • crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs (2 hunks)
  • crates/biome_js_analyze/src/lint/correctness/no_react_prop_assignments.rs (2 hunks)
  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs (2 hunks)
  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs (2 hunks)
  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs (2 hunks)
  • crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs
  • crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs
  • crates/biome_js_analyze/src/lint/correctness/no_react_prop_assignments.rs
  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs
  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
  • crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs
  • crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs
  • crates/biome_js_analyze/src/lint/correctness/no_react_prop_assignments.rs
  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs
  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
  • crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Format all Rust source files before committing (just f)

Files:

  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs
  • crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs
  • crates/biome_js_analyze/src/lint/correctness/no_react_prop_assignments.rs
  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs
  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
  • crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/*.md: In changeset files, only use #### or ##### headers; avoid other header levels
Changeset descriptions should use past tense for what you did (e.g., "Added...")
Describe current Biome behavior in present tense within changesets (e.g., "Biome now supports...")
For bug fixes in changesets, start with a link to the issue (e.g., "Fixed #1234: ...")
When referencing rules or assists in changesets, include links to their documentation pages
Include a minimal code block in the changeset when applicable to demonstrate the change
End every sentence in the changeset description with a period

Files:

  • .changeset/seven-beans-cough.md
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : In declare_lint_rule! macros, set `version: "next"` for new or updated rules
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Recommended rules with domains are enabled only when users enable the matching domains; use `domains` metadata judiciously
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Recommended rules with domains are enabled only when users enable the matching domains; use `domains` metadata judiciously

Applied to files:

  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs
  • crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs
  • crates/biome_js_analyze/src/lint/correctness/no_react_prop_assignments.rs
  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs
  • .changeset/seven-beans-cough.md
  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
  • crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : When deprecating a rule, add `deprecated: "<reason>"` to `declare_lint_rule!`

Applied to files:

  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs
  • crates/biome_js_analyze/src/lint/correctness/no_react_prop_assignments.rs
  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs
  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : In declare_lint_rule! macros, set `version: "next"` for new or updated rules

Applied to files:

  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs
  • crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs
  • crates/biome_js_analyze/src/lint/correctness/no_react_prop_assignments.rs
  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs
  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
  • crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Set the `language` field in `declare_lint_rule!` to the primary language (`js`, `jsx`, `ts`, or `tsx`) the rule targets

Applied to files:

  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs
  • crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs
  • crates/biome_js_analyze/src/lint/correctness/no_react_prop_assignments.rs
  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs
  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
  • crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : If a rule returns a code action (implements `action`), add `fix_kind` in `declare_lint_rule!` and use `ctx.metadata().applicability()` when building the action

Applied to files:

  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs
  • crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs
  • crates/biome_js_analyze/src/lint/correctness/no_react_prop_assignments.rs
  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs
  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
  • crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Code blocks in rule docs must specify language; invalid snippets require `expect_diagnostic`; use `options`/`full_options`/`use_options` markers as appropriate

Applied to files:

  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs
  • crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs
  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs
  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
  • crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/lib/src/{lint,assist}/**/*.rs : When banning globals (e.g., `noConsoleLog`), check the semantic model to avoid false positives from locally shadowed bindings

Applied to files:

  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs
  • crates/biome_js_analyze/src/lint/correctness/no_react_prop_assignments.rs
  • crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs
  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
  • crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs
📚 Learning: 2025-09-07T17:35:00.517Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-09-07T17:35:00.517Z
Learning: Applies to .changeset/*.md : Describe current Biome behavior in present tense within changesets (e.g., "Biome now supports...")

Applied to files:

  • .changeset/seven-beans-cough.md
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Define per-rule options types in `biome_rule_options` crate (one file per rule, e.g., `lib/use_my_rule.rs`)

Applied to files:

  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable

Applied to files:

  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Specify category and severity using #[diagnostic(...)] on the type or derive them from fields

Applied to files:

  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Types implementing Diagnostic must also implement Debug (e.g., use #[derive(Debug, Diagnostic)])

Applied to files:

  • crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs
🧬 Code graph analysis (6)
crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html_with_children.rs (1)
crates/biome_analyze/src/rule.rs (1)
  • domains (617-620)
crates/biome_js_analyze/src/lint/correctness/no_children_prop.rs (1)
crates/biome_analyze/src/rule.rs (1)
  • domains (617-620)
crates/biome_js_analyze/src/lint/correctness/no_react_prop_assignments.rs (1)
crates/biome_analyze/src/rule.rs (1)
  • domains (617-620)
crates/biome_js_analyze/src/lint/security/no_dangerously_set_inner_html.rs (1)
crates/biome_analyze/src/rule.rs (1)
  • domains (617-620)
crates/biome_js_analyze/src/lint/style/use_component_export_only_modules.rs (1)
crates/biome_analyze/src/rule.rs (1)
  • domains (617-620)
crates/biome_js_analyze/src/lint/suspicious/no_array_index_key.rs (1)
crates/biome_analyze/src/rule.rs (1)
  • domains (617-620)
⏰ 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). (23)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Documentation
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_html_formatter)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_html_parser)
  • GitHub Check: Check Dependencies
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: autofix

@github-actions github-actions bot added the A-Project Area: project label Sep 21, 2025
Copy link

codspeed-hq bot commented Sep 21, 2025

CodSpeed Performance Report

Merging #7548 will not alter performance

Comparing siketyan:feat/rules-react-domain (6669b34) with next (ea23d15)

Summary

✅ 133 untouched

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/biome_service/src/file_handlers/mod.rs (1)

1096-1107: Unreachable branch — recommended domain rules never disabled

Early-return when no domains are configured (crates/biome_service/src/file_handlers/mod.rs:1096–1097) makes the subsequent "disable recommended rules" block (1100–1107) unreachable. Compute no_domains first and run the recommended-disable check before returning. Example change:

-        // no domains, no need to record the rule
-        if domains.as_ref().is_none_or(|d| d.is_empty()) {
-            return;
-        }
-
-        // If the rule is recommended, and it has some domains, it should be disabled, but only if the configuration doesn't enable some domains.
-        if R::METADATA.recommended
-            && !R::METADATA.domains.is_empty()
-            && domains.as_ref().is_none_or(|d| d.is_empty())
-        {
-            self.disabled_rules.insert(rule_filter);
-            return;
-        }
+        let no_domains = domains.as_ref().is_none_or(|d| d.is_empty());
+        if R::METADATA.recommended && !R::METADATA.domains.is_empty() && no_domains {
+            self.disabled_rules.insert(rule_filter);
+            return;
+        }
+        if no_domains {
+            return;
+        }
🧹 Nitpick comments (1)
.changeset/crazy-steaks-mix.md (1)

1-6: Polish the changeset copy and drop the stray character.

  • The body would benefit from a past‑tense summary of what you changed and a present‑tense note of current behaviour per repo guidelines.
  • There’s a stray 6 on Line 6 that will leak into release notes.

Apply:

 ---
 "@biomejs/biome": minor
 ---
 
-The rules in a domain are no longer enabled automatically by the installed dependencies unless the rule is recommended.
-6
+#### React domain scoping and recommended gating.
+
+Moved several React‑specific lint rules into the `react` domain so they only run in React contexts.
+
+Biome now enables rules in a domain only when that domain is configured or detected and the rule is recommended.
+
+Example:
+```jsonc
+// biome.json
+{
+  "linter": {
+    "rules": { "recommended": true },
+    "domains": { "react": "recommended" }
+  }
+}
+```

Also consider adding links for each referenced rule’s documentation.

Please confirm the config keys above match the current schema; if not, I’ll adjust the snippet.

📜 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 b82f4ad and 89008a9.

⛔ Files ignored due to path filters (2)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_configuration/src/generated/domain_selector.rs is excluded by !**/generated/**, !**/generated/** and included by **
📒 Files selected for processing (2)
  • .changeset/crazy-steaks-mix.md (1 hunks)
  • crates/biome_service/src/file_handlers/mod.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/*.md: In changeset files, only use #### or ##### headers; avoid other header levels
Changeset descriptions should use past tense for what you did (e.g., "Added...")
Describe current Biome behavior in present tense within changesets (e.g., "Biome now supports...")
For bug fixes in changesets, start with a link to the issue (e.g., "Fixed #1234: ...")
When referencing rules or assists in changesets, include links to their documentation pages
Include a minimal code block in the changeset when applicable to demonstrate the change
End every sentence in the changeset description with a period

Files:

  • .changeset/crazy-steaks-mix.md
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_service/src/file_handlers/mod.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Format all Rust source files before committing (just f)

Files:

  • crates/biome_service/src/file_handlers/mod.rs
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Recommended rules with domains are enabled only when users enable the matching domains; use `domains` metadata judiciously
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : In declare_lint_rule! macros, set `version: "next"` for new or updated rules
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-09-07T17:35:00.517Z
Learning: Applies to .changeset/*.md : Describe current Biome behavior in present tense within changesets (e.g., "Biome now supports...")
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Set the `language` field in `declare_lint_rule!` to the primary language (`js`, `jsx`, `ts`, or `tsx`) the rule targets
📚 Learning: 2025-09-07T17:35:00.517Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-09-07T17:35:00.517Z
Learning: Applies to .changeset/*.md : Describe current Biome behavior in present tense within changesets (e.g., "Biome now supports...")

Applied to files:

  • .changeset/crazy-steaks-mix.md
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Recommended rules with domains are enabled only when users enable the matching domains; use `domains` metadata judiciously

Applied to files:

  • .changeset/crazy-steaks-mix.md
  • crates/biome_service/src/file_handlers/mod.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : In declare_lint_rule! macros, set `version: "next"` for new or updated rules

Applied to files:

  • crates/biome_service/src/file_handlers/mod.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Define per-rule options types in `biome_rule_options` crate (one file per rule, e.g., `lib/use_my_rule.rs`)

Applied to files:

  • crates/biome_service/src/file_handlers/mod.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : If a rule returns a code action (implements `action`), add `fix_kind` in `declare_lint_rule!` and use `ctx.metadata().applicability()` when building the action

Applied to files:

  • crates/biome_service/src/file_handlers/mod.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable

Applied to files:

  • crates/biome_service/src/file_handlers/mod.rs
🧬 Code graph analysis (1)
crates/biome_service/src/file_handlers/mod.rs (1)
crates/biome_service/src/settings.rs (1)
  • recommended_enabled (401-407)
⏰ 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). (24)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_html_parser)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_html_formatter)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Documentation
  • GitHub Check: End-to-end tests
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: autofix
🔇 Additional comments (1)
crates/biome_service/src/file_handlers/mod.rs (1)

1039-1043: Incorrect — keep linter_recommended_enabled()

Settings defines pub fn linter_recommended_enabled(&self) -> bool (it calls self.linter.recommended_enabled()), so the suggested rename to recommended_enabled() is incorrect; leave the call as-is.

Likely an incorrect or invalid review comment.

@siketyan siketyan merged commit 85d3a3a into biomejs:next Sep 21, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter A-Project Area: project L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载