-
-
Notifications
You must be signed in to change notification settings - Fork 780
fix(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: 55d01b0 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
WalkthroughThis PR ports the Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ 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
| // TODO: Figure out how to make syntax nodes for unit tests | ||
| #[test] | ||
| fn test_get_jsdocs() {} |
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.
🛠️ Refactor suggestion | 🟠 Major
Add tests for the new public API.
The empty test stub with a TODO is concerning. The new get_jsdocs API should have test coverage. Consider either implementing the test using the codebase's existing test infrastructure or creating an issue to track this technical debt.
Do you want me to help investigate how other modules in the codebase create syntax nodes for unit tests?
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.
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.are_names_subsetfunction 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.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