Require or disallow the Record type.
This rule applies only to .js and .ts files.
// code-linter.json5
{
"rules": {
"@typescript-eslint/consistent-indexed-object-style": "error"
}
} // The Record type is recommended by default. export type Foo = Record<string, unknown>;
export interface Foo1 {
// The Record type is recommended by default.
[key: string]: unknown;
}
export type Foo2 = {
// The Record type is recommended by default.
[key: string]: unknown;
}; plugin:@typescript-eslint/all
For details about how to configure Code Linter check rules, see Code Linter.