Skip to content

adjacent-overload-signatures

Reports an overload (a signature or function with the same name as an earlier one) with another member between it and the earlier overloads. It checks interface and class members, call and construct signatures, and function declarations.

Overloads are read together as one declaration with several shapes. When another member sits between them, a reader can miss one shape or take a later signature for an unrelated member.

To fix, move the overloads next to each other.

Reported
...
function f(): void;
function g(): void {}
function f(x: number): void;
function f(x?: number) {}
class O { m(): void; n(): void; m(x: number): void; static m(): void; static m(x: number): void; }
interface P { (): void; a(): void; (x: number): void }
js:
lint:
rules:
adjacent-overload-signatures: warn # off (default), warn, error

Enabled by the presets: js/biome-recommended.

Suppress one line with sudsy-disable-next-line adjacent-overload-signatures in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
typescript-eslint adjacent-overload-signatures full