Skip to content

Investigate shared analysis for TypeScript function overloads #11712

Description

@coderabbitai

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:

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions