I have a type
declaration as below:
type Position = {
white: number[];
black: number[];
}
When I lint the project, I see this error:
error Use an interface instead of a type literal @typescript-eslint/prefer-interface
The documentation about the rule that causes the error says:
Interfaces are generally preferred over type literals because interfaces can be implemented, extended and merged.
This rule is common between TSLint and ESLint. I know that interface
is more powerful than type
, but when I don't need interface
advantages and type
is enough, why shouldn't I use it? Are there any other drawbacks to using type
?