Interfaces are generally preferred over type literals because interfaces can be implemented, extended and merged.
Examples of incorrect code for this rule.
type T = { x: number };
Examples of correct code for this rule.
type T = string;
type Foo = string | {};
interface T {
x: number;
}
{
"interface-over-type-literal": "error"
}
- TSLint: interface-over-type-literal