prefer-function-type
Configuration
Rule Details
Enforce using function types instead of interfaces with call signatures.
TypeScript allows declaring a function type in two ways: as a function type (() => string) or as an object type with a single call signature ({ (): string }). The former is more concise, so this rule reports the latter on interfaces and type literals whose only member is a single call signature (or construct signature) and offers an autofix to rewrite them.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
This rule has no options.
When Not To Use It
Disable this rule if you prefer interfaces or object type literals for stylistic consistency, or if you rely on declaration merging (e.g. augmenting the global Function interface) — those cases occasionally produce false positives that can be silenced with an inline disable comment.