Skip to content

unifiedSignatures

Reports function overloads that could be unified.

✅ This rule is included in the ts stylistic presets.

Function overloads that differ only by a single parameter type or by optional parameters can be simplified using union types or optional parameters.

interface Parser {
parse(input: string): Document;
parse(input: Buffer): Document;
}
interface Logger {
log(): void;
log(message: string): void;
}

This rule is not configurable.

If you intentionally use separate overloads for different behaviors or documentation purposes, you may want to disable this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.