menu

prefer-function-type

Prefer function types over single-signature structural types

A structural type containing only one callable signature adds structure without expressing another capability. Instead, you SHOULD write the callable directly as a function or constructor type.

Nominal, inherited, and overloaded callable types retain their declarations.

Reported

1type Transform = { (value: int32): string };

Accepted

1type Transform = (value: int32) => string;