Summary
Investigate a shared analysis utility for TypeScript function overload detection.
useConsistentFunctionStyle adds local overload detection. Existing rules, including useAdjacentOverloadSignatures and useUnifiedTypeSignatures, also inspect overload declarations. The project should evaluate whether these rules can use a common implementation.
Rationale
A shared implementation can make overload recognition consistent across rules. It can also reduce duplicated AST traversal and edge-case handling.
Affected areas
crates/biome_js_analyze/src/lint/nursery/use_consistent_function_style.rs
- The implementation modules for
useAdjacentOverloadSignatures
- The implementation modules for
useUnifiedTypeSignatures
- Shared JavaScript or TypeScript analysis utilities, if appropriate
Required investigation
- Identify all current overload-detection implementations.
- Compare their supported syntax and scope handling.
- Define a shared API only if the rules have compatible requirements.
- Migrate applicable rules and add focused tests for shared edge cases.
Acceptance criteria
- The investigation documents the existing implementations and their semantic differences.
- The follow-up design identifies a shared utility or explains why one is not appropriate.
- Any proposed migration preserves each rule's current behavior.
Requested by: @dyc3
Backlinks:
Summary
Investigate a shared analysis utility for TypeScript function overload detection.
useConsistentFunctionStyleadds local overload detection. Existing rules, includinguseAdjacentOverloadSignaturesanduseUnifiedTypeSignatures, also inspect overload declarations. The project should evaluate whether these rules can use a common implementation.Rationale
A shared implementation can make overload recognition consistent across rules. It can also reduce duplicated AST traversal and edge-case handling.
Affected areas
crates/biome_js_analyze/src/lint/nursery/use_consistent_function_style.rsuseAdjacentOverloadSignaturesuseUnifiedTypeSignaturesRequired investigation
Acceptance criteria
Requested by: @dyc3
Backlinks: