-
-
Notifications
You must be signed in to change notification settings - Fork 714
feat(analyze/js): add noNextAsyncClientComponent
rule in Next domain
#7081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(analyze/js): add noNextAsyncClientComponent
rule in Next domain
#7081
Conversation
🦋 Changeset detectedLatest commit: f998138 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
CodSpeed Performance ReportMerging #7081 will not alter performanceComparing Summary
|
crates/biome_js_analyze/src/lint/nursery/no_async_client_component.rs
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_async_client_component.rs
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_async_client_component.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a couple nitpicks on the precise wording.
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
Outdated
Show resolved
Hide resolved
41f9171
to
b57aa48
Compare
You can fix the merge conflicts for these files by running |
b57aa48
to
e856b26
Compare
WalkthroughA new linting rule, Suggested labels
Suggested reviewers
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. 📜 Recent review detailsConfiguration used: .coderabbit.yaml ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
a2f91f6
to
ca938ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs (1)
131-131
: Fix grammar in diagnostic message.The message has a grammatical error - it should be "components" (plural) to match the verb "are".
- "Async client component are not allowed." + "Async client components are not allowed."
🧹 Nitpick comments (3)
crates/biome_js_analyze/src/lint/nursery.rs (1)
18-18
: Module insertion is alphabetically correct but regenerate sources
no_next_async_client_component
is inserted in the right alphabetical spot, yet this file is code-generated (//! Generated file
). After manual merges, runjust gen-all
(or the appropriate code-gen target) so the generated sources and hash stay in sync.crates/biome_rule_options/src/no_next_async_client_component.rs (2)
3-6
: Add a doc-comment for clarityAll option structs in
biome_rule_options
usually carry a short Rustdoc explaining what rule they configure.
Adding one here will keep generated docs and IDE hovers consistent with the rest of the codebase.+/// Configuration for the `noNextAsyncClientComponent` lint rule +/// +/// This rule forbids declaring **async** client components in Next.js +/// applications. #[derive(Default, Clone, Debug, Deserialize, Deserializable, Eq, PartialEq, Serialize)]
5-5
:#[serde(default)]
is redundant on an empty structSince the struct has no fields, deserialisation can never fail due to missing fields, so the
default
attribute is a no-op.
Removing it avoids the impression that there are hidden defaults.-#[serde(rename_all = "camelCase", deny_unknown_fields, default)] +#[serde(rename_all = "camelCase", deny_unknown_fields)]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (6)
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalid.jsx.snap
is excluded by!**/*.snap
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalidExportDef.jsx.snap
is excluded by!**/*.snap
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/valid.jsx.snap
is excluded by!**/*.snap
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNoAsync.jsx.snap
is excluded by!**/*.snap
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNotComponent.js.snap
is excluded by!**/*.snap
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNotComponent.jsx.snap
is excluded by!**/*.snap
📒 Files selected for processing (15)
.changeset/shaggy-keys-camp.md
(1 hunks)crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
(1 hunks)crates/biome_configuration/src/analyzer/linter/rules.rs
(12 hunks)crates/biome_diagnostics_categories/src/categories.rs
(1 hunks)crates/biome_js_analyze/src/lint/nursery.rs
(2 hunks)crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalid.jsx
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalidExportDef.jsx
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/valid.jsx
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNoAsync.jsx
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNotComponent.jsx
(1 hunks)crates/biome_rule_options/src/lib.rs
(1 hunks)crates/biome_rule_options/src/no_next_async_client_component.rs
(1 hunks)packages/@biomejs/backend-jsonrpc/src/workspace.ts
(5 hunks)packages/@biomejs/biome/configuration_schema.json
(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
crates/biome_*/**/*
📄 CodeRabbit Inference Engine (CLAUDE.md)
Core crates must be located in
/crates/biome_*/
Files:
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalidExportDef.jsx
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
crates/biome_configuration/src/analyzer/linter/rules.rs
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNoAsync.jsx
crates/biome_rule_options/src/lib.rs
crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/valid.jsx
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNotComponent.jsx
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalid.jsx
crates/biome_diagnostics_categories/src/categories.rs
crates/biome_rule_options/src/no_next_async_client_component.rs
crates/biome_js_analyze/src/lint/nursery.rs
**/*.{rs,toml}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Format code (Rust + TOML) using
just format
Files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
crates/biome_configuration/src/analyzer/linter/rules.rs
crates/biome_rule_options/src/lib.rs
crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
crates/biome_diagnostics_categories/src/categories.rs
crates/biome_rule_options/src/no_next_async_client_component.rs
crates/biome_js_analyze/src/lint/nursery.rs
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.386Z
Learning: Create new lint rules using `just new-js-lintrule`, `just new-css-lintrule`, `just new-json-lintrule`, or `just new-graphql-lintrule`, and the rule name must be camelCase
📚 Learning: create new lint rules using `just new-js-lintrule`, `just new-css-lintrule`, `just new-json-lintrule...
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.386Z
Learning: Create new lint rules using `just new-js-lintrule`, `just new-css-lintrule`, `just new-json-lintrule`, or `just new-graphql-lintrule`, and the rule name must be camelCase
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
packages/@biomejs/backend-jsonrpc/src/workspace.ts
packages/@biomejs/biome/configuration_schema.json
crates/biome_diagnostics_categories/src/categories.rs
.changeset/shaggy-keys-camp.md
crates/biome_js_analyze/src/lint/nursery.rs
📚 Learning: move rules from nursery to stable group using `just move-rule stable rulename`...
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.386Z
Learning: Move rules from nursery to stable group using `just move-rule stable ruleName`
Applied to files:
crates/biome_configuration/src/analyzer/linter/rules.rs
crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
📚 Learning: applies to biome_configuration/src/**/*.rs : configuration files must be placed in `biome_configurat...
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.386Z
Learning: Applies to biome_configuration/src/**/*.rs : Configuration files must be placed in `biome_configuration/src/`
Applied to files:
crates/biome_configuration/src/analyzer/linter/rules.rs
⏰ 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). (11)
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-windows-2022-4)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test Node.js API
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_js_formatter)
🔇 Additional comments (32)
crates/biome_rule_options/src/lib.rs (1)
128-128
: LGTM! Module export follows established conventions.The new module export is correctly placed in alphabetical order and follows the snake_case naming convention consistent with other rule option modules.
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/valid.jsx (1)
1-5
: LGTM! Valid test case correctly demonstrates when rule should not trigger.This test properly validates that async components without the
"use client"
directive should not generate diagnostics, which aligns with the rule's intended behavior to only flag async client components.crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalid.jsx (1)
1-5
: LGTM! Invalid test case correctly demonstrates the rule violation.This test properly validates that async client components (marked with
"use client"
) should trigger the lint rule, which aligns with Next.js best practices that discourage async client components due to hydration issues.crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalidExportDef.jsx (1)
1-6
: LGTM! Additional test case provides good coverage for export syntax variants.This test correctly validates that the rule catches async client components regardless of whether the function is declared inline with export default or separately. Good coverage for different syntax patterns.
crates/biome_diagnostics_categories/src/categories.rs (1)
149-149
: LGTM! Diagnostic category properly registered.The new diagnostic category is correctly placed in alphabetical order within the nursery lint rules and follows the established URL pattern for Biome documentation.
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNoAsync.jsx (1)
1-6
: Test case looks correct and self-descriptiveThe positive test accurately captures a synchronous client component scenario and should not trigger the rule. No further action required.
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNotComponent.jsx (1)
1-6
: Good negative-case coverageThis file ensures the rule does not mis-fire on async functions that are not React components. Looks good.
crates/biome_js_analyze/src/lint/nursery.rs (1)
62-62
: Rule wired intoNursery
group properlyThe rule is registered in the lint group with correct camelCase naming. No issues spotted.
.changeset/shaggy-keys-camp.md (1)
5-21
: Clear, reader-friendly changeset entryThe wording is concise, the link resolves to the expected docs path, and the code examples illustrate both invalid and valid patterns. ✅
crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs (1)
64-75
: LGTM! Generated code follows established patterns correctly.The new match arm for "@next/no-async-client-component" correctly implements the standard nursery rule migration pattern. The rule name conversion from kebab-case to snake_case is appropriate, and the logic is consistent with other nursery rules in the file.
Since this is generated code (as noted in line 1), any issues should be addressed in the code generation tooling rather than manual edits.
packages/@biomejs/backend-jsonrpc/src/workspace.ts (5)
1606-1609
: LGTM! Follows established patterns correctly.The JSDoc documentation is clear and the property declaration follows the same pattern as other lint rules in the interface. The camelCase naming convention aligns with the project's standards.
2926-2928
: LGTM! Type alias follows established pattern.The type definition is consistent with other rule configuration type aliases in the file, providing the standard union of plain and options-based configurations.
5226-5235
: LGTM! Interface definition follows established structure.The
RuleWithOptions_for_NoNextAsyncClientComponentOptions
interface maintains consistency with other rule option interfaces, including proper JSDoc documentation and standard property definitions.
7864-7864
: LGTM! Empty options interface follows standard pattern.The empty
NoNextAsyncClientComponentOptions
interface is consistent with other lint rules that don't require configuration options and is properly positioned alphabetically.
8547-8547
: LGTM! Rule properly categorized in nursery.The addition to the
Category
union type correctly places the new rule in the nursery category with proper naming convention that matches other nursery rules.packages/@biomejs/biome/configuration_schema.json (2)
3625-3634
: Definition entries look consistent and follow existing conventions
NoNextAsyncClientComponentConfiguration
and its companionOptions
entry are added in the same pattern as neighbouring rule definitions (NoNodejsModulesConfiguration
, etc.). Naming (PascalCase for definitions, camelCase for rule name) and theadditionalProperties: false
guard are both correct.
4865-4870
: Rule correctly surfaced in thenursery
groupThe
noNextAsyncClientComponent
property is wired into thenursery
rules section with a clear description and the expectedanyOf
pointing at the new configuration definition. No issues spotted.crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs (3)
1-12
: Imports are well-organized and appropriate.The import structure follows the expected pattern for a Biome lint rule implementation, with all necessary dependencies properly imported.
13-60
: Rule declaration is well-documented and properly configured.The rule metadata, documentation, and examples effectively communicate the rule's purpose and usage. The configuration appropriately targets Next.js applications with warning severity.
145-153
: Helper function is well-implemented.The
has_use_client_directive
function efficiently checks for the presence of "use client" directives with proper error handling and early termination.crates/biome_configuration/src/analyzer/linter/rules.rs (12)
215-215
: LGTM - Enum variant correctly added.The
NoNextAsyncClientComponent
variant is properly added to theRuleName
enum in alphabetical order and follows the camelCase naming convention.
565-565
: LGTM - String representation correctly mapped.The string representation mapping for
NoNextAsyncClientComponent
is correct and follows the camelCase convention.
915-915
: LGTM - Rule correctly assigned to Nursery group.The
NoNextAsyncClientComponent
rule is properly assigned to theRuleGroup::Nursery
, which is the correct group for new lint rules.
1270-1270
: LGTM - FromStr implementation correctly added.The
FromStr
implementation for "noNextAsyncClientComponent" is properly added and matches the string representation.
4301-4301
: LGTM - Nursery struct field correctly added.The
no_next_async_client_component
field is properly added to theNursery
struct with the correct type, documentation, and serde attributes. The snake_case naming follows Rust conventions.
4318-4318
: LGTM - GROUP_RULES array correctly updated.The
"noNextAsyncClientComponent"
string is properly added to theGROUP_RULES
array in alphabetical order.
4369-4378
: LGTM - RECOMMENDED_RULES_AS_FILTERS indices correctly adjusted.The indices in the
RECOMMENDED_RULES_AS_FILTERS
array have been properly incremented to account for the insertion of the new rule at index 13 in theGROUP_RULES
array. The adjustments maintain the correct mapping to the intended rules.
4441-4441
: LGTM - ALL_RULES_AS_FILTERS correctly updated.The addition of
GROUP_RULES[60]
to theALL_RULES_AS_FILTERS
array correctly includes the new total count of rules after the insertion.
4518-4757
: LGTM - get_enabled_rules method correctly updated.The
get_enabled_rules
method has been systematically updated to:
- Add the check for
no_next_async_client_component
at the correct index (13)- Increment all subsequent rule indices by 1 to maintain proper mapping
The changes are consistent and maintain the correct correspondence between struct fields and
GROUP_RULES
array indices.
4827-5066
: LGTM - get_disabled_rules method correctly updated.The
get_disabled_rules
method has been systematically updated with the same pattern asget_enabled_rules
, maintaining consistency in rule index handling between enabled and disabled states.
5149-5152
: LGTM - get_rule_configuration method correctly updated.The
get_rule_configuration
method properly handles the new "noNextAsyncClientComponent" rule by mapping it to the corresponding struct field and returning the configuration.
5362-5362
: LGTM - From trait implementation correctly updated.The
From<GroupPlainConfiguration>
implementation properly initializes theno_next_async_client_component
field, maintaining consistency with other rules in the Nursery group.
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
Show resolved
Hide resolved
@Jayllyz sorry for the extra noise from the bot |
ca938ed
to
5714696
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs (2)
131-132
: Grammar nit in fallback messageUse plural “components” and fix the article.
- "Async client component are not allowed." + "Async client components are not allowed."
89-98
: Extend async detection to all component declaration patterns (missing cases)Currently only JsFunctionDeclaration and JsFunctionExportDefaultDeclaration are checked. This misses async arrow functions, variable declarators, assignments, export default expressions, and object/class method forms that ReactComponentInfo can surface.
Apply this diff to cover all variants of AnyPotentialReactComponentDeclaration:
- // Check if the component function is async - let is_async = match declaration { - AnyPotentialReactComponentDeclaration::JsFunctionDeclaration(func) => { - func.async_token().is_some() - } - AnyPotentialReactComponentDeclaration::JsFunctionExportDefaultDeclaration(func) => { - func.async_token().is_some() - } - _ => false, - }; + // Check if the component function is async across all declaration patterns + let is_async = match declaration { + AnyPotentialReactComponentDeclaration::JsFunctionDeclaration(func) => { + func.async_token().is_some() + } + AnyPotentialReactComponentDeclaration::JsFunctionExportDefaultDeclaration(func) => { + func.async_token().is_some() + } + AnyPotentialReactComponentDeclaration::JsVariableDeclarator(declarator) => { + declarator + .initializer() + .ok() + .and_then(|init| init.expression().ok()) + .map_or(false, |expr| match expr { + biome_js_syntax::AnyJsExpression::JsFunctionExpression(func) => { + func.async_token().is_some() + } + biome_js_syntax::AnyJsExpression::JsArrowFunctionExpression(arrow) => { + arrow.async_token().is_some() + } + _ => false, + }) + } + AnyPotentialReactComponentDeclaration::JsAssignmentExpression(assign) => { + assign.right().ok().map_or(false, |expr| match expr { + biome_js_syntax::AnyJsExpression::JsFunctionExpression(func) => { + func.async_token().is_some() + } + biome_js_syntax::AnyJsExpression::JsArrowFunctionExpression(arrow) => { + arrow.async_token().is_some() + } + _ => false, + }) + } + AnyPotentialReactComponentDeclaration::JsExportDefaultExpressionClause(export) => { + export.expression().ok().map_or(false, |expr| match expr { + biome_js_syntax::AnyJsExpression::JsFunctionExpression(func) => { + func.async_token().is_some() + } + biome_js_syntax::AnyJsExpression::JsArrowFunctionExpression(arrow) => { + arrow.async_token().is_some() + } + _ => false, + }) + } + AnyPotentialReactComponentDeclaration::JsMethodObjectMember(method) => { + method.async_token().is_some() + } + AnyPotentialReactComponentDeclaration::JsPropertyObjectMember(prop) => { + match prop.value() { + Ok(biome_js_syntax::AnyJsObjectMemberValue::AnyJsExpression(expr)) => match expr { + biome_js_syntax::AnyJsExpression::JsFunctionExpression(func) => { + func.async_token().is_some() + } + biome_js_syntax::AnyJsExpression::JsArrowFunctionExpression(arrow) => { + arrow.async_token().is_some() + } + _ => false, + }, + _ => false, + } + } + AnyPotentialReactComponentDeclaration::JsMethodClassMember(method) => { + method.async_token().is_some() + } + _ => false, + };If you decide object/class methods aren’t considered “components” for this rule, keep the other arms and drop those two; ReactComponentInfo already gates most false positives.
Happy to push a commit with this change if you prefer.
🧹 Nitpick comments (2)
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs (2)
118-124
: Point diagnostic at the async keyword for better UXInstead of highlighting the entire declaration, consider using the async token’s range when available; users will love the laser pointer.
Example approach (sketch, not a drop-in):
let (range, message) = match declaration { AnyPotentialReactComponentDeclaration::JsFunctionDeclaration(func) => { (func.async_token().map(|t| t.text_range()).unwrap_or(declaration.range()), msg) } // ...mirror for other variants... _ => (declaration.range(), msg), }; RuleDiagnostic::new(rule_category!(), range, markup! { /* message */ })
21-49
: Docs: add an invalid arrow/variable exampleShow that async arrow components in client modules are disallowed too.
Suggested snippet to add under “Invalid”:
"use client"; export const MyComponent = async () => { return <div>Hello</div>; };
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (6)
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalid.jsx.snap
is excluded by!**/*.snap
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalidExportDef.jsx.snap
is excluded by!**/*.snap
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/valid.jsx.snap
is excluded by!**/*.snap
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNoAsync.jsx.snap
is excluded by!**/*.snap
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNotComponent.js.snap
is excluded by!**/*.snap
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNotComponent.jsx.snap
is excluded by!**/*.snap
📒 Files selected for processing (15)
.changeset/shaggy-keys-camp.md
(1 hunks)crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
(1 hunks)crates/biome_configuration/src/analyzer/linter/rules.rs
(12 hunks)crates/biome_diagnostics_categories/src/categories.rs
(1 hunks)crates/biome_js_analyze/src/lint/nursery.rs
(2 hunks)crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalid.jsx
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalidExportDef.jsx
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/valid.jsx
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNoAsync.jsx
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNotComponent.jsx
(1 hunks)crates/biome_rule_options/src/lib.rs
(1 hunks)crates/biome_rule_options/src/no_next_async_client_component.rs
(1 hunks)packages/@biomejs/backend-jsonrpc/src/workspace.ts
(5 hunks)packages/@biomejs/biome/configuration_schema.json
(3 hunks)
✅ Files skipped from review due to trivial changes (1)
- crates/biome_js_analyze/src/lint/nursery.rs
🚧 Files skipped from review as they are similar to previous changes (13)
- crates/biome_rule_options/src/lib.rs
- crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalidExportDef.jsx
- crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/valid.jsx
- crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalid.jsx
- crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNoAsync.jsx
- crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/validNotComponent.jsx
- .changeset/shaggy-keys-camp.md
- crates/biome_rule_options/src/no_next_async_client_component.rs
- crates/biome_configuration/src/analyzer/linter/rules.rs
- crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
- crates/biome_diagnostics_categories/src/categories.rs
- packages/@biomejs/backend-jsonrpc/src/workspace.ts
- packages/@biomejs/biome/configuration_schema.json
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Format code (Rust + TOML) using
just format
Format Rust and TOML files using
just f
(alias forjust format
).
Files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
crates/biome_*/**/*
📄 CodeRabbit Inference Engine (CLAUDE.md)
Core crates must be located in
/crates/biome_*/
Files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
**/*.rs
📄 CodeRabbit Inference Engine (CONTRIBUTING.md)
Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
🧠 Learnings (15)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: You are encouraged to split the work for a new rule into multiple PRs and describe your plan in an issue if unfamiliar with Biome's APIs.
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: If you implement a new feature that affects end users, send a PR to the `next` branch.
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: If you promote a rule from nursery, send a PR to the `next` branch.
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.395Z
Learning: Create new lint rules using `just new-js-lintrule`, `just new-css-lintrule`, `just new-json-lintrule`, or `just new-graphql-lintrule`, and the rule name must be camelCase
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to crates/biome_lint_rules/**/*.rs : Linter rules must have a `version` metadata field in their implementation, set to "next" for new rules and updated to the new version when releasing.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Update the `language` field in `declare_lint_rule!` to match the language the rule applies to (e.g., `js`, `jsx`, `ts`, `tsx`).
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a lint rule is ported from another ecosystem (e.g., ESLint), add a `sources` metadata field in `declare_lint_rule!` referencing the original rule.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `version` field in `declare_lint_rule!` must be set to `next` for new rules.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{use*,no*}_*{vue,react,angular,svelte}*.rs : If a rule overwhelmingly applies to a specific framework, it should be named using the `use<Framework>...` or `no<Framework>...` pattern (e.g., `noVueReservedProps`).
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no*_*.rs : Rules that forbid a single concept should be named using the `no<Concept>` prefix (e.g., `noDebugger` for disallowing `debugger` statements).
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : New rules must be placed inside the `nursery` group for incubation before promotion.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When deprecating a rule, specify the reason using the `deprecated:` field in the `declare_lint_rule!` macro.
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{use*,no*}_*{vue,react,angular,svelte}*.rs : If a rule overwhelmingly applies to a specific framework, it should be named using the `use<Framework>...` or `no<Framework>...` pattern (e.g., `noVueReservedProps`).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a lint rule is ported from another ecosystem (e.g., ESLint), add a `sources` metadata field in `declare_lint_rule!` referencing the original rule.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Update the `language` field in `declare_lint_rule!` to match the language the rule applies to (e.g., `js`, `jsx`, `ts`, `tsx`).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `version` field in `declare_lint_rule!` must be set to `next` for new rules.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When deprecating a rule, specify the reason using the `deprecated:` field in the `declare_lint_rule!` macro.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : New rules must be placed inside the `nursery` group for incubation before promotion.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `declare_lint_rule!` macro must be used to declare an analyzer rule type and implement the RuleMeta trait.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a rule provides a code action, add the `fix_kind` metadata to the `declare_lint_rule!` macro and implement the `action` function.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:49:35.574Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to crates/biome_lint_rules/**/*.rs : Linter rules must have a `version` metadata field in their implementation, set to "next" for new rules and updated to the new version when releasing.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_redundant*_*.rs : Rules that report redundant code should use the `noRedundant<Concept>` naming convention (e.g., `noRedundantUseStrict`).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When banning certain functions or variables, always check if the variable is global using the semantic model to avoid false positives.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Each code block in rule documentation must specify a language and use `expect_diagnostic` for invalid examples.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When a rule requires semantic information, use the `Semantic<>` query type and access the semantic model via `ctx.model()`.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no*_*.rs : Rules that forbid a single concept should be named using the `no<Concept>` prefix (e.g., `noDebugger` for disallowing `debugger` statements).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
⏰ 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_formatter)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Check JS Files
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Documentation
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: End-to-end tests
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test Node.js API
- GitHub Check: autofix
🔇 Additional comments (3)
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs (3)
145-153
: LGTM: robust "use client" directive detectioninner_string_text() makes this resilient to quoting styles; concise and clear.
51-59
: Verify language field consistency for Next async client component ruleI couldn’t find other
language
values via the initial search—please double-check the project convention for Next/React rules to ensure we’re not missing JSX/TSX support.
- File:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs (lines 51–59)
language: "js"
– confirm if this should also cover"jsx"
/"tsx"
.- Scan other Next/React lint rules for their
language
settings.#!/bin/bash # List all language fields in JS/React/Next lint rules rg -n 'declare_lint_rule!' -A5 crates/biome_js_analyze/src/lint \ | rg -C2 'language:' || echo "No matches found—please verify manually."
13-60
: Housekeeping: regenerate & format, then sharpen your sanity‐check script
- Run
just gen-all && just f
- To catch real Git conflict markers (and not every “=====…” in your snapshots), use strict anchors:
rg -n '^(<<<<<<< |>>>>>>> )' rg -n '^=======$'- To flag stray debug or TODOs only in your source (and not in generated tests), scope your grep:
rg -n --type rust '\b(todo!\(|dbg!\()' crates/biome_js_analyze/src
⛔ Skipped due to learnings
Learnt from: CR PR: biomejs/biome#0 File: CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:49:35.574Z Learning: Applies to **/*.{rs,toml} : Format Rust and TOML files using `just f` (alias for `just format`).
Learnt from: CR PR: biomejs/biome#0 File: CLAUDE.md:0-0 Timestamp: 2025-08-05T13:25:32.395Z Learning: Applies to **/*.{rs,toml} : Format code (Rust + TOML) using `just format`
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:18.454Z Learning: Format your code with `just f` and lint with `just l` before committing.
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:18.454Z Learning: Test rules using quick tests in the appropriate test file (e.g., `biome_js_analyze/tests/quick_test.rs`) and snapshot tests in `tests/specs/`.
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_formatter/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:56.365Z Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : Update the `spec_tests.rs` file to generate a test function for each `.html` file found inside `tests/specs/html` using the `tests_macros::gen_tests!` macro.
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_js_formatter/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:51:05.640Z Learning: Applies to crates/biome_js_formatter/**/*.rs : Use the `dbg_write!` macro to output the written IR elements to the console for debugging formatter output.
Learnt from: CR PR: biomejs/biome#0 File: CLAUDE.md:0-0 Timestamp: 2025-08-05T13:25:32.395Z Learning: Applies to xtask/codegen/*.ungram : When adding new syntax nodes or rules, modify the appropriate `.ungram` file in `xtask/codegen/` and run `just gen-all` to regenerate code
Learnt from: CR PR: biomejs/biome#0 File: CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:49:35.574Z Learning: Applies to **/*.rs : Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:18.454Z Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Avoid deep indentation by using combinators like `map`, `filter`, and `and_then` instead of nested `if let` or `match` statements.
Learnt from: CR PR: biomejs/biome#0 File: CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:49:35.574Z Learning: Use Rust's `dbg!()` macro for debugging and pass `--show-output` to `cargo` to display debug output during tests.
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:18.454Z Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `declare_lint_rule!` macro must be used to declare an analyzer rule type and implement the RuleMeta trait.
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:18.454Z Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{use*,no*}_*{vue,react,angular,svelte}*.rs : If a rule overwhelmingly applies to a specific framework, it should be named using the `use<Framework>...` or `no<Framework>...` pattern (e.g., `noVueReservedProps`).
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:18.454Z Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no*_*.rs : Rules that forbid a single concept should be named using the `no<Concept>` prefix (e.g., `noDebugger` for disallowing `debugger` statements).
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:18.454Z Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `version` field in `declare_lint_rule!` must be set to `next` for new rules.
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:18.454Z Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Each code block in rule documentation must specify a language and use `expect_diagnostic` for invalid examples.
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:18.454Z Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When deprecating a rule, specify the reason using the `deprecated:` field in the `declare_lint_rule!` macro.
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:18.454Z Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a lint rule is ported from another ecosystem (e.g., ESLint), add a `sources` metadata field in `declare_lint_rule!` referencing the original rule.
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:18.454Z Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `rule_category!` macro should be used in diagnostics to statically inject the category at compile time.
Learnt from: CR PR: biomejs/biome#0 File: CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:49:35.574Z Learning: Applies to crates/biome_lint_rules/**/*.rs : Linter rules must have a `version` metadata field in their implementation, set to "next" for new rules and updated to the new version when releasing.
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-05T14:50:18.454Z Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_restricted*_*.rs : Rules that report restricted entities should use the `noRestricted<Concept>` naming convention (e.g., `noRestrictedGlobals`).
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
Show resolved
Hide resolved
noNextAsyncClientComponent
rule in Next domain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (3)
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs (2)
171-177
: Grammar nit: pluralise “component”.
"Async client component are not allowed."
→"Async client components are not allowed."
73-76
: Match arms for object/class members are never hit.The guard on Lines 73-76 exits early for non-
Function
kinds, so the later match arms forJsMethodObjectMember
,JsPropertyObjectMember
, andJsMethodClassMember
can’t execute. Either drop the guard or remove the dead arms to keep the rule lean.Also applies to: 126-140
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalid.jsx (1)
3-5
: Consider adding default-export async arrow case.The ESLint sibling also forbids
export default async () => {} export default (async () => {})Adding them here would future-proof the test suite.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalid.jsx.snap
is excluded by!**/*.snap
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/valid.jsx.snap
is excluded by!**/*.snap
📒 Files selected for processing (3)
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalid.jsx
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/valid.jsx
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Format code (Rust + TOML) using
just format
Format Rust and TOML files using
just f
(alias forjust format
).
Files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
crates/biome_*/**/*
📄 CodeRabbit Inference Engine (CLAUDE.md)
Core crates must be located in
/crates/biome_*/
Files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/valid.jsx
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/invalid.jsx
**/*.rs
📄 CodeRabbit Inference Engine (CONTRIBUTING.md)
Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
🧠 Learnings (19)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: You are encouraged to split the work for a new rule into multiple PRs and describe your plan in an issue if unfamiliar with Biome's APIs.
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: If you implement a new feature that affects end users, send a PR to the `next` branch.
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: If you promote a rule from nursery, send a PR to the `next` branch.
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to crates/biome_lint_rules/**/*.rs : Linter rules must have a `version` metadata field in their implementation, set to "next" for new rules and updated to the new version when releasing.
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.395Z
Learning: Create new lint rules using `just new-js-lintrule`, `just new-css-lintrule`, `just new-json-lintrule`, or `just new-graphql-lintrule`, and the rule name must be camelCase
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `version` field in `declare_lint_rule!` must be set to `next` for new rules.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a lint rule is ported from another ecosystem (e.g., ESLint), add a `sources` metadata field in `declare_lint_rule!` referencing the original rule.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Update the `language` field in `declare_lint_rule!` to match the language the rule applies to (e.g., `js`, `jsx`, `ts`, `tsx`).
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : New rules must be placed inside the `nursery` group for incubation before promotion.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{use*,no*}_*{vue,react,angular,svelte}*.rs : If a rule overwhelmingly applies to a specific framework, it should be named using the `use<Framework>...` or `no<Framework>...` pattern (e.g., `noVueReservedProps`).
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When deprecating a rule, specify the reason using the `deprecated:` field in the `declare_lint_rule!` macro.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a rule provides a code action, add the `fix_kind` metadata to the `declare_lint_rule!` macro and implement the `action` function.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `declare_lint_rule!` macro must be used to declare an analyzer rule type and implement the RuleMeta trait.
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{use*,no*}_*{vue,react,angular,svelte}*.rs : If a rule overwhelmingly applies to a specific framework, it should be named using the `use<Framework>...` or `no<Framework>...` pattern (e.g., `noVueReservedProps`).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a lint rule is ported from another ecosystem (e.g., ESLint), add a `sources` metadata field in `declare_lint_rule!` referencing the original rule.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Update the `language` field in `declare_lint_rule!` to match the language the rule applies to (e.g., `js`, `jsx`, `ts`, `tsx`).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `version` field in `declare_lint_rule!` must be set to `next` for new rules.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : New rules must be placed inside the `nursery` group for incubation before promotion.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When deprecating a rule, specify the reason using the `deprecated:` field in the `declare_lint_rule!` macro.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `declare_lint_rule!` macro must be used to declare an analyzer rule type and implement the RuleMeta trait.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a rule provides a code action, add the `fix_kind` metadata to the `declare_lint_rule!` macro and implement the `action` function.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:49:35.574Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to crates/biome_lint_rules/**/*.rs : Linter rules must have a `version` metadata field in their implementation, set to "next" for new rules and updated to the new version when releasing.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_redundant*_*.rs : Rules that report redundant code should use the `noRedundant<Concept>` naming convention (e.g., `noRedundantUseStrict`).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When banning certain functions or variables, always check if the variable is global using the semantic model to avoid false positives.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/tests/specs/*/*/*.jsonc : Files ending with `.jsonc` in snapshot tests should contain arrays of code snippets for script environments.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Test rules using quick tests in the appropriate test file (e.g., `biome_js_analyze/tests/quick_test.rs`) and snapshot tests in `tests/specs/`.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Each code block in rule documentation must specify a language and use `expect_diagnostic` for invalid examples.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When a rule requires semantic information, use the `Semantic<>` query type and access the semantic model via `ctx.model()`.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When implementing the `run` function for a rule, prefer transforming `Result` into `Option` and using the `?` operator for concise code.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no*_*.rs : Rules that forbid a single concept should be named using the `no<Concept>` prefix (e.g., `noDebugger` for disallowing `debugger` statements).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_next_async_client_component.rs
📚 Learning: 2025-08-05T14:51:59.193Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:59.193Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Add end-to-end tests for watcher functionality in LSP tests (../biome_lsp/src/server.tests.rs)
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/valid.jsx
⏰ 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_js_parser)
- GitHub Check: Documentation
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Test Node.js API
- GitHub Check: Check JS Files
- GitHub Check: autofix
🔇 Additional comments (1)
crates/biome_js_analyze/tests/specs/nursery/noNextAsyncClientComponent/valid.jsx (1)
1-33
: Good coverage of async server patternsNice spread (declaration, arrow, function expression, object/class methods). This squarely exercises allowed server-side async shapes.
Summary
Add https://nextjs.org/docs/messages/no-async-client-component rule, the name in Biome is noNextAsyncClientComponent.
Test Plan
Added test case.
Docs