-
-
Notifications
You must be signed in to change notification settings - Fork 782
feat(lint): add options from typescript-eslint to useUnifiedTypeSignature
#8368
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
base: next
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: fe8771c The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 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 |
typescript-eslint to useUnifiedTypeSignature
WalkthroughAdds two options to the useUnifiedTypeSignatures rule: Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
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 (5)
crates/biome_jsdoc_comment/src/jsdoc_comment.rs (1)
67-71: Track the TODO comment for API cleanup.The TODO suggests removing
for_eachnow thatget_jsdocsis public. Consider opening an issue to track this deprecation and eventual removal in a future breaking release.crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (3)
282-340: Excellent refactoring!Centralising the merge logic in
try_merge_overloadssignificantly improves maintainability. The option gating is correctly implemented.Consider tracking the TODOs at lines 304 and 324 for future improvements:
- Whether to drop duplicate JSDoc from output
- Whether
try_mergeshould return a tuple directly
581-637: Track the code duplication TODO.The TODO at lines 581-582 highlights that similar name-comparison logic exists in
use_grouped_accessor_pair.rs. Consider consolidating these traits into a shared module to reduce duplication across lint rules.Would you like me to open an issue to track this refactoring across multiple rules?
972-993: Address code duplication.The TODO indicates this logic is duplicated across multiple rules. Consider extracting
get_name_tokento a shared utility module (perhaps in theparameter_extmodule) to avoid further duplication.crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.ts (1)
24-32: Comment vs JSDoc mismatch here
// same jsdocssays they’re identical, but the threebakeoverloads have different JSDoc text. Totally harmless, but it may trip up anyone cross‑checking againstinvalidJsdoc.ts. Consider tweaking the comment to match the intent.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (5)
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalid.ts.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.ts.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/valid.ts.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.ts.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (12)
.changeset/rare-maps-read.md(1 hunks)crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs(11 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalid.ts(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.ts(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/valid.ts(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.json(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.ts(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.json(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts(1 hunks)crates/biome_jsdoc_comment/src/jsdoc_comment.rs(3 hunks)crates/biome_rule_options/src/use_unified_type_signatures.rs(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
.changeset/**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/**/*.md: Create changesets for user-facing changes usingjust new-changeset; use headers with####or#####only; keep descriptions concise (1-3 sentences) and focus on user-facing changes
Use past tense when describing what was done ('Added new feature'), present tense when describing Biome behavior ('Biome now supports'); end sentences with a full stop
For new lint rules, show an example of an invalid case in an inline code snippet or code block; for rule changes, demonstrate what is now invalid or valid; for formatter changes, use adiffcode block
Files:
.changeset/rare-maps-read.md
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use thedbg!()macro for debugging output during testing, and pass the--show-outputflag tocargoto view debug output
Usecargo torcargo testto run tests; for a single test, pass the test name after thetestcommand
Use snapshot testing with theinstacrate; runcargo insta accept,cargo insta reject, orcargo insta reviewto manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Usejust f(alias forjust format) to format Rust and TOML files before committing
Files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_jsdoc_comment/src/jsdoc_comment.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
**/*.ts
📄 CodeRabbit inference engine (CONTRIBUTING.md)
For Node.js package development, build WebAssembly bindings and JSON-RPC bindings; run tests against compiled files after implementing features or bug fixes
Files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/valid.tscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalid.tscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.tscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.tscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.ts
🧠 Learnings (39)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to .changeset/**/*.md : For new lint rules, show an example of an invalid case in an inline code snippet or code block; for rule changes, demonstrate what is now invalid or valid; for formatter changes, use a `diff` code block
Applied to files:
.changeset/rare-maps-read.md
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to .changeset/**/*.md : Create changesets for user-facing changes using `just new-changeset`; use headers with `####` or `#####` only; keep descriptions concise (1-3 sentences) and focus on user-facing changes
Applied to files:
.changeset/rare-maps-read.md
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, then `expect_diagnostic`, then options modifiers, then `ignore`, then `file=path`
Applied to files:
.changeset/rare-maps-read.mdcrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.jsoncrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Applied to files:
.changeset/rare-maps-read.mdcrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.jsoncrates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.jsonc : Use `.jsonc` files in test specs with code snippets as array of strings to test rules in script environment (no import/export syntax)
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.json
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 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/style/useUnifiedTypeSignatures/validParams.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.{js,ts,tsx,jsx,json,css} : Test rules using snapshot tests via the `insta` library with test cases in `tests/specs/<group>/<rule_name>/` directories prefixed by `invalid` or `valid`
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options struct fields should use `#[serde(rename_all = "camelCase")]`, `#[serde(deny_unknown_fields)]`, and `#[serde(default)]` attributes for proper JSON serialization
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.jsoncrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnknown` prefix for rules that report mistyped entities in CSS (e.g., `noUnknownUnit`)
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Wrap optional rule option fields in `Option<_>` to properly track set vs unset options during configuration merging
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.jsoncrates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Biome linter is designed to work across languages, so rule naming should be generic if potentially implementable for multiple languages, or specific if meant for one language only
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.json
📚 Learning: 2025-09-25T12:32:59.003Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options must be defined in the `biome_rule_options` crate and implement traits: `Deserializable`, `Merge`, `Serialize`, `Deserialize`, and `JsonSchema`
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Implement the `Merge` trait for rule options to define how options from extended configuration merge with user configuration (usually reset instead of extend)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.jsoncrates/biome_jsdoc_comment/src/jsdoc_comment.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options array fields to save memory (boxed slices and boxed str use 2 words instead of three words)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeData::Unknown` to indicate when type inference falls short or is not implemented
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_jsdoc_comment/src/jsdoc_comment.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useConsistent` prefix for rules that ensure consistency across the codebase (e.g., `useConsistentArrayType`)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUndeclared` prefix for rules that report undefined entities (e.g., `noUndeclaredVariables`)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` variants (`Qualifier`, `Resolved`, `Import`, `Unknown`) to represent different phases of type resolution
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_jsdoc_comment/src/jsdoc_comment.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Document rules with a one-line brief description in the first paragraph of the doc comment, followed by detailed paragraphs, `## Examples` section with `### Invalid` and `### Valid` subsections, and optional `## Options` section
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.jsoncrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : In rule documentation code blocks, mark invalid examples with the `expect_diagnostic` property and valid examples without it; each invalid example must emit exactly one diagnostic
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/comments.rs : Define `<Language>CommentStyle` as a public type alias for `Comments<<Language>Language>` in a `comments.rs` file
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/local_inference.rs : Implement local inference in dedicated modules to derive type definitions from expressions without context of surrounding scopes
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ConditionalParsedSyntax` for syntax that is only valid in specific contexts (e.g., strict mode, file types, language versions) and call `or_invalid_to_bogus()` to convert to a bogus node if not supported
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to **/*.rs : Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `declare_node_union!` macro to query multiple node types at once by joining them into an enum with `Any*Like` naming convention
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/js_module_info/collector.rs : Implement module-level (thin) inference to resolve `TypeReference::Qualifier` variants by looking up declarations in module scopes and handling import statements
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/scoped_resolver.rs : Implement full inference to resolve `TypeReference::Import` variants across the entire module graph
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/*.ungram : Nodes for enclosing syntax errors must have the `Bogus` word, e.g., `HtmlBogusAttribute`, and must be part of a variant
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Define `FormatHtmlSyntaxNode` struct in a `cst.rs` file implementing `FormatRule<HtmlSyntaxNode>`, `AsFormat<HtmlFormatContext>`, and `IntoFormat<HtmlFormatContext>` traits using the provided boilerplate code
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
🧬 Code graph analysis (2)
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.ts (1)
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/valid.ts (1)
a(17-17)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (1)
crates/biome_jsdoc_comment/src/jsdoc_comment.rs (1)
get_jsdocs(75-89)
🪛 LanguageTool
.changeset/rare-maps-read.md
[uncategorized] ~8-~8: Possible missing comma found.
Context: ...arameters or different JSDoc comments. Example with ignoreDifferentlyNamedParameters...
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ 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). (8)
- GitHub Check: Documentation
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: autofix
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_parser)
🔇 Additional comments (12)
crates/biome_jsdoc_comment/src/jsdoc_comment.rs (1)
73-89: LGTM!The streaming API design is clean and the implementation correctly filters and validates JSDoc comments before yielding owned strings.
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (2)
510-520: LGTM!The
are_names_subsetimplementation correctly leverageszipto compare parameter names up to the shorter list's length, which aligns with the documented behaviour.
167-180: LGTM!The integration of
try_merge_overloadswith the new options significantly simplifies the main loop logic whilst maintaining clarity.crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.json (1)
1-15: LGTM!Configuration file correctly enables the
ignoreDifferentJsdocoption for testing purposes.crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json (1)
1-15: LGTM!Configuration file correctly enables the
ignoreDifferentJsdocoption for testing invalid cases.crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.json (1)
1-15: LGTM!Configuration file correctly enables the
ignoreDifferentlyNamedParametersoption for testing purposes..changeset/rare-maps-read.md (1)
1-58: LGTM!The changeset clearly documents the new options with excellent examples. The sentence structure at line 8 is correct despite the static analysis hint suggesting a missing comma.
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/valid.ts (1)
151-153: LGTM!The new test case correctly exercises the scenario where overloads with different type parameters in destructuring patterns should not be merged.
crates/biome_rule_options/src/use_unified_type_signatures.rs (1)
5-18: LGTM!The options struct correctly follows all coding guidelines with proper serde attributes,
Option<bool>wrapping, and required trait implementations. The addition ofCopyis harmless for this small config struct.Based on learnings, this follows the standard pattern for rule options in the Biome codebase.
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalid.ts (1)
166-175: New destructuring fixtures look spot onThe
tuple, destructuredf, andfizzbuzzoverloads are all syntactically fine and nicely exercise tuple and object destructuring with different element/property types. Good additions for catching edge cases in the merger logic.crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts (1)
3-23: Good coverage for differently named parametersThese fixtures nicely cover the “only the parameter names differ” scenarios across plain functions, async exports, interfaces, classes, and
declarefunctions. Nothing here should upset the parser, and they’re a solid match for exercisingignoreDifferentlyNamedParameters.crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.ts (1)
31-39: Remove this comment—the syntax is intentionally invalidThis file is a test specification for the
useUnifiedTypeSignatureslinting rule. The code at lines 31–39 deliberately contains invalid TypeScript syntax (functionkeywords inside a class body) because test specs contain code examples designed to be analyzed by the linter, not to compile. "Fixing" the syntax would break the test data and undermine the test's purpose.Likely an incorrect or invalid review comment.
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
Outdated
Show resolved
Hide resolved
CodSpeed Performance ReportMerging #8368 will not alter performanceComparing Summary
Footnotes
|
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: 0
🧹 Nitpick comments (2)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (2)
408-411:are_names_subsetsemantics are fine, but the description is slightly stronger than the implementationThe implementation:
fn are_names_subset(&self, other: &Self) -> bool { self.iter() .zip(other.iter()) .all(|(self_param, other_param)| { ... self_param.is_name_equal(&other_param) }) }effectively says “the two parameter lists have matching names for their shared prefix”; extra parameters on either side are ignored. That works for gating
ignore_differently_named_parameters, but “subset” in the doc comment might be read as something more general than “prefix equality overzip”.If you meant only this prefix behaviour, you could rephrase the comment to avoid over‑promising (e.g. “Checks that all corresponding parameters up to the shorter list’s length have matching names”).
Also applies to: 511-521
973-994: Name‑extraction helper is useful but could be sharedThe new
ParameterExt::get_name_tokenand its TODO about duplication make sense; once this rule has settled, it would be worthwhile hoisting this helper into a central parameter/AST utility so other rules can reuse it instead of rolling their own.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.ts.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (5)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs(11 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.ts(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.json(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts.snap.new(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use thedbg!()macro for debugging output during testing, and pass the--show-outputflag tocargoto view debug output
Usecargo torcargo testto run tests; for a single test, pass the test name after thetestcommand
Use snapshot testing with theinstacrate; runcargo insta accept,cargo insta reject, orcargo insta reviewto manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Usejust f(alias forjust format) to format Rust and TOML files before committing
Files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
**/*.ts
📄 CodeRabbit inference engine (CONTRIBUTING.md)
For Node.js package development, build WebAssembly bindings and JSON-RPC bindings; run tests against compiled files after implementing features or bug fixes
Files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts
🧠 Learnings (32)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.jsonc : Use `.jsonc` files in test specs with code snippets as array of strings to test rules in script environment (no import/export syntax)
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts.snap.new
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 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/style/useUnifiedTypeSignatures/invalidParams.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.{js,ts,tsx,jsx,json,css} : Test rules using snapshot tests via the `insta` library with test cases in `tests/specs/<group>/<rule_name>/` directories prefixed by `invalid` or `valid`
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts.snap.newcrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, then `expect_diagnostic`, then options modifiers, then `ignore`, then `file=path`
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.jsoncrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts.snap.newcrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noInvalid` prefix for rules that report runtime errors from mistyping (e.g., `noInvalidConstructorSuper`)
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnknown` prefix for rules that report mistyped entities in CSS (e.g., `noUnknownUnit`)
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.jsoncrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options must be defined in the `biome_rule_options` crate and implement traits: `Deserializable`, `Merge`, `Serialize`, `Deserialize`, and `JsonSchema`
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Biome linter is designed to work across languages, so rule naming should be generic if potentially implementable for multiple languages, or specific if meant for one language only
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.json
📚 Learning: 2025-09-25T12:32:59.003Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Implement the `Merge` trait for rule options to define how options from extended configuration merge with user configuration (usually reset instead of extend)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `declare_node_union!` macro to query multiple node types at once by joining them into an enum with `Any*Like` naming convention
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Wrap optional rule option fields in `Option<_>` to properly track set vs unset options during configuration merging
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeData::Unknown` to indicate when type inference falls short or is not implemented
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` variants (`Qualifier`, `Resolved`, `Import`, `Unknown`) to represent different phases of type resolution
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/js_module_info/collector.rs : Implement module-level (thin) inference to resolve `TypeReference::Qualifier` variants by looking up declarations in module scopes and handling import statements
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useConsistent` prefix for rules that ensure consistency across the codebase (e.g., `useConsistentArrayType`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useValid` prefix for rules that report code that always evaluates to a constant (e.g., `useValidTypeof`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noMisleading` prefix for rules that report valid but potentially misleading code (e.g., `noMisleadingCharacterClass`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Document rules with a one-line brief description in the first paragraph of the doc comment, followed by detailed paragraphs, `## Examples` section with `### Invalid` and `### Valid` subsections, and optional `## Options` section
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ConditionalParsedSyntax` for syntax that is only valid in specific contexts (e.g., strict mode, file types, language versions) and call `or_invalid_to_bogus()` to convert to a bogus node if not supported
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/*.ungram : Nodes for enclosing syntax errors must have the `Bogus` word, e.g., `HtmlBogusAttribute`, and must be part of a variant
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Define `FormatHtmlSyntaxNode` struct in a `cst.rs` file implementing `FormatRule<HtmlSyntaxNode>`, `AsFormat<HtmlFormatContext>`, and `IntoFormat<HtmlFormatContext>` traits using the provided boilerplate code
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/comments.rs : Define `<Language>CommentStyle` as a public type alias for `Comments<<Language>Language>` in a `comments.rs` file
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (1)
crates/biome_jsdoc_comment/src/jsdoc_comment.rs (1)
get_jsdocs(75-89)
⏰ 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). (10)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Documentation
- GitHub Check: End-to-end tests
- GitHub Check: Check Dependencies
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: autofix
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
🔇 Additional comments (7)
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.options.json (1)
1-15: Options fixture looks correctSchema path and the
linter.rules.style.useUnifiedTypeSignatures.options.ignoreDifferentlyNamedParameterssetting match the rule docs and the new option name.crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts.snap.new (1)
1-26: Snapshot structure and content look consistentHeader,
# Input, and embedded TypeScript all follow the usual insta snapshot pattern and align with the invalid parameters test fixture.crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts (1)
1-18: Good coverage of parameter‑name edge casesThese overloads neatly exercise destructuring, array patterns, and differing identifier names for the new option; nothing to fix here.
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (4)
44-73: Rule docs and examples look consistent with new behaviourThe added invalid/valid examples and the
## Optionssection forignoreDifferentlyNamedParametersandignoreDifferentJsDocare clear and follow the Biome lint‑docs format (language tags,expect_diagnostic,use_options,json,optionsetc.).
162-183: Refactor intotry_merge_overloadskeeps the core merge logic coherentPulling the pairwise merge checks (type parameters, return type, options, then
try_mergein both directions) intotry_merge_overloadsmakes the mainrunloop much easier to read, and the early returns for non‑mergeable pairs are straightforward.Also applies to: 282-340
304-313:ignore_different_jsdocbehavior may not match documented intent – verify with JSDoc iterator comparisonThe current implementation treats "one overload has JSDoc, the other doesn't" as different JSDoc states and skips merging, but the documented behavior states only overloads with different JSDoc comments should be ignored, allowing undocumented signatures to merge with documented ones.
The condition
docs1.ne(docs2)will returntruewhen iterators have unequal lengths (empty vs. non-empty), causing the early return. To match the documented intent, the check should only skip merging when both sides have JSDoc and their contents differ—for example, by checking!docs1.is_empty() && !docs2.is_empty() && docs1 != docs2.Verify this behavior against your documentation and intended behavior before deciding whether to update the code or clarify the documentation.
582-639: Parameters without identifier bindings are treated as "differently named" – likely conflicts with your tests/comments
AnyParameter::is_name_equalcurrently returnsfalsewhenget_name_token()yieldsNonefor either parameter. This means destructured parameters (object/array patterns) and other non-identifier bindings are treated as mismatched names, causingtry_merge_overloadsto skip overload pairs containing such parameters.This conflicts with the test file comments stating that destructuring "doesn't count" and array spread parameters shouldn't trigger differently-named behavior.
Consider revising
AnyParameter::is_name_equalto returntruewhen either side has no simple name binding:impl NameEquals for AnyParameter { fn is_name_equal(&self, other: &Self) -> bool { match (self.get_name_token(), other.get_name_token()) { (Some(self_name), Some(other_name)) => { self_name.text_trimmed() == other_name.text_trimmed() } _ => true, } } }This keeps the check focused on explicit identifier name differences, allowing destructuring and "nameless" patterns to pass through without triggering the ignore logic.
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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.ts.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (7)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs(8 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.json(1 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts(1 hunks)crates/biome_js_syntax/src/parameter_ext.rs(2 hunks)crates/biome_rule_options/src/use_unified_type_signatures.rs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.json
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use thedbg!()macro for debugging output during testing, and pass the--show-outputflag tocargoto view debug output
Usecargo torcargo testto run tests; for a single test, pass the test name after thetestcommand
Use snapshot testing with theinstacrate; runcargo insta accept,cargo insta reject, orcargo insta reviewto manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Usejust f(alias forjust format) to format Rust and TOML files before committing
Files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
**/*.ts
📄 CodeRabbit inference engine (CONTRIBUTING.md)
For Node.js package development, build WebAssembly bindings and JSON-RPC bindings; run tests against compiled files after implementing features or bug fixes
Files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.tscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts
🧠 Learnings (36)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Implement the `Merge` trait for rule options to define how options from extended configuration merge with user configuration (usually reset instead of extend)
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Implement a token source struct that wraps the lexer and implements `TokenSourceWithBufferedLexer` and `LexerWithCheckpoint` for lookahead and re-lexing capabilities
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` variants (`Qualifier`, `Resolved`, `Import`, `Unknown`) to represent different phases of type resolution
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeData::Unknown` to indicate when type inference falls short or is not implemented
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `declare_node_union!` macro to query multiple node types at once by joining them into an enum with `Any*Like` naming convention
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, then `expect_diagnostic`, then options modifiers, then `ignore`, then `file=path`
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/flattening.rs : Implement type flattening to simplify `TypeofExpression` variants once all component types are resolved
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Implement the `Merge` trait for rule options to define how options from extended configuration merge with user configuration (usually reset instead of extend)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Wrap optional rule option fields in `Option<_>` to properly track set vs unset options during configuration merging
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useConsistent` prefix for rules that ensure consistency across the codebase (e.g., `useConsistentArrayType`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useValid` prefix for rules that report code that always evaluates to a constant (e.g., `useValidTypeof`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noMisleading` prefix for rules that report valid but potentially misleading code (e.g., `noMisleadingCharacterClass`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Document rules with a one-line brief description in the first paragraph of the doc comment, followed by detailed paragraphs, `## Examples` section with `### Invalid` and `### Valid` subsections, and optional `## Options` section
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnknown` prefix for rules that report mistyped entities in CSS (e.g., `noUnknownUnit`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ConditionalParsedSyntax` for syntax that is only valid in specific contexts (e.g., strict mode, file types, language versions) and call `or_invalid_to_bogus()` to convert to a bogus node if not supported
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/comments.rs : Define `<Language>CommentStyle` as a public type alias for `Comments<<Language>Language>` in a `comments.rs` file
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/*.ungram : Nodes for enclosing syntax errors must have the `Bogus` word, e.g., `HtmlBogusAttribute`, and must be part of a variant
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Define `FormatHtmlSyntaxNode` struct in a `cst.rs` file implementing `FormatRule<HtmlSyntaxNode>`, `AsFormat<HtmlFormatContext>`, and `IntoFormat<HtmlFormatContext>` traits using the provided boilerplate code
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options struct fields should use `#[serde(rename_all = "camelCase")]`, `#[serde(deny_unknown_fields)]`, and `#[serde(default)]` attributes for proper JSON serialization
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options must be defined in the `biome_rule_options` crate and implement traits: `Deserializable`, `Merge`, `Serialize`, `Deserialize`, and `JsonSchema`
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options array fields to save memory (boxed slices and boxed str use 2 words instead of three words)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.{js,ts,tsx,jsx,json,css} : Test rules using snapshot tests via the `insta` library with test cases in `tests/specs/<group>/<rule_name>/` directories prefixed by `invalid` or `valid`
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.tscrates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.jsonc : Use `.jsonc` files in test specs with code snippets as array of strings to test rules in script environment (no import/export syntax)
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 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/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : In rule documentation code blocks, mark invalid examples with the `expect_diagnostic` property and valid examples without it; each invalid example must emit exactly one diagnostic
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Biome linter is designed to work across languages, so rule naming should be generic if potentially implementable for multiple languages, or specific if meant for one language only
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
📚 Learning: 2025-09-25T12:32:59.003Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.
Applied to files:
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
🧬 Code graph analysis (1)
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts (1)
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts (1)
f2(9-9)
⏰ 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). (10)
- GitHub Check: Documentation
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: End-to-end tests
- GitHub Check: Check Dependencies
- GitHub Check: Validate rules documentation
- GitHub Check: autofix
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_parser)
🔇 Additional comments (7)
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json (1)
1-15: Config wiring for Jsdoc option looks soundSchema path, rule hierarchy, and the
ignoreDifferentJsDocoption all look consistent and correctly targeted atstyle.useUnifiedTypeSignatures. Nothing blocking here.crates/biome_rule_options/src/use_unified_type_signatures.rs (1)
5-18: Options struct matches Biome rule‑options conventionsNice: the options now live on
UseUnifiedTypeSignaturesOptionswithOption<bool>fields,camelCaseserde,deny_unknown_fields,default, and derivedMerge/JsonSchemasupport. AddingCopyis safe here and keeps usage lightweight. Looks ready to hook straight into config and merging.crates/biome_js_syntax/src/parameter_ext.rs (1)
473-482: Newname_tokenaccessor is sound and fits the intended useThe binding → identifier →
name_token()chain is robust and naturally returnsNonefor non‑identifier patterns (destructuring,this, etc.), which is exactly what the caller wants when treating “no name” as a wildcard. No correctness issues spotted here.crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (2)
44-145: Rule documentation and options section look consistent and idiomaticThe added invalid/valid examples plus the
## Optionssection (withtsandjson,options/ts,use_optionstags) line up well with the new behaviour and follow the biome_analyze doc conventions. Option names in docs match the snake‑case fields used in codegen (ignoreDifferentlyNamedParameters,ignoreDifferentJsDoc).
167-176: Fix JSDoc ignore condition to match documented behaviorThe extraction into
try_merge_overloadswithsame_param_names/NameEqualshelpers improves code clarity.However, the
ignoreDifferentJsDocoption implementation contradicts its documentation. The docs state:"If set to
true, overloads with different JSDoc comments … will be ignored. Ones without comments will still be checked (and can potentially be merged with documented signatures)."But the current condition treats empty JSDoc lists as different from populated ones, causing pairs where one overload has JSDoc and the other doesn't to be skipped when they should be allowed to merge.
Fix by only skipping when both sides have JSDoc and they differ:
- if opts.ignore_different_js_doc.unwrap_or_default() - && let (docs1, docs2) = ( - JsdocComment::get_jsdocs(&overload1.wrapper_syntax()), - JsdocComment::get_jsdocs(&overload2.wrapper_syntax()), - ) - && docs1.ne(docs2) + if opts.ignore_different_js_doc.unwrap_or_default() + && let (docs1, docs2) = ( + JsdocComment::get_jsdocs(&overload1.wrapper_syntax()), + JsdocComment::get_jsdocs(&overload2.wrapper_syntax()), + ) + && !docs1.is_empty() + && !docs2.is_empty() + && docs1.ne(&docs2)This ensures the pair is only skipped when both overloads have JSDoc comments that actually differ, allowing documented and undocumented signatures to merge as intended.
Also applies to: 282-340, 403-413, 512-527, 588-593, 625-633
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts (1)
1-14: Invalid cases nicely exercise name and destructuring edge‑casesThese overload sets look like the right “should diagnose” inputs for the default rule: differing implementation name, object and tuple destructuring where inner bindings lack parameter names. They line up with the new
same_param_namessemantics and should guard against regressions.crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts (1)
1-27: Valid cases cover the newignoreDifferentlyNamedParametersoption wellThis set does a good job of asserting that, with the option enabled, we no longer flag overloads whose only meaningful distinction is parameter naming (functions, async exports, call signatures, private methods, declares). Looks tidy and representative.
crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
crates/biome_jsdoc_comment/src/jsdoc_comment.rs (1)
67-71: Clarify the deprecation timeline in the TODO.The TODO suggests removing this public API, which would be a breaking change. Consider clarifying whether this is planned for the next major version or simply noting it as potential future cleanup.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lockand included by**
📒 Files selected for processing (3)
crates/biome_jsdoc_comment/Cargo.toml(2 hunks)crates/biome_jsdoc_comment/src/jsdoc_comment.rs(4 hunks)crates/biome_rowan/src/tree_builder.rs(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- crates/biome_rowan/src/tree_builder.rs
🧰 Additional context used
📓 Path-based instructions (2)
**/*.toml
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use
just f(alias forjust format) to format TOML files before committing
Files:
crates/biome_jsdoc_comment/Cargo.toml
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use thedbg!()macro for debugging output during testing, and pass the--show-outputflag tocargoto view debug output
Usecargo torcargo testto run tests; for a single test, pass the test name after thetestcommand
Use snapshot testing with theinstacrate; runcargo insta accept,cargo insta reject, orcargo insta reviewto manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Usejust f(alias forjust format) to format Rust and TOML files before committing
Files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
🧠 Learnings (34)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to Cargo.toml : Use workspace dependencies in the root Cargo.toml; internal crates should use `workspace = true` for dependencies and path dependencies for dev-dependencies
Applied to files:
crates/biome_jsdoc_comment/Cargo.toml
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace*.rs : Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances
Applied to files:
crates/biome_jsdoc_comment/Cargo.toml
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/Cargo.toml : Include development dependencies in `Cargo.toml` for formatter tests: `biome_formatter_test`, `biome_<language>_factory`, `biome_<language>_parser`, `biome_parser`, `biome_service`, `countme`, `iai`, `quickcheck`, `quickcheck_macros`, and `tests_macros`
Applied to files:
crates/biome_jsdoc_comment/Cargo.toml
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Create two new crates `biome_{language}_syntax` and `biome_{language}_factory` using `cargo new --lib` for new language parsers
Applied to files:
crates/biome_jsdoc_comment/Cargo.toml
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Implement watcher tests for workspace methods in watcher.tests.rs and end-to-end tests in LSP tests
Applied to files:
crates/biome_jsdoc_comment/Cargo.tomlcrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new language prefix to the `LANGUAGE_PREFIXES` constant in `language_kind.rs` file
Applied to files:
crates/biome_jsdoc_comment/Cargo.toml
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Commit rule changes with message format: `feat(biome_<crate>): <ruleName>` to follow Biome's conventional commit style
Applied to files:
crates/biome_jsdoc_comment/Cargo.toml
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/*.ungram : Add a legend comment to `.ungram` files explaining the grammar syntax including comments, non-terminals, tokens, sequences, alternations, repetitions, and optional elements
Applied to files:
crates/biome_jsdoc_comment/Cargo.toml
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to **/*.tsx : For Node.js package development, build WebAssembly bindings and JSON-RPC bindings; run tests against compiled files after implementing features or bug fixes
Applied to files:
crates/biome_jsdoc_comment/Cargo.tomlcrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter
Applied to files:
crates/biome_jsdoc_comment/Cargo.tomlcrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Use the `just gen-formatter` command to generate initial formatter implementations from the grammar, which will use `format_verbatim_node` that must be replaced with proper `biome_formatter` utilities
Applied to files:
crates/biome_jsdoc_comment/Cargo.toml
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding
Applied to files:
crates/biome_jsdoc_comment/Cargo.tomlcrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)
Applied to files:
crates/biome_jsdoc_comment/Cargo.tomlcrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Create a new formatter crate using the command `just new-crate biome_<language>_formatter` where `<language>` is the target language (e.g., `biome_html_formatter` for HTML)
Applied to files:
crates/biome_jsdoc_comment/Cargo.toml
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Use the `dbg_write!` macro to debug formatter output instead of other logging methods
Applied to files:
crates/biome_jsdoc_comment/Cargo.toml
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead
Applied to files:
crates/biome_jsdoc_comment/Cargo.tomlcrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Document rules with a one-line brief description in the first paragraph of the doc comment, followed by detailed paragraphs, `## Examples` section with `### Invalid` and `### Valid` subsections, and optional `## Options` section
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to **/*.ts : For Node.js package development, build WebAssembly bindings and JSON-RPC bindings; run tests against compiled files after implementing features or bug fixes
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` variants (`Qualifier`, `Resolved`, `Import`, `Unknown`) to represent different phases of type resolution
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeData::Unknown` to indicate when type inference falls short or is not implemented
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/local_inference.rs : Implement local inference in dedicated modules to derive type definitions from expressions without context of surrounding scopes
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ConditionalParsedSyntax` for syntax that is only valid in specific contexts (e.g., strict mode, file types, language versions) and call `or_invalid_to_bogus()` to convert to a bogus node if not supported
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/comments.rs : Define `<Language>CommentStyle` as a public type alias for `Comments<<Language>Language>` in a `comments.rs` file
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/language.rs : Implement `TestFormatLanguage` trait in `tests/language.rs` for the formatter's test language
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : A parser struct must implement the `Parser` trait and save the token source, parser context, and optional parser options
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Use quick testing via `tests/quick_test.rs` by removing the `#[ignore]` macro and modifying the `SOURCE` variable to rapidly validate rule behavior during development
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/lexer/mod.rs : Implement a `Lexer` trait from `biome_parser` crate for the lexer struct that consumes characters from source code and emits tokens
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ParseSeparatedList` and `ParseNodeList` for parsing lists with error recovery to avoid infinite loops
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Parse rules must take a mutable reference to the parser as their only parameter and return a `ParsedSyntax`
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Parse rule functions must be prefixed with `parse_` and use the name defined in the grammar file, e.g., `parse_for_statement` or `parse_expression`
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
🧬 Code graph analysis (1)
crates/biome_jsdoc_comment/src/jsdoc_comment.rs (1)
crates/biome_js_syntax/src/file_source.rs (1)
tsx(188-190)
⏰ 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). (21)
- GitHub Check: Documentation
- GitHub Check: Bench (biome_tailwind_parser)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: End-to-end tests
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: autofix
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
🔇 Additional comments (1)
crates/biome_jsdoc_comment/src/jsdoc_comment.rs (1)
73-89: LGTM - well-structured iterator API.The new public API correctly extracts JSDoc comments from leading trivia. Returning owned
Stringvalues is a reasonable tradeoff for a 'static iterator, though it does require allocation.
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: 0
🧹 Nitpick comments (1)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (1)
588-589: Reasonable TODO.Consolidating name equality logic across the codebase would be beneficial. This is acceptable technical debt to address in a future refactor.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (5)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs(8 hunks)crates/biome_js_syntax/src/parameter_ext.rs(2 hunks)crates/biome_jsdoc_comment/Cargo.toml(1 hunks)crates/biome_jsdoc_comment/src/jsdoc_comment.rs(5 hunks)crates/biome_rule_options/src/use_unified_type_signatures.rs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_jsdoc_comment/Cargo.toml
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use thedbg!()macro for debugging output during testing, and pass the--show-outputflag tocargoto view debug output
Usecargo torcargo testto run tests; for a single test, pass the test name after thetestcommand
Use snapshot testing with theinstacrate; runcargo insta accept,cargo insta reject, orcargo insta reviewto manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Usejust f(alias forjust format) to format Rust and TOML files before committing
Files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_jsdoc_comment/src/jsdoc_comment.rs
🧠 Learnings (35)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options struct fields should use `#[serde(rename_all = "camelCase")]`, `#[serde(deny_unknown_fields)]`, and `#[serde(default)]` attributes for proper JSON serialization
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Wrap optional rule option fields in `Option<_>` to properly track set vs unset options during configuration merging
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options must be defined in the `biome_rule_options` crate and implement traits: `Deserializable`, `Merge`, `Serialize`, `Deserialize`, and `JsonSchema`
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Implement the `Merge` trait for rule options to define how options from extended configuration merge with user configuration (usually reset instead of extend)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options array fields to save memory (boxed slices and boxed str use 2 words instead of three words)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeData::Unknown` to indicate when type inference falls short or is not implemented
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useConsistent` prefix for rules that ensure consistency across the codebase (e.g., `useConsistentArrayType`)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rscrates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Implement a token source struct that wraps the lexer and implements `TokenSourceWithBufferedLexer` and `LexerWithCheckpoint` for lookahead and re-lexing capabilities
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` variants (`Qualifier`, `Resolved`, `Import`, `Unknown`) to represent different phases of type resolution
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `declare_node_union!` macro to query multiple node types at once by joining them into an enum with `Any*Like` naming convention
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, then `expect_diagnostic`, then options modifiers, then `ignore`, then `file=path`
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rscrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/flattening.rs : Implement type flattening to simplify `TypeofExpression` variants once all component types are resolved
Applied to files:
crates/biome_js_syntax/src/parameter_ext.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUndeclared` prefix for rules that report undefined entities (e.g., `noUndeclaredVariables`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useValid` prefix for rules that report code that always evaluates to a constant (e.g., `useValidTypeof`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noMisleading` prefix for rules that report valid but potentially misleading code (e.g., `noMisleadingCharacterClass`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Document rules with a one-line brief description in the first paragraph of the doc comment, followed by detailed paragraphs, `## Examples` section with `### Invalid` and `### Valid` subsections, and optional `## Options` section
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnknown` prefix for rules that report mistyped entities in CSS (e.g., `noUnknownUnit`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/comments.rs : Define `<Language>CommentStyle` as a public type alias for `Comments<<Language>Language>` in a `comments.rs` file
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to **/*.tsx : For Node.js package development, build WebAssembly bindings and JSON-RPC bindings; run tests against compiled files after implementing features or bug fixes
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to **/*.ts : For Node.js package development, build WebAssembly bindings and JSON-RPC bindings; run tests against compiled files after implementing features or bug fixes
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.jsonc : Use `.jsonc` files in test specs with code snippets as array of strings to test rules in script environment (no import/export syntax)
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Implement watcher tests for workspace methods in watcher.tests.rs and end-to-end tests in LSP tests
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/language.rs : Implement `TestFormatLanguage` trait in `tests/language.rs` for the formatter's test language
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : A parser struct must implement the `Parser` trait and save the token source, parser context, and optional parser options
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to **/*.rs : Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`
Applied to files:
crates/biome_jsdoc_comment/src/jsdoc_comment.rs
🧬 Code graph analysis (2)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (1)
crates/biome_jsdoc_comment/src/jsdoc_comment.rs (1)
get_jsdocs(78-92)
crates/biome_jsdoc_comment/src/jsdoc_comment.rs (1)
crates/biome_js_syntax/src/file_source.rs (1)
tsx(188-190)
🔇 Additional comments (15)
crates/biome_js_syntax/src/parameter_ext.rs (2)
4-4: LGTM!The
JsSyntaxTokenimport is necessary for the newname_token()method's return type.
473-481: Clean accessor implementation.The method appropriately chains through the binding pattern to extract identifier names. The TODO comment is a reasonable marker for future consolidation.
crates/biome_jsdoc_comment/src/jsdoc_comment.rs (4)
3-3: LGTM!The
Derefimport is needed for the existingDerefimplementation on line 101.
67-74: Nice refactor—delegation eliminates duplication.Delegating to
get_jsdocskeeps the logic centralised.
76-92: Clean iterator API.The implementation correctly filters and validates JSDoc comments from leading trivia. Returning owned
Strings is appropriate for the iterator pattern.
163-234: Excellent test coverage.The tests thoroughly validate multiple scenarios: single/multiple JSDoc blocks, multiline comments, mixed comment types, and empty cases. Addresses previous review feedback nicely.
crates/biome_rule_options/src/use_unified_type_signatures.rs (2)
4-6: LGTM—derives are correct.Adding
Copyis valid sinceOption<bool>isCopy. The derive order is sensible.
9-17: Well-structured option fields.Both fields follow the established pattern: wrapped in
Option<_>for proper tracking, documented, and configured with appropriate serde attributes.crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (7)
20-20: LGTM!The
JsdocCommentimport is required for JSDoc comparison in the new merge logic.
44-61: Clear examples.The additional examples effectively demonstrate destructured parameters and call signatures.
102-145: Comprehensive option documentation.The documentation for both options is clear and includes well-chosen examples. The format follows the established guidelines.
167-179: Good refactoring.Extracting the options and delegating to
try_merge_overloadsimproves readability and maintainability.
282-340: Well-structured merge function.The centralised merge logic is clean and properly gates checks based on options. The bidirectional merge attempt (lines 325-339) correctly handles either overload being the keeper.
One minor observation: The JSDoc comparison on lines 306-310 compares iterators using
ne. This works correctly—empty vs non-empty, different contents, or different counts all result in inequality—but consider whether duplicate JSDoc content should be deduplicated in the output (as noted in the TODO on line 304).
408-412: Clear documentation.The doc comment accurately describes the behaviour, including the early termination at the shorter list.
512-527: Sensible name comparison logic.Treating parameters without name tokens (destructuring, etc.) as matching is pragmatic. The early termination via
zipis intentional and documented.
dyc3
left a comment
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.
Notes mostly on the changeset. Everything else looks good!
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
Outdated
Show resolved
Hide resolved
Co-authored-by: Carson McManus <dyc3@users.noreply.github.com>
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: 0
🧹 Nitpick comments (3)
.changeset/rare-maps-read.md (3)
5-8: Condense the explanatory text for changelog brevity.Lines 7–8 can be tightened to reduce the overall entry size. Consider merging or shortening to fit a typical changelog's space constraints.
Example condensed version:
Added 2 options (`ignoreDifferentlyNamedParameters` and `ignoreDifferentJsDoc`) from `typescript-eslint` to [`useUnifiedTypeSignatures`](https://biomejs.dev/linter/rules/use-unified-type-signatures/), allowing the rule to ignore overloads when parameter names or JSDoc comments differ.
9-40: Simplify the first code example.Per the previous reviewer's feedback, the code example is too verbose for a changelog entry. The enum definition and detailed comments add bulk without being essential to demonstrate the option's effect.
A more concise example:
// These overloads differ only in parameter names— // normally an error, but allowed with ignoreDifferentlyNamedParameters enabled. function cook(type: "filet", numSheep: number): void; function cook(type: "apple", pieType: string): void; function cook(type: string, ...params: unknown): void { // ... }
42-58: Simplify the second code example.This example can also be tightened for the changelog. The @deprecated tag and TODO comment, while useful for real code, are not essential to show the option's effect.
A more concise version:
/** * Generate a battle with the specified starters. */ export async function startBattle(starters: SpeciesId[]): Promise<void>; /** * Generate a battle with 3 random starters. * @deprecated Specify starters explicitly. */ export async function startBattle(): Promise<void>;
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lockand included by**
📒 Files selected for processing (1)
.changeset/rare-maps-read.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/**/*.md: Create changesets for user-facing changes usingjust new-changeset; use headers with####or#####only; keep descriptions concise (1-3 sentences) and focus on user-facing changes
Use past tense when describing what was done ('Added new feature'), present tense when describing Biome behavior ('Biome now supports'); end sentences with a full stop
For new lint rules, show an example of an invalid case in an inline code snippet or code block; for rule changes, demonstrate what is now invalid or valid; for formatter changes, use adiffcode block
Files:
.changeset/rare-maps-read.md
🧠 Learnings (7)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to .changeset/**/*.md : Create changesets for user-facing changes using `just new-changeset`; use headers with `####` or `#####` only; keep descriptions concise (1-3 sentences) and focus on user-facing changes
Applied to files:
.changeset/rare-maps-read.md
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to .changeset/**/*.md : For new lint rules, show an example of an invalid case in an inline code snippet or code block; for rule changes, demonstrate what is now invalid or valid; for formatter changes, use a `diff` code block
Applied to files:
.changeset/rare-maps-read.md
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, then `expect_diagnostic`, then options modifiers, then `ignore`, then `file=path`
Applied to files:
.changeset/rare-maps-read.md
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Applied to files:
.changeset/rare-maps-read.md
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Biome linter is designed to work across languages, so rule naming should be generic if potentially implementable for multiple languages, or specific if meant for one language only
Applied to files:
.changeset/rare-maps-read.md
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useConsistent` prefix for rules that ensure consistency across the codebase (e.g., `useConsistentArrayType`)
Applied to files:
.changeset/rare-maps-read.md
🪛 LanguageTool
.changeset/rare-maps-read.md
[uncategorized] ~8-~8: Possible missing comma found.
Context: ...arameters or different JSDoc comments. Example with ignoreDifferentlyNamedParameters...
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (23)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Documentation
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_tailwind_parser)
- 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: End-to-end tests
- GitHub Check: autofix
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_module_graph)
# Conflicts: # .changeset/rare-maps-read.md
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 (1)
.changeset/rare-maps-read.md (1)
11-19: Consider trimming the code example further for the changelog.The example is still fairly lengthy for a changelog entry. A more concise version might help readers skim release notes faster.
```ts -// These overloads would normally trigger diagnostics despite signifying completely different quantities -// with different parameter names. -// With the option enabled, they will be ignored. -function cook(type: FoodType.BURGER, meat: "beef" | "chicken"): void; -function cook(type: FoodType.CAKE, flavour: string): void; -function cook(type: FoodType.SHRIMP_COCKTAIL, sauces: string[]): void; -function cook(type: FoodType, ...params: unknown[]): void { } +// With the option enabled, these won't trigger diagnostics +function bake(apples: number): void; +function bake(cakeType: string): void;</blockquote></details> </blockquote></details> <details> <summary>🧹 Nitpick comments (1)</summary><blockquote> <details> <summary>crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (1)</summary><blockquote> `586-587`: **Acknowledged TODO for future consolidation.** The comment about consolidating `NameEquals` with `IsNameEqual` from `use_grouped_accessor_pair.rs` is a sensible follow-up. Consider creating an issue to track this if it's not already tracked. Would you like me to help draft an issue for this refactor? </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used**: Path: .coderabbit.yaml **Review profile**: CHILL **Plan**: Pro <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 2b85df0f27d1cd5d6b3f6d50297ca2a647fd0b48 and cfbe080888604d3b6f0e66e3e8a69b69d4183433. </details> <details> <summary>📒 Files selected for processing (3)</summary> * `.changeset/rare-maps-read.md` (1 hunks) * `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` (8 hunks) * `crates/biome_rule_options/src/use_unified_type_signatures.rs` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>📓 Path-based instructions (2)</summary> <details> <summary>**/*.rs</summary> **📄 CodeRabbit inference engine (CONTRIBUTING.md)** > `**/*.rs`: Use the `dbg!()` macro for debugging output during testing, and pass the `--show-output` flag to `cargo` to view debug output > Use `cargo t` or `cargo test` to run tests; for a single test, pass the test name after the `test` command > Use snapshot testing with the `insta` crate; run `cargo insta accept`, `cargo insta reject`, or `cargo insta review` to manage snapshot changes > Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase > Use `just f` (alias for `just format`) to format Rust and TOML files before committing Files: - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` - `crates/biome_rule_options/src/use_unified_type_signatures.rs` </details> <details> <summary>.changeset/**/*.md</summary> **📄 CodeRabbit inference engine (CONTRIBUTING.md)** > `.changeset/**/*.md`: Create changesets for user-facing changes using `just new-changeset`; use headers with `####` or `#####` only; keep descriptions concise (1-3 sentences) and focus on user-facing changes > Use past tense when describing what was done ('Added new feature'), present tense when describing Biome behavior ('Biome now supports'); end sentences with a full stop > For new lint rules, show an example of an invalid case in an inline code snippet or code block; for rule changes, demonstrate what is now invalid or valid; for formatter changes, use a `diff` code block Files: - `.changeset/rare-maps-read.md` </details> </details><details> <summary>🧠 Learnings (25)</summary> <details> <summary>📓 Common learnings</summary>Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g.,type Options = RuleNameOptions) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.</details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//biome_rule_options/src//*.rs : Implement theMergetrait for rule options to define how options from extended configuration merge with user configuration (usually reset instead of extend)**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` - `crates/biome_rule_options/src/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//*analyze/src/lint//*.rs : Use thedeclare_node_union!macro to query multiple node types at once by joining them into an enum withAny*Likenaming convention**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//*analyze/src/lint//*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, thenexpect_diagnostic, then options modifiers, thenignore, thenfile=path**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` - `.changeset/rare-maps-read.md` </details> <details> <summary>📚 Learning: 2025-11-24T18:05:42.356Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish betweenTypeData::UnknownandTypeData::UnknownKeywordto measure inference effectiveness versus explicit user-provided unknown types**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` - `crates/biome_rule_options/src/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-24T18:05:42.356Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : UseTypeData::Unknownto indicate when type inference falls short or is not implemented**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` - `crates/biome_rule_options/src/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-24T18:05:42.356Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : UseTypeReferenceinstead ofArcfor types that reference other types to avoid stale cache issues when modules are replaced**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` - `crates/biome_rule_options/src/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//*analyze/src/lint//*.rs : Use theuseConsistentprefix for rules that ensure consistency across the codebase (e.g.,useConsistentArrayType)**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` - `crates/biome_rule_options/src/use_unified_type_signatures.rs` - `.changeset/rare-maps-read.md` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//biome_rule_options/src//*.rs : Wrap optional rule option fields inOption<_>to properly track set vs unset options during configuration merging**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` - `crates/biome_rule_options/src/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-24T18:05:42.356Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : UseTypeReferencevariants (Qualifier,Resolved,Import,Unknown) to represent different phases of type resolution**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` - `crates/biome_rule_options/src/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-24T18:05:42.356Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/js_module_info/collector.rs : Implement module-level (thin) inference to resolveTypeReference::Qualifiervariants by looking up declarations in module scopes and handling import statements**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//*analyze/src/lint//*.rs : Use theuseValidprefix for rules that report code that always evaluates to a constant (e.g.,useValidTypeof)**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//*analyze/src/lint//*.rs : Use thenoMisleadingprefix for rules that report valid but potentially misleading code (e.g.,noMisleadingCharacterClass)**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//*analyze/src/lint//*.rs : Document rules with a one-line brief description in the first paragraph of the doc comment, followed by detailed paragraphs,## Examplessection with### Invalidand### Validsubsections, and optional## Optionssection**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//*analyze/src/lint//*.rs : Use thenoUnknownprefix for rules that report mistyped entities in CSS (e.g.,noUnknownUnit)**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-24T18:05:27.810Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import theFormatNodetrait and implement it for your Node when creating formatters in biome_js_formatter**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-24T18:05:20.371Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/comments.rs : Define<Language>CommentStyleas a public type alias forComments<<Language>Language>in acomments.rsfile**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-24T18:05:27.810Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., usenode.l_paren_token().format()instead oftoken("("))**Applied to files:** - `crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//biome_rule_options/src//*.rs : Rule options struct fields should use#[serde(rename_all = "camelCase")],#[serde(deny_unknown_fields)], and#[serde(default)]attributes for proper JSON serialization**Applied to files:** - `crates/biome_rule_options/src/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//biome_rule_options/src//*.rs : Rule options must be defined in thebiome_rule_optionscrate and implement traits:Deserializable,Merge,Serialize,Deserialize, andJsonSchema**Applied to files:** - `crates/biome_rule_options/src/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//biome_rule_options/src//*.rs : UseBox<[T]>instead ofVec<T>for rule options array fields to save memory (boxed slices and boxed str use 2 words instead of three words)**Applied to files:** - `crates/biome_rule_options/src/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-21T01:10:53.059Z</summary>Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g.,type Options = RuleNameOptions) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.**Applied to files:** - `crates/biome_rule_options/src/use_unified_type_signatures.rs` - `.changeset/rare-maps-read.md` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze//*analyze/src/lint//*.rs : Use thenoUndeclaredprefix for rules that report undefined entities (e.g.,noUndeclaredVariables)**Applied to files:** - `crates/biome_rule_options/src/use_unified_type_signatures.rs` </details> <details> <summary>📚 Learning: 2025-11-28T09:08:10.091Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to .changeset/**/*.md : For new lint rules, show an example of an invalid case in an inline code snippet or code block; for rule changes, demonstrate what is now invalid or valid; for formatter changes, use adiffcode block**Applied to files:** - `.changeset/rare-maps-read.md` </details> <details> <summary>📚 Learning: 2025-11-27T23:04:02.022Z</summary>Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Biome linter is designed to work across languages, so rule naming should be generic if potentially implementable for multiple languages, or specific if meant for one language only**Applied to files:** - `.changeset/rare-maps-read.md` </details> </details><details> <summary>🧬 Code graph analysis (1)</summary> <details> <summary>crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (1)</summary><blockquote> <details> <summary>crates/biome_jsdoc_comment/src/jsdoc_comment.rs (1)</summary> * `get_jsdocs` (78-92) </details> </blockquote></details> </details><details> <summary>🪛 GitHub Actions: Benchmarks CSS</summary> <details> <summary>crates/biome_rule_options/src/use_unified_type_signatures.rs</summary> [error] 21-21: Mismatched types: function returns bool but expression yields Option<bool>. Wrap with Some(false) to match the return type. --- [error] 21-21: E0308: expected `bool` from `Option<bool>`; the return path uses `or_else` returning `bool` instead of `Option<bool>`. --- [error] 24-24: Mismatched types: function returns bool but expression yields Option<bool>. Wrap with Some(false) to match the return type. --- [error] 24-24: E0308: expected `bool` from `Option<bool>`; the return path uses `or_else` returning `bool` instead of `Option<bool>`. </details> </details> <details> <summary>🪛 GitHub Actions: Benchmarks GraphQL</summary> <details> <summary>crates/biome_rule_options/src/use_unified_type_signatures.rs</summary> [error] 21-21: mismatched types: expected `Option<bool>` but found `bool` in `ignore_differently_named_parameters()` return statement. Wrap the boolean in `Some(false)` or adjust return type. --- [error] 24-24: mismatched types: expected `Option<bool>` but found `bool` in `ignore_different_js_doc()` return statement. Wrap the boolean in `Some(false)` or adjust return type. </details> </details> <details> <summary>🪛 GitHub Actions: Benchmarks JSON</summary> <details> <summary>crates/biome_rule_options/src/use_unified_type_signatures.rs</summary> [error] 20-20: E0308: mismatched types. Function 'ignore_differently_named_parameters' returns bool but the expression 'self.ignore_differently_named_parameters.or_else(|| false)' yields Option<bool>. Consider returning a bool by unwrapping or defaulting with 'unwrap_or(false)'. Command 'cargo codspeed build -p biome_json_analyze' failed. --- [error] 21-21: E0308: mismatched types. The expression 'self.ignore_differently_named_parameters.or_else(|| false)' is an Option<bool> but the function expects a bool return. Wrap with 'Some(false)' or adjust logic. Command 'cargo codspeed build -p biome_json_analyze' failed. --- [error] 24-24: E0308: mismatched types. Function 'ignore_different_js_doc' returns bool but the expression 'self.ignore_different_js_doc.or_else(|| false)' yields Option<bool>. Consider using 'unwrap_or(false)' or 'Some(false)' depending on context. Command 'cargo codspeed build -p biome_json_analyze' failed. --- [error] 24-24: E0308: mismatched types. The return type is bool but the expression provides an Option<bool>. Consider unwrapping or defaulting. Command 'cargo codspeed build -p biome_json_analyze' failed. </details> </details> <details> <summary>🪛 GitHub Actions: Benchmarks Module Graph</summary> <details> <summary>crates/biome_rule_options/src/use_unified_type_signatures.rs</summary> [error] 21-21: mismatched types: expected `Option<bool>`, found `bool`. wrap the expression in `Some(false)` to return an `Option<bool>` --- [error] 21-21: mismatched types: expected `bool` return type, found `Option<bool>`. consider unwrapping or adjusting return type --- [error] 24-24: mismatched types: expected `Option<bool>`, found `bool`. wrap the expression in `Some(false)` to return an `Option<bool>` --- [error] 24-24: mismatched types: expected `bool` return type, found `Option<bool>`. consider unwrapping or adjusting return type </details> </details> <details> <summary>🪛 GitHub Actions: Lint rule docs</summary> <details> <summary>crates/biome_rule_options/src/use_unified_type_signatures.rs</summary> [error] 21-21: mismatched types: expected `Option<bool>`, found `bool` in `ignore_differently_named_parameters` return expression. Consider returning `Some(false)` or adjust the function signature. --- [error] 24-24: mismatched types: expected `Option<bool>`, found `bool` in `ignore_different_js_doc` return expression. Consider returning `Some(false)` or adjust the function signature. </details> </details> <details> <summary>🪛 LanguageTool</summary> <details> <summary>.changeset/rare-maps-read.md</summary> [uncategorized] ~8-~8: Possible missing comma found. Context: ...ameter names or JSDoc comments differ. Example with `ignoreDifferentlyNamedParameters`... (AI_HYDRA_LEO_MISSING_COMMA) </details> </details> </details> <details> <summary>⏰ 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). (5)</summary> * GitHub Check: Bench (biome_configuration) * GitHub Check: Check Dependencies * GitHub Check: Bench (biome_js_analyze) * GitHub Check: Bench (biome_package) * GitHub Check: autofix </details> <details> <summary>🔇 Additional comments (3)</summary><blockquote> <details> <summary>crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (3)</summary><blockquote> `102-144`: **Well-documented options section.** The options documentation is clear and follows the expected format with JSON config examples and TypeScript usage examples. Nice work! --- `280-338`: **Clean extraction of merge logic.** The refactor to pull this into a dedicated function improves readability significantly. The gating logic for the new options is correctly placed before the parameter comparison. --- `509-525`: **LGTM!** The `same_param_names` implementation correctly handles the edge cases: unnamed parameters (destructuring/spread) are treated as matching, and the comparison stops at the shorter list's length as documented. </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
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 (1)
.changeset/rare-maps-read.md (1)
5-25: Tighten wording and trim example noise a bitNice concise entry; just a couple of polish nits:
Line 7: consider present tense and slightly snappier phrasing, e.g.
Each option makes the rule ignore overload signatures whose parameter names or JSDoc comments differ.The comment lines inside the TS examples are arguably redundant for the changelog; you could drop them to keep things lean.
🧹 Nitpick comments (1)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (1)
606-641:NameEqualstrait is a sensible abstraction; consider future consolidationThe
NameEqualstrait plus itsOption<T>impl make the overload collection logic (OverloadInfo::from_overload_signature) much clearer, and the handling of metavariables/private names viatext_trimmed()looks sound.You already have a TODO to consolidate this with
IsNameEqualinuse_grouped_accessor_pair.rs; I’d keep that as a follow-up rather than blocking this PR.When you get to that cleanup, a quick
rg "IsNameEqual"plus audit of call sites should keep the traits aligned.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.changeset/rare-maps-read.md(1 hunks)crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs(8 hunks)crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.ts(1 hunks)crates/biome_rule_options/src/use_unified_type_signatures.rs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.ts
🧰 Additional context used
📓 Path-based instructions (2)
.changeset/**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/**/*.md: Create changesets for user-facing changes usingjust new-changeset; use headers with####or#####only; keep descriptions concise (1-3 sentences) and focus on user-facing changes
Use past tense when describing what was done ('Added new feature'), present tense when describing Biome behavior ('Biome now supports'); end sentences with a full stop
For new lint rules, show an example of an invalid case in an inline code snippet or code block; for rule changes, demonstrate what is now invalid or valid; for formatter changes, use adiffcode block
Files:
.changeset/rare-maps-read.md
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use thedbg!()macro for debugging output during testing, and pass the--show-outputflag tocargoto view debug output
Usecargo torcargo testto run tests; for a single test, pass the test name after thetestcommand
Use snapshot testing with theinstacrate; runcargo insta accept,cargo insta reject, orcargo insta reviewto manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Usejust f(alias forjust format) to format Rust and TOML files before committing
Files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
🧠 Learnings (27)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Applied to files:
.changeset/rare-maps-read.mdcrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, then `expect_diagnostic`, then options modifiers, then `ignore`, then `file=path`
Applied to files:
.changeset/rare-maps-read.mdcrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Biome linter is designed to work across languages, so rule naming should be generic if potentially implementable for multiple languages, or specific if meant for one language only
Applied to files:
.changeset/rare-maps-read.md
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useConsistent` prefix for rules that ensure consistency across the codebase (e.g., `useConsistentArrayType`)
Applied to files:
.changeset/rare-maps-read.mdcrates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to .changeset/**/*.md : For new lint rules, show an example of an invalid case in an inline code snippet or code block; for rule changes, demonstrate what is now invalid or valid; for formatter changes, use a `diff` code block
Applied to files:
.changeset/rare-maps-read.md
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Implement the `Merge` trait for rule options to define how options from extended configuration merge with user configuration (usually reset instead of extend)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `declare_node_union!` macro to query multiple node types at once by joining them into an enum with `Any*Like` naming convention
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeData::Unknown` to indicate when type inference falls short or is not implemented
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` variants (`Qualifier`, `Resolved`, `Import`, `Unknown`) to represent different phases of type resolution
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Wrap optional rule option fields in `Option<_>` to properly track set vs unset options during configuration merging
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/js_module_info/collector.rs : Implement module-level (thin) inference to resolve `TypeReference::Qualifier` variants by looking up declarations in module scopes and handling import statements
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useValid` prefix for rules that report code that always evaluates to a constant (e.g., `useValidTypeof`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noMisleading` prefix for rules that report valid but potentially misleading code (e.g., `noMisleadingCharacterClass`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Document rules with a one-line brief description in the first paragraph of the doc comment, followed by detailed paragraphs, `## Examples` section with `### Invalid` and `### Valid` subsections, and optional `## Options` section
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnknown` prefix for rules that report mistyped entities in CSS (e.g., `noUnknownUnit`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/comments.rs : Define `<Language>CommentStyle` as a public type alias for `Comments<<Language>Language>` in a `comments.rs` file
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options struct fields should use `#[serde(rename_all = "camelCase")]`, `#[serde(deny_unknown_fields)]`, and `#[serde(default)]` attributes for proper JSON serialization
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options must be defined in the `biome_rule_options` crate and implement traits: `Deserializable`, `Merge`, `Serialize`, `Deserialize`, and `JsonSchema`
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options array fields to save memory (boxed slices and boxed str use 2 words instead of three words)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Avoid using `unwrap()` or `expect()` on `Result` and `Option` types; instead use helper functions like `map`, `filter`, `and_then` to maintain code clarity and avoid panics
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : When navigating CST nodes that return `Result`, use the try operator `?` to convert to `Option`, or use `let else` pattern for `Vec` return types in rule run functions
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnsafe` prefix for rules that report code leading to runtime failures (e.g., `noUnsafeOptionalChaining`)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (1)
crates/biome_jsdoc_comment/src/jsdoc_comment.rs (1)
get_jsdocs(78-92)
🪛 LanguageTool
.changeset/rare-maps-read.md
[uncategorized] ~8-~8: Possible missing comma found.
Context: ...ameter names or JSDoc comments differ. Example with ignoreDifferentlyNamedParameters...
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ 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). (21)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Documentation
- GitHub Check: End-to-end tests
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_tailwind_parser)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: autofix
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_configuration)
🔇 Additional comments (3)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (3)
44-161: Options docs and examples look good and follow house styleThe expanded examples and new
## Optionssection read clearly and line up with the new flags:
- Code fences use the expected language + modifiers (
ts,expect_diagnostic,json,options,ts,use_options).- Each option shows a minimal, targeted example of what is now considered valid when enabled.
No changes needed from my side here.
183-191:try_merge_overloadsrefactor cleanly wires in the new optionsNice extraction here – the overload merge decision is now much easier to reason about:
- Early exits on mismatched type parameters or return types preserve existing behaviour.
ignore_different_js_doc()short-circuits when JSDoc differs, usingJsdocComment::get_jsdocson the wrapper node so export/declare wrappers share the same comment surface.ignore_differently_named_parameters()gates onsame_param_names, so the legacy behaviour is unchanged when the option is false.- The bidirectional
try_mergecalls correctly pairparametersXwith the signature you keep and feed the right parameters intoMergeOverloadSignaturesInfo.This all looks consistent with the rule’s intent and keeps the O(n²) pairing logic intact.
It would be worth double-checking the new
invalidJsdoc/validJsdocandinvalidParams/validParamsspecs cover both “option set” and “option unset” paths.Also applies to: 296-355
422-427:same_param_namesmatches the documented semanticsThe new
same_param_nameshelper does what the docs promise:
- Only walks pairs up to the shorter parameter list via
zip.- Treats any parameter without a name token (destructuring, spreads, parse errors) as matching anything, so those cases don’t block merging.
- Compares
text_trimmed()for named parameters, which is robust to incidental whitespace.Behaviour is a bit conservative for odd patterns, but that seems appropriate behind an opt-in flag.
If you find yourself wanting this elsewhere, it might be worth extracting a shared helper for parameter-name equality across rules.
Also applies to: 527-545
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
🧹 Nitpick comments (1)
crates/biome_rule_options/src/use_unified_type_signatures.rs (1)
19-26: Minor style nit: prefer tail expressions over explicitreturn.The code compiles fine, but idiomatic Rust omits
returnfor the final expression:impl UseUnifiedTypeSignaturesOptions { pub fn ignore_differently_named_parameters(&self) -> bool { - return self.ignore_differently_named_parameters.unwrap_or(false); + self.ignore_differently_named_parameters.unwrap_or(false) } pub fn ignore_different_js_doc(&self) -> bool { - return self.ignore_different_js_doc.unwrap_or(false); + self.ignore_different_js_doc.unwrap_or(false) } }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs(8 hunks)crates/biome_rule_options/src/use_unified_type_signatures.rs(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use thedbg!()macro for debugging output during testing, and pass the--show-outputflag tocargoto view debug output
Usecargo torcargo testto run tests; for a single test, pass the test name after thetestcommand
Use snapshot testing with theinstacrate; runcargo insta accept,cargo insta reject, orcargo insta reviewto manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Usejust f(alias forjust format) to format Rust and TOML files before committing
Files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
🧠 Learnings (32)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Implement the `Merge` trait for rule options to define how options from extended configuration merge with user configuration (usually reset instead of extend)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `declare_node_union!` macro to query multiple node types at once by joining them into an enum with `Any*Like` naming convention
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, then `expect_diagnostic`, then options modifiers, then `ignore`, then `file=path`
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeData::Unknown` to indicate when type inference falls short or is not implemented
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/js_module_info/collector.rs : Implement module-level (thin) inference to resolve `TypeReference::Qualifier` variants by looking up declarations in module scopes and handling import statements
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` variants (`Qualifier`, `Resolved`, `Import`, `Unknown`) to represent different phases of type resolution
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useConsistent` prefix for rules that ensure consistency across the codebase (e.g., `useConsistentArrayType`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/scoped_resolver.rs : Implement full inference to resolve `TypeReference::Import` variants across the entire module graph
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useValid` prefix for rules that report code that always evaluates to a constant (e.g., `useValidTypeof`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rscrates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noMisleading` prefix for rules that report valid but potentially misleading code (e.g., `noMisleadingCharacterClass`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Document rules with a one-line brief description in the first paragraph of the doc comment, followed by detailed paragraphs, `## Examples` section with `### Invalid` and `### Valid` subsections, and optional `## Options` section
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnknown` prefix for rules that report mistyped entities in CSS (e.g., `noUnknownUnit`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Code actions must specify a `fix_kind` field in the `declare_lint_rule!` macro as either `FixKind::Safe` or `FixKind::Unsafe` to indicate whether fixes always preserve program behavior
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/comments.rs : Define `<Language>CommentStyle` as a public type alias for `Comments<<Language>Language>` in a `comments.rs` file
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)
Applied to files:
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options struct fields should use `#[serde(rename_all = "camelCase")]`, `#[serde(deny_unknown_fields)]`, and `#[serde(default)]` attributes for proper JSON serialization
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Wrap optional rule option fields in `Option<_>` to properly track set vs unset options during configuration merging
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options array fields to save memory (boxed slices and boxed str use 2 words instead of three words)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options must be defined in the `biome_rule_options` crate and implement traits: `Deserializable`, `Merge`, `Serialize`, `Deserialize`, and `JsonSchema`
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper types from the biome_diagnostics::v2 module (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) or implement the Advices trait yourself for custom advice handling
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Avoid using `unwrap()` or `expect()` on `Result` and `Option` types; instead use helper functions like `map`, `filter`, `and_then` to maintain code clarity and avoid panics
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : When navigating CST nodes that return `Result`, use the try operator `?` to convert to `Option`, or use `let else` pattern for `Vec` return types in rule run functions
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnsafe` prefix for rules that report code leading to runtime failures (e.g., `noUnsafeOptionalChaining`)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-09-23T21:33:00.843Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7571
File: crates/biome_service/src/file_handlers/html.rs:360-368
Timestamp: 2025-09-23T21:33:00.843Z
Learning: Don't flag potential move/borrow issues in Rust code reviews since the Rust compiler catches these at compile time. Focus on logic, design, and issues that the toolchain doesn't automatically detect.
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUseless` prefix for rules that report unnecessary code that could be removed or simplified (e.g., `noUselessConstructor`)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useShorthand` prefix for rules that report syntax rewritable using equivalent compact syntax (e.g., `useShorthandAssign`)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Rules should use the `no` prefix naming convention when the sole intention is to forbid a single concept (e.g., `noDebugger` to disallow debugger statements)
Applied to files:
crates/biome_rule_options/src/use_unified_type_signatures.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (1)
crates/biome_jsdoc_comment/src/jsdoc_comment.rs (1)
get_jsdocs(78-92)
⏰ 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). (16)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Documentation
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_tailwind_parser)
🔇 Additional comments (4)
crates/biome_rule_options/src/use_unified_type_signatures.rs (1)
4-17: Struct configuration looks good.The serde attributes, derives, and
Option<bool>wrapping all follow the project conventions for rule options. Based on learnings, this properly enables configuration merging and JSON serialisation.crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (3)
296-353: Clean extraction of merge logic.The
try_merge_overloadsfunction nicely encapsulates the merge decision flow. The use ofIterator::nefor JSDoc comparison and the bidirectional merge attempt are both sensible approaches.
525-543: Implementation matches documented behaviour.The
same_param_namesmethod correctly handles the edge case of unnamed parameters (destructuring, spreads) by treating them as matching anything. The comment at lines 529-533 explains the rationale well.
183-194: Options integration looks good.The options are retrieved once and passed to
try_merge_overloads, keeping the loop body clean. The early return on finding a mergeable pair maintains the existing O(n²) behaviour with minimal overhead.
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
Outdated
Show resolved
Hide resolved
typescript-eslint to useUnifiedTypeSignaturetypescript-eslint to useUnifiedTypeSignature
Summary
Fixes #8355
Adds 2 new options from TSEslint to
useUnifiedTypeSignaturethat cause the rule to ignore function overloads with either differently named parameters or different JSDoc comments.The basic gist of the code is as follows:
try_merge_overloads, to reduce nesting and add more encapsulation.same_param_namesfunction forAnyJsParameterListExtthat compares parameter names piecewise.Important
I cannot stress how painful it was to attempt to get a parameter's name from an AST node. The amount of duplicated code and other name equality things I came across makes me really worried at what other sorts of duplication could be lurking in the darkness. Cleaning up the various
NameEqualsvsIsNameEqualinstances is above my paygrade, but would make for a good next refactor or 2.(As an aside, I think the various syntax token unions could use a bit of abstraction over their internal details. I arguably shouldn't need to go digging into the generated code inside
biome_js_syntaxfor what types of nodes make up anAnyParameterorAnyJsBindingjust to get the name of a damn thing.)Test Plan
Created several new test files for the various new options, including both valid and invalid examples.
I also took it upon me to add even more stupidly obscure spec tests for things like array spread and object literals that we did not test prior. (I like edge cases)
Docs
Added rust docs for the new options.
TODO: fix
JsdocvsJsDoccasing bugs and generate json schema to shut up vscode