Skip to content

Conversation

@Bertie690
Copy link
Contributor

@Bertie690 Bertie690 commented Dec 5, 2025

Summary

Fixes #8355

Adds 2 new options from TSEslint to useUnifiedTypeSignature that 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:

  1. Moved the giant nested for loop into its own function, try_merge_overloads, to reduce nesting and add more encapsulation.
  2. Added conditionals to said function to check for identical JSDocs and/or parameter names, respectively. The former is done by exposing an underlying iterator from the existing JSDoc parsing service code, while the latter is done with a hand-rolled are_names_subset function for AnyJsParameterListExt that 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 NameEquals vs IsNameEqual instances 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 Jsdoc vs JsDoc casing bugs and generate json schema to shut up vscode

@changeset-bot
Copy link

changeset-bot bot commented Dec 5, 2025

🦋 Changeset detected

Latest commit: 55d01b0

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Dec 5, 2025
@Bertie690 Bertie690 changed the title Committed work for the day methinks fix(lint): add options from typescript-eslint to useUnifiedTypeSignature Dec 5, 2025
@Bertie690 Bertie690 marked this pull request as ready for review December 6, 2025 07:19
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

Walkthrough

This PR ports the ignoreDifferentlyNamedParameters and ignoreDifferentJsDoc options from typescript-eslint's unified-signatures rule to Biome's useUnifiedTypeSignatures rule. The implementation introduces centralised merge logic for function overloads, adds name-based parameter comparison utilities, extends the rule configuration struct with two optional boolean fields, and includes comprehensive test specifications covering both new options with various overload patterns and JSDoc scenarios.

Suggested labels

A-Project, A-Parser

Suggested reviewers

  • dyc3
  • ematipico
  • arendjr

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding new options from typescript-eslint to the useUnifiedTypeSignature rule.
Description check ✅ Passed The description clearly relates to the changeset, detailing the two new options, refactoring work, test additions, and acknowledging outstanding TODOs.
Linked Issues check ✅ Passed The PR fully addresses issue #8355 by implementing both ignoreDifferentlyNamedParameters and ignoreOverloadsWithDifferentJSDoc options with comprehensive test coverage.
Out of Scope Changes check ✅ Passed All changes align with the stated objectives: option implementation, refactoring try_merge_overloads, JSDoc exposure, parameter-name utilities, and test files for new features.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 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_each now that get_jsdocs is 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_overloads significantly 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_merge should 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_token to a shared utility module (perhaps in the parameter_ext module) to avoid further duplication.

crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.ts (1)

24-32: Comment vs JSDoc mismatch here

// same jsdocs says they’re identical, but the three bake overloads have different JSDoc text. Totally harmless, but it may trip up anyone cross‑checking against invalidJsdoc.ts. Consider tweaking the comment to match the intent.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 789b0e7 and f37be29.

⛔ Files ignored due to path filters (5)
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalid.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/valid.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts.snap is excluded by !**/*.snap and 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 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
**/*.rs

