+
Skip to content

Conversation

Jayllyz
Copy link
Contributor

@Jayllyz Jayllyz commented Aug 5, 2025

Summary

Close #2916, implement https://eslint.org/docs/latest/rules/max-params.

An option is available to change the default max, set to 4.
Note : countVoidThis option is not implemented in this PR.

Test Plan

Added test cases for the rule and the rule options.

Docs

Copy link

changeset-bot bot commented Aug 5, 2025

🦋 Changeset detected

Latest commit: fa52fbf

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

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

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

Copy link
Contributor

coderabbitai bot commented Aug 5, 2025

Walkthrough

A new linting rule, useMaxParams, has been added to enforce a maximum number of parameters allowed in function declarations, expressions, arrow functions, class methods, object methods, and constructors. The rule defaults to a maximum of 4 parameters and is configurable. It is integrated into the Biome linter’s nursery rule group with updates to configuration schemas, diagnostics categories, CLI migration logic, rule options, and TypeScript type definitions. The implementation includes comprehensive test cases for valid and invalid scenarios to verify correct behaviour and configurability.

Assessment against linked issues

Objective Addressed Explanation
Implement a rule restricting the number of parameters for functions, constructors, methods (eslint/max-params, clippy/too_many_arguments) (#2916)
Provide a user-configurable maximum parameter count option (#2916)
Default maximum parameter count set appropriately (issue discusses 4, ESLint: 3, Clippy: 7, Biome: 7) (#2916) Default is set to 4 as requested in the issue description.
Rule name: useMaxNumberOfArguments (#2916) Rule is named useMaxParams instead of useMaxNumberOfArguments.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
None found All changes are directly related to the implementation and integration of the new lint rule.

Suggested reviewers

  • ematipico

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c8bdcc and fa52fbf.

⛔ Files ignored due to path filters (4)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.js.snap is excluded by !**/*.snap
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.ts.snap is excluded by !**/*.snap
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js.snap is excluded by !**/*.snap
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (5)
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.js (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
🧰 Additional context used
📓 Path-based instructions (1)
crates/biome_*/**/*

📄 CodeRabbit Inference Engine (CLAUDE.md)

Core crates must be located in /crates/biome_*/

Files:

  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.ts
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.js
🧠 Learnings (3)
📓 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: 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_excessive*_*.rs : Rules that report code exceeding certain limits should use the `noExcessive<Concept>` naming convention (e.g., `noExcessiveNestedTestSuites`).
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 : The `version` field in `declare_lint_rule!` must be set to `next` for new rules.
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 : 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 : 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 : Set the `severity` field in `declare_lint_rule!` to `Severity::Warning` or `Severity::Error` as appropriate for the 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 : New rules must be placed inside the `nursery` group for incubation before promotion.
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_excessive*_*.rs : rules that report ...
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_excessive*_*.rs : Rules that report code exceeding certain limits should use the `noExcessive<Concept>` naming convention (e.g., `noExcessiveNestedTestSuites`).

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.js
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : when banning certain functions o...
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/tests/specs/nursery/useMaxParams/invalid.js
⏰ 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: Documentation
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_html_parser)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Bench (biome_html_formatter)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Check Dependencies
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Check JS Files
  • GitHub Check: autofix
🔇 Additional comments (2)
crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.ts (1)

1-16: Excellent test coverage for TypeScript-specific cases.

The test cases properly cover TypeScript-specific scenarios including explicit this parameters, declared functions, and function type aliases. All functions correctly exceed the default 4-parameter limit.

crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.js (1)

1-42: Comprehensive JavaScript function coverage.

Excellent variety of function types tested - covers regular functions, expressions, arrow functions, class methods, constructors, object methods, and functions with explicit this. All cases properly exceed the 4-parameter limit.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels Aug 5, 2025
Copy link

codspeed-hq bot commented Aug 5, 2025

CodSpeed Performance Report

Merging #7124 will not alter performance

Comparing Jayllyz:feat/use-max-params (fa52fbf) with main (9f4538a)1

Summary

✅ 128 untouched benchmarks

Footnotes

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

@github-actions github-actions bot added the A-CLI Area: CLI label Aug 5, 2025
@Jayllyz Jayllyz changed the title feat(lint): add useMaxParams feat(analyze/js): add useMaxParams Aug 5, 2025
@Jayllyz Jayllyz marked this pull request as ready for review August 5, 2025 20:19
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 (4)
crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs (1)

1-1: Note: This is a generated file.

Since this file is generated (as indicated by the comment), any future changes should be made through the code generation process rather than manual edits to maintain consistency.

crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js (1)

1-45: Consider testing closer to the parameter limit.

The valid test cases only go up to 3 parameters, but if the default maximum is 7, consider adding test cases with 4-7 parameters to ensure the rule correctly allows functions up to the configured limit.

packages/@biomejs/biome/configuration_schema.json (1)

13687-13692: Nit: use integer literal for minimum
The minimum field is typed as integer, yet the value is 0.0 (floating-point). While most JSON validators coerce this, swapping to 0 avoids ambiguity and keeps style consistent with the rest of the schema.

-          "minimum": 0.0
+          "minimum": 0
crates/biome_js_analyze/src/lint/nursery/use_max_params.rs (1)

175-185: Validate parameter-counting error handling across lints

Our search didn’t turn up any other filter_map(Result::ok)-based counters in the repo—these two functions in
crates/biome_js_analyze/src/lint/nursery/use_max_params.rs are it:

  • count_js_parameters
  • count_constructor_parameters

Please confirm that quietly dropping parse errors here matches how you want all lint rules to behave. If you’d prefer to fail fast or report malformed parameters differently, let’s update accordingly.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b541fb and 009d510.

⛔ Files ignored due to path filters (3)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.js.snap is excluded by !**/*.snap
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.js.snap is excluded by !**/*.snap
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js.snap is excluded by !**/*.snap
📒 Files selected for processing (14)
  • .changeset/cruel-grapes-say.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/use_max_params.rs (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.js (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.js (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_max_params.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 (4)
.changeset/*.md

📄 CodeRabbit Inference Engine (CONTRIBUTING.md)

.changeset/*.md: Changeset descriptions should be about user-facing changes, use past tense for what you did, present tense for Biome behavior, reference issues/rules/assists with links, include code blocks when applicable, and end every sentence with a full stop.
Headers in changesets should use #### or ##### only; other headers may break the changelog.

Files:

  • .changeset/cruel-grapes-say.md
**/*.{rs,toml}

📄 CodeRabbit Inference Engine (CLAUDE.md)

Format code (Rust + TOML) using just format

Format Rust and TOML files using just f (alias for just format).

Files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_rule_options/src/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
crates/biome_*/**/*

📄 CodeRabbit Inference Engine (CLAUDE.md)

Core crates must be located in /crates/biome_*/

Files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.js
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_rule_options/src/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.js
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.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_rule_options/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_rule_options/src/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
🧠 Learnings (51)
📓 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: 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/no_excessive*_*.rs : Rules that report code exceeding certain limits should use the `noExcessive<Concept>` naming convention (e.g., `noExcessiveNestedTestSuites`).
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: 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 : 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 : 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 : Set the `severity` field in `declare_lint_rule!` to `Severity::Warning` or `Severity::Error` as appropriate for the 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 : New rules must be placed inside the `nursery` group for incubation before promotion.
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : update the `language` field in `...
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:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
  • packages/@biomejs/biome/configuration_schema.json
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : if a lint rule is ported from an...
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:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
  • packages/@biomejs/biome/configuration_schema.json
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : when deprecating a rule, specify...
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:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : the `version` field in `declare_...
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:

  • .changeset/cruel-grapes-say.md
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
  • crates/biome_rule_options/src/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
  • packages/@biomejs/biome/configuration_schema.json
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : if a rule provides a code action...
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:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_lint_rules/**/*.rs : linter rules must have a `version` metadata field in th...
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:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
  • crates/biome_rule_options/src/use_max_params.rs
  • packages/@biomejs/biome/configuration_schema.json
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : rule documentation must start wi...
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 : Rule documentation must start with a single-line summary, followed by detailed paragraphs, and include `## Examples` with `### Invalid` and `### Valid` sections.

Applied to files:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
  • packages/@biomejs/biome/configuration_schema.json
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : set the `severity` field in `dec...
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 : Set the `severity` field in `declare_lint_rule!` to `Severity::Warning` or `Severity::Error` as appropriate for the rule.

Applied to files:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{use*,no*}_*{vue,react,angular,svelte}*...
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:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • packages/@biomejs/biome/configuration_schema.json
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : new rules must be placed inside ...
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:

  • .changeset/cruel-grapes-say.md
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
  • packages/@biomejs/biome/configuration_schema.json
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_rule_options/lib/*.rs : rule options must be placed inside the...
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_rule_options/lib/*.rs : Rule options must be placed inside the `biome_rule_options` crate, with a file named after the rule (e.g., `use_this_convention.rs`).

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_max_params.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
📚 Learning: applies to crates/biome_analyze/biome_rule_options/lib/*.rs : use boxed slices (`box<[box]>`) i...
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_rule_options/lib/*.rs : Use boxed slices (`Box<[Box<str>]>`) instead of `Vec<String>` for string arrays in rule options to save memory.

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/use*_*.rs : rules that mandate a single...
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*_*.rs : Rules that mandate a single concept should be named using the `use<Concept>` prefix (e.g., `useValidLang` for mandating valid HTML `lang` attribute values).

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_rule_options/src/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : rule options must be documented ...
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 : Rule options must be documented in the `## Options` section of the rule's documentation, with each option having its own header and example.

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
  • crates/biome_rule_options/src/use_max_params.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
  • packages/@biomejs/biome/configuration_schema.json
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_formatter/**/lib.rs : add the provided formatting infrastructure code inside...
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/**/lib.rs : Add the provided formatting infrastructure code inside your `lib.rs` file when creating a new formatter crate for a language (e.g., biome_html_formatter).

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : the `declare_lint_rule!` macro m...
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_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
📚 Learning: applies to crates/biome_analyze/biome_rule_options/lib/*.rs : rule option structs must derive `deser...
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_rule_options/lib/*.rs : Rule option structs must derive `Deserializable`, `Serialize`, `Deserialize`, and (optionally) `JsonSchema` for configuration and schema support.

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_max_params.rs
  • packages/@biomejs/biome/configuration_schema.json
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_parser/crates/biome_*/lexer/mod.rs : create a `lexer/mod.rs` file inside the...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/lexer/mod.rs : Create a `lexer/mod.rs` file inside the parser crate for each language to implement the lexer.

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/use_shorthand*_*.rs : rules that promot...
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_shorthand*_*.rs : Rules that promote shorthand syntax should use the `useShorthand<Concept>` naming convention (e.g., `useShorthandAssign`).

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: the file `packages/@biomejs/biome/configuration_schema.json` is auto-generated and should not be man...
Learnt from: dyc3
PR: biomejs/biome#7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/@biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
  • packages/@biomejs/biome/configuration_schema.json
📚 Learning: applies to crates/biome_formatter/tests/specs/html/**/options.json : if you require non-default form...
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/specs/html/**/options.json : If you require non-default formatting options for tests, create an `options.json` file in the same folder as the `.html` files. These options will apply to all files in that folder.

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
📚 Learning: applies to crates/biome_analyze/tests/specs/*/*/*.jsonc : files ending with `.jsonc` in snapshot tes...
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/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js
📚 Learning: applies to crates/biome_formatter/tests/spec_tests.rs : update the `spec_tests.rs` file to generate ...
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.

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_excessive*_*.rs : rules that report ...
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_excessive*_*.rs : Rules that report code exceeding certain limits should use the `noExcessive<Concept>` naming convention (e.g., `noExcessiveNestedTestSuites`).

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.js
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.js
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : when banning certain functions o...
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/tests/specs/nursery/useMaxParams/invalidCustomMax.js
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.js
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : when a rule needs to query multi...
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 needs to query multiple node types, use the `declare_node_union!` macro to define a union type.

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_useless*_*.rs : rules that report un...
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_useless*_*.rs : Rules that report unnecessary code should use the `noUseless<Concept>` naming convention (e.g., `noUselessConstructor`).

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : each code block in rule document...
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/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : when implementing the `run` func...
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/use_max_params.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : for rules that emit multiple dia...
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 : For rules that emit multiple diagnostics or actions, use an iterable type (e.g., `Box<[_]>`) for the `Signals` associated type.

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_redundant*_*.rs : rules that report ...
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/use_max_params.rs
  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to **/*.rs : update documentation for new features or changes, using inline rustdoc for rule...
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.

Applied to files:

  • crates/biome_rule_options/src/use_max_params.rs
📚 Learning: applies to crates/biome_diagnostics/**/*.rs : when implementing the diagnostic trait, use the #[deri...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:35.163Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : When implementing the Diagnostic trait, use the #[derive(Diagnostic)] procedural macro to simplify implementation.

Applied to files:

  • crates/biome_rule_options/src/use_max_params.rs
📚 Learning: applies to crates/biome_js_type_info/src/type_info.rs : the `typedata` enum, defined in `src/type_in...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : The `TypeData` enum, defined in `src/type_info.rs`, is the central data structure for type information and should be extended to cover all relevant TypeScript types.

Applied to files:

  • crates/biome_rule_options/src/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : assign the `domains` field in `d...
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 : Assign the `domains` field in `declare_lint_rule!` if the rule belongs to a specific domain (e.g., testing, framework).

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery.rs
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no*_*.rs : rules that forbid a single c...
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.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : avoid deep indentation by using ...
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.

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery.rs
📚 Learning: applies to crates/biome_analyze/tests/specs/*/*/{invalid*,valid*}* : snapshot tests for rules should...
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/*/*/{invalid*,valid*}* : Snapshot tests for rules should be placed in `tests/specs/<group>/<rule_name>/` with files prefixed by `invalid` or `valid`.

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{no_invalid*,use_valid*}_*.rs : rules t...
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_invalid*,use_valid*}_*.rs : Rules that report invalid code should use the `noInvalid<Concept>` or `useValid<Concept>` naming conventions (e.g., `noInvalidConstructorSuper`, `useValidTypeof`).

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js
  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: test rules using quick tests in the appropriate test file (e.g., `biome_js_analyze/tests/quick_test....
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/tests/specs/nursery/useMaxParams/valid.js
📚 Learning: applies to crates/biome_formatter/tests/specs/html/**/*.html : create your first `.html` test file i...
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/specs/html/**/*.html : Create your first `.html` test file inside `tests/specs/html`, preferably organizing tests into subfolders by kind.

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/valid.js
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : the `rule_category!` macro shoul...
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.

Applied to files:

  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs
📚 Learning: applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : when dec...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:35.163Z
Learning: Applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : When declaring a new diagnostic category, add it to crates/biome_diagnostics_categories/src/categories.rs to ensure it is statically registered.

Applied to files:

  • crates/biome_diagnostics_categories/src/categories.rs
📚 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.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

Applied to files:

  • crates/biome_diagnostics_categories/src/categories.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/use_consistent*_*.rs : rules that ensur...
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_consistent*_*.rs : Rules that ensure consistency should use the `useConsistent<Concept>` naming convention (e.g., `useConsistentArrayType`).

Applied to files:

  • crates/biome_diagnostics_categories/src/categories.rs
  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_misleading*_*.rs : rules that report...
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_misleading*_*.rs : Rules that report misleading code should use the `noMisleading<Concept>` naming convention (e.g., `noMisleadingCharacterClass`).

Applied to files:

  • crates/biome_configuration/src/analyzer/linter/rules.rs
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_restricted*_*.rs : rules that report...
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`).

Applied to files:

  • crates/biome_configuration/src/analyzer/linter/rules.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_unsafe*_*.rs : rules that report uns...
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_unsafe*_*.rs : Rules that report unsafe code should use the `noUnsafe<Concept>` naming convention (e.g., `noUnsafeOptionalChaining`).

Applied to files:

  • crates/biome_configuration/src/analyzer/linter/rules.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.395Z
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
📚 Learning: document and test the effect of rule options as part of the rule's documentation and test suite....
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Document and test the effect of rule options as part of the rule's documentation and test suite.

Applied to files:

  • packages/@biomejs/backend-jsonrpc/src/workspace.ts
🔇 Additional comments (33)
crates/biome_rule_options/src/lib.rs (1)

304-304: LGTM!

The module export follows the established pattern and maintains alphabetical ordering.

crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.options.json (1)

1-15: Well-structured test configuration.

The JSON properly configures the rule with a custom maximum of 1 parameter and error severity level, which will work nicely with the accompanying test file.

crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalidCustomMax.js (1)

1-4: Perfect test case for custom maximum validation.

The function with 2 parameters will correctly trigger diagnostics when the maximum is set to 1, providing good test coverage for the rule's configurability.

crates/biome_diagnostics_categories/src/categories.rs (1)

219-219: Diagnostic category properly registered.

The entry follows the established pattern and maintains alphabetical ordering within the nursery lint group.

crates/biome_js_analyze/src/lint/nursery.rs (2)

50-50: Module declaration correctly added.

The new use_max_params module is properly declared and maintains alphabetical ordering.


62-62: Rule properly integrated into nursery group.

The UseMaxParams rule is correctly added to the nursery lint group macro, maintaining the established pattern and alphabetical ordering within the rules list.

crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs (1)

1248-1259: LGTM! ESLint max-params migration correctly implemented.

The new match arm properly handles the migration of ESLint's max-params rule to Biome's useMaxParams, following the established nursery rule pattern. The implementation correctly checks nursery inclusion, manages rule groups, and sets appropriate severity levels.

.changeset/cruel-grapes-say.md (1)

1-25: Well-documented changeset with clear examples.

The changeset properly describes the new rule with helpful code examples showing both invalid and valid usage patterns. Good work on making this user-friendly.

crates/biome_rule_options/src/use_max_params.rs (1)

12-16: Verify default parameter count aligns with requirements.

The default maximum is set to 7, but the PR objectives mention setting a default of 4 as a compromise between ESLint's 3 and Clippy's 7. Please confirm this is the intended value.

crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.js (1)

1-38: Comprehensive invalid test cases.

Good coverage of different function types exceeding the parameter limit. The test cases properly validate that functions with 8+ parameters trigger the rule.

packages/@biomejs/biome/configuration_schema.json (2)

5105-5111: Schema entry fine – but confirm it's generator-driven
Looks correct, but this file is produced by the code-gen pipeline. Double-check that you ran the generator rather than editing by hand; otherwise the next regen will overwrite this block.


10768-10782: No concerns – matches existing pattern
New RuleWithUseMaxParamsOptions object mirrors the structure of sibling rules and keeps the schema consistent.

packages/@biomejs/backend-jsonrpc/src/workspace.ts (5)

1746-1749: LGTM! Documentation follows existing conventions.

The JSDoc comment correctly describes the rule's purpose and matches the established pattern used throughout the interface.


3028-3030: Type alias follows existing pattern correctly.

The RuleConfiguration_for_UseMaxParamsOptions type alias correctly follows the established naming convention and structure used by other configurable rules in the codebase.


5614-5623: Interface definition is consistent with existing patterns.

The RuleWithOptions_for_UseMaxParamsOptions interface correctly follows the established structure with proper JSDoc comments for both level and options properties.


7920-7925: Options interface correctly implements the configurable maximum.

The UseMaxParamsOptions interface properly defines the optional max property with clear documentation indicating the default value of 7, which aligns with the PR objectives.


8622-8622: Category string correctly added to union type.

The "lint/nursery/useMaxParams" category is properly added to the Category union type, maintaining alphabetical order and consistent formatting.

crates/biome_configuration/src/analyzer/linter/rules.rs (12)

390-390: LGTM! Proper naming convention and alphabetical positioning.

The UseMaxParams variant follows the established use<Concept> pattern for rules that mandate a concept, and it's correctly positioned alphabetically in the enum.


742-742: LGTM! Consistent string mapping.

The camelCase string representation "useMaxParams" follows the established convention and maintains proper alphabetical ordering.


1090-1090: LGTM! Correct nursery group assignment.

New rules must be placed in the nursery group for incubation, which is correctly implemented here.


1447-1447: LGTM! Proper string parsing implementation.

The parsing support enables configuration of the rule from string identifiers, maintaining consistency with other rules.


4301-4301: LGTM! Proper field definition with correct types.

The use_max_params field follows the established pattern for configurable rules, with appropriate documentation and type signature referencing the custom options.


4352-4352: LGTM! Proper addition to rules array.

The rule is correctly added to the GROUP_RULES array, maintaining alphabetical order for consistent rule management.


4377-4378: LGTM! Correct index updates for recommended rules.

The array indices are properly updated to account for the new rule insertion, maintaining correct references to the intended rules.


4441-4441: LGTM! Correct index update for all rules filter.

The array index is properly updated to maintain the complete list of all rules after the new rule insertion.


4688-4757: LGTM! Proper enabled rules implementation.

The use_max_params rule is correctly integrated into the enabled rules logic, following the established pattern of checking configuration state and inserting appropriate filters. Array indices for subsequent rules are properly updated.


4997-5066: LGTM! Proper disabled rules implementation.

The disabled rules logic for use_max_params follows the established pattern, correctly checking for disabled state and maintaining proper array indexing for all subsequent rules.


5285-5288: LGTM! Proper configuration retrieval implementation.

The configuration retrieval for "useMaxParams" follows the established pattern, correctly returning both the rule level and options when configured.


5396-5396: LGTM! Proper default configuration setup.

The default configuration assignment for use_max_params maintains alphabetical order and follows the established pattern for rule initialisation.

crates/biome_js_analyze/src/lint/nursery/use_max_params.rs (4)

14-81: Verify rule name and default parameter count alignment with PR objectives.

The PR objectives specify the rule should be named useMaxNumberOfArguments with a default maximum of 4 parameters as a compromise between ESLint (3) and Clippy (7). However, this implementation uses useMaxParams with a default of 7 parameters (line 71). Please confirm this naming and default value change was intentional.

Likely an incorrect or invalid review comment.


83-85: Well-structured node union for function-like constructs.

The AnyFunctionLike union appropriately covers all JavaScript function types that can have parameters. The implementation correctly includes constructors, methods, and various function expressions.


98-137: Robust parameter extraction and counting logic.

The pattern matching handles all function types correctly, including the special case of arrow functions with single parameters. The early return with ? operator on line 133 is clean, and the final comparison using then_some is idiomatic Rust.


139-158: Helpful diagnostic messages with actionable guidance.

The diagnostic provides clear context about the violation and includes practical suggestions for refactoring. The notes offer concrete alternatives like using options objects or splitting functions.

Copy link
Contributor

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

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

Nice and simple :)

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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 009d510 and 324bd9d.

⛔ Files ignored due to path filters (1)
  • crates/biome_js_analyze/tests/specs/nursery/useMaxParams/invalid.js.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • .changeset/cruel-grapes-say.md (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs (1 hunks)
  • crates/biome_rule_options/src/use_max_params.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_rule_options/src/use_max_params.rs
🧰 Additional context used
📓 Path-based instructions (4)
.changeset/*.md

📄 CodeRabbit Inference Engine (CONTRIBUTING.md)

.changeset/*.md: Changeset descriptions should be about user-facing changes, use past tense for what you did, present tense for Biome behavior, reference issues/rules/assists with links, include code blocks when applicable, and end every sentence with a full stop.
Headers in changesets should use #### or ##### only; other headers may break the changelog.

Files:

  • .changeset/cruel-grapes-say.md
**/*.{rs,toml}

📄 CodeRabbit Inference Engine (CLAUDE.md)

Format code (Rust + TOML) using just format

Format Rust and TOML files using just f (alias for just format).

Files:

  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
crates/biome_*/**/*

📄 CodeRabbit Inference Engine (CLAUDE.md)

Core crates must be located in /crates/biome_*/

Files:

  • crates/biome_js_analyze/src/lint/nursery/use_max_params.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/use_max_params.rs
🧠 Learnings (21)
📓 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: 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/no_excessive*_*.rs : Rules that report code exceeding certain limits should use the `noExcessive<Concept>` naming convention (e.g., `noExcessiveNestedTestSuites`).
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: 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 : 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 : 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 : Set the `severity` field in `declare_lint_rule!` to `Severity::Warning` or `Severity::Error` as appropriate for the 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 : New rules must be placed inside the `nursery` group for incubation before promotion.
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : update the `language` field in `...
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:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : if a lint rule is ported from an...
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:

  • .changeset/cruel-grapes-say.md
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : if a rule provides a code action...
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:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : when deprecating a rule, specify...
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:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : the `version` field in `declare_...
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:

  • .changeset/cruel-grapes-say.md
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : set the `severity` field in `dec...
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 : Set the `severity` field in `declare_lint_rule!` to `Severity::Warning` or `Severity::Error` as appropriate for the rule.

Applied to files:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : rule documentation must start wi...
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 : Rule documentation must start with a single-line summary, followed by detailed paragraphs, and include `## Examples` with `### Invalid` and `### Valid` sections.

Applied to files:

  • .changeset/cruel-grapes-say.md
📚 Learning: applies to crates/biome_lint_rules/**/*.rs : linter rules must have a `version` metadata field in th...
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:

  • .changeset/cruel-grapes-say.md
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{use*,no*}_*{vue,react,angular,svelte}*...
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:

  • .changeset/cruel-grapes-say.md
  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : new rules must be placed inside ...
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:

  • .changeset/cruel-grapes-say.md
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : the `declare_lint_rule!` macro m...
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/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : when a rule needs to query multi...
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 needs to query multiple node types, use the `declare_node_union!` macro to define a union type.

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_excessive*_*.rs : rules that report ...
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_excessive*_*.rs : Rules that report code exceeding certain limits should use the `noExcessive<Concept>` naming convention (e.g., `noExcessiveNestedTestSuites`).

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : when banning certain functions o...
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/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_useless*_*.rs : rules that report un...
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_useless*_*.rs : Rules that report unnecessary code should use the `noUseless<Concept>` naming convention (e.g., `noUselessConstructor`).

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/use*_*.rs : rules that mandate a single...
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*_*.rs : Rules that mandate a single concept should be named using the `use<Concept>` prefix (e.g., `useValidLang` for mandating valid HTML `lang` attribute values).

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : each code block in rule document...
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/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : when implementing the `run` func...
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/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : for rules that emit multiple dia...
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 : For rules that emit multiple diagnostics or actions, use an iterable type (e.g., `Box<[_]>`) for the `Signals` associated type.

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_max_params.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_redundant*_*.rs : rules that report ...
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/use_max_params.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). (25)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Bench (biome_html_formatter)
  • GitHub Check: Check Dependencies
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Check JS Files
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Bench (biome_html_parser)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: autofix
🔇 Additional comments (7)
crates/biome_js_analyze/src/lint/nursery/use_max_params.rs (6)

1-12: Imports look good.

All necessary dependencies are properly imported for the rule implementation.


83-85: Node union correctly covers all function types.

The union properly includes all JavaScript function-like constructs that need parameter count validation.


87-90: State struct is well-defined.

Simple and focused structure for tracking parameter count.


92-158: Rule implementation is well-structured.

The logic correctly handles all function types, provides clear diagnostics, and follows Biome conventions. The parameter extraction and counting logic is sound.


161-165: Clean abstraction for parameter types.

The enum properly unifies different parameter node structures.


167-185: Helper functions are well-implemented.

Proper error handling and clean separation of concerns for counting different parameter types.

.changeset/cruel-grapes-say.md (1)

1-24: Well-crafted changeset with clear examples.

The description effectively communicates the rule's purpose and the code examples demonstrate both problematic and recommended patterns.

@Jayllyz Jayllyz force-pushed the feat/use-max-params branch from 324bd9d to 26cfd41 Compare August 5, 2025 21:54
@Jayllyz Jayllyz force-pushed the feat/use-max-params branch from 26cfd41 to 7c8bdcc Compare August 7, 2025 08:42
The rule now handle type alias and declare function, like in the original eslint rule.
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Thank you @Jayllyz

Comment on lines +47 to +65
/// ```js
/// function foo(a, b, c) {
/// // within limit
/// }
/// ```
///
/// ```js
/// const bar = (a, b, c) => {
/// // within limit
/// }
/// ```
///
/// ```js
/// class Baz {
/// method(a, b, c) {
/// // within limit
/// }
/// }
/// ```
Copy link
Member

Choose a reason for hiding this comment

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

For the next contributions, valid cases can be added in one code block

@ematipico ematipico merged commit 3f436b8 into biomejs:main Aug 8, 2025
31 checks passed
@github-actions github-actions bot mentioned this pull request Aug 8, 2025
@Jayllyz Jayllyz deleted the feat/use-max-params branch August 8, 2025 12:54
@coderabbitai coderabbitai bot mentioned this pull request Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Diagnostic Area: diagnostocis A-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.

📎 Implement eslint/max-params clippy/too_many_arguments

3 participants

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