typescript/consistent-indexed-object-style Style
What it does
Require or disallow the Record
type.
Why is this bad?
Inconsistent style for indexed object types can harm readability in a project.
Examples
Examples of incorrect code for this rule:
ts
interface Foo {
[key: string]: unknown;
}
type Foo = {
[key: string]: unknown;
};
Examples of correct code for this rule:
ts
type Foo = Record<string, unknown>;