📄 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_rule_options/src/use_unified_type_signatures.rs
  • crates/biome_jsdoc_comment/src/jsdoc_comment.rs
  • 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/valid.ts
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalid.ts
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.ts
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts
  • crates/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.md
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.json
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.options.json
  • crates/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.md
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.json
  • crates/biome_rule_options/src/use_unified_type_signatures.rs
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
  • crates/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.json
  • 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 `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.json
  • 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/**/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.json
  • crates/biome_rule_options/src/use_unified_type_signatures.rs
  • crates/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.json
  • 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/validParams.options.json
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
  • crates/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.rs
  • 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_rule_options/src/use_unified_type_signatures.rs
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
  • crates/biome_jsdoc_comment/src/jsdoc_comment.rs
  • 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 : 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.rs
  • crates/biome_jsdoc_comment/src/jsdoc_comment.rs
  • 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_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.rs
  • crates/biome_jsdoc_comment/src/jsdoc_comment.rs
  • 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/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json
  • 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 : 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.rs
  • 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_jsdoc_comment/src/jsdoc_comment.rs
  • 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_jsdoc_comment/src/jsdoc_comment.rs
  • 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_jsdoc_comment/src/jsdoc_comment.rs
  • 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 : 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.rs
  • 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/**/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
  • crates/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_subset implementation correctly leverages zip to compare parameter names up to the shorter list's length, which aligns with the documented behaviour.


167-180: LGTM!

The integration of try_merge_overloads with 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 ignoreDifferentJsdoc option for testing purposes.

crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.options.json (1)

1-15: LGTM!

Configuration file correctly enables the ignoreDifferentJsdoc option for testing invalid cases.

crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.options.json (1)

1-15: LGTM!

Configuration file correctly enables the ignoreDifferentlyNamedParameters option 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 of Copy is 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 on

The tuple, destructured f, and fizzbuzz overloads 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 parameters

These fixtures nicely cover the “only the parameter names differ” scenarios across plain functions, async exports, interfaces, classes, and declare functions. Nothing here should upset the parser, and they’re a solid match for exercising ignoreDifferentlyNamedParameters.

crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.ts (1)

31-39: Remove this comment—the syntax is intentionally invalid

This file is a test specification for the useUnifiedTypeSignatures linting rule. The code at lines 31–39 deliberately contains invalid TypeScript syntax (function keywords 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.

Comment on lines +158 to +160
// TODO: Figure out how to make syntax nodes for unit tests
#[test]
fn test_get_jsdocs() {}
Copy link
Contributor

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-hq
Copy link

codspeed-hq bot commented Dec 6, 2025

CodSpeed Performance Report

Merging #8368 will not alter performance

Comparing Bertie690:unified-signature-options (55d01b0) with next (5901d79)

Summary

✅ 53 untouched
⏩ 85 skipped1

Footnotes

  1. 85 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs (2)

408-411: are_names_subset semantics are fine, but the description is slightly stronger than the implementation

The 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 over zip”.

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 shared

The new ParameterExt::get_name_token and 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

📥 Commits

Reviewing files that changed from the base of the PR and between 07be84f and 7529fbb.

⛔ Files ignored due to path filters (2)
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidJsdoc.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts.snap is excluded by !**/*.snap and 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 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
**/*.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.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts.snap.new
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts.snap.new
  • crates/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.json
  • crates/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 correct

Schema path and the linter.rules.style.useUnifiedTypeSignatures.options.ignoreDifferentlyNamedParameters setting 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 consistent

Header, # 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 cases

These 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 behaviour

The added invalid/valid examples and the ## Options section for ignoreDifferentlyNamedParameters and ignoreDifferentJsDoc are clear and follow the Biome lint‑docs format (language tags, expect_diagnostic, use_options, json,options etc.).


162-183: Refactor into try_merge_overloads keeps the core merge logic coherent

Pulling the pairwise merge checks (type parameters, return type, options, then try_merge in both directions) into try_merge_overloads makes the main run loop much easier to read, and the early returns for non‑mergeable pairs are straightforward.

Also applies to: 282-340


304-313: ignore_different_jsdoc behavior may not match documented intent – verify with JSDoc iterator comparison

The 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 return true when 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_equal currently returns false when get_name_token() yields None for either parameter. This means destructured parameters (object/array patterns) and other non-identifier bindings are treated as mismatched names, causing try_merge_overloads to 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_equal to return true when 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.

@github-actions github-actions bot added the A-Parser Area: parser label Dec 6, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7529fbb and 55d01b0.

⛔ Files ignored due to path filters (3)
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/invalidParams.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validJsdoc.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts.snap is excluded by !**/*.snap and 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 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_syntax/src/parameter_ext.rs
  • crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
  • crates/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.ts
  • crates/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.rs
  • 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 : 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.rs
  • crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
  • crates/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.rs
  • 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_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.rs
  • 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 `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.rs
  • 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_syntax/src/parameter_ext.rs
  • crates/biome_js_analyze/src/lint/style/use_unified_type_signatures.rs
  • crates/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.rs
  • 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_js_analyze/src/lint/style/use_unified_type_signatures.rs
  • 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_js_analyze/src/lint/style/use_unified_type_signatures.rs
  • crates/biome_rule_options/src/use_unified_type_signatures.rs
  • 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 : 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
  • 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 `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
  • crates/biome_rule_options/src/use_unified_type_signatures.rs
  • 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 : 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
  • crates/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.rs
  • 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/**/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.ts
  • 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/**/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 sound

Schema path, rule hierarchy, and the ignoreDifferentJsDoc option all look consistent and correctly targeted at style.useUnifiedTypeSignatures. Nothing blocking here.

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

5-18: Options struct matches Biome rule‑options conventions

Nice: the options now live on UseUnifiedTypeSignaturesOptions with Option<bool> fields, camelCase serde, deny_unknown_fields, default, and derived Merge/JsonSchema support. Adding Copy is 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: New name_token accessor is sound and fits the intended use

The binding → identifier → name_token() chain is robust and naturally returns None for 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 idiomatic

The added invalid/valid examples plus the ## Options section (with ts and json,options/ts,use_options tags) 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 behavior

The extraction into try_merge_overloads with same_param_names/NameEquals helpers improves code clarity.

However, the ignoreDifferentJsDoc option 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‑cases

These 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_names semantics and should guard against regressions.

crates/biome_js_analyze/tests/specs/style/useUnifiedTypeSignatures/validParams.ts (1)

1-27: Valid cases cover the new ignoreDifferentlyNamedParameters option well

This 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter A-Parser Area: parser L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant