Skip to content

Commit 90beef7

Browse files
committed
Improve the @typescript-eslint/ban-types rule config
1 parent c867031 commit 90beef7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ module.exports = {
5858
fixWith: 'symbol'
5959
},
6060
Object: {
61-
message: 'Use `object` instead.',
62-
fixWith: 'object'
61+
message: 'The `Object` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848',
62+
fixWith: 'Record<string, unknown>'
63+
},
64+
object: {
65+
message: 'The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848',
66+
fixWith: 'Record<string, unknown>'
6367
},
64-
object: 'Use `{}` instead.',
6568
Function: 'Use a specific function type instead, like `() => void`.',
6669

6770
// TODO: Enforce `undefined` over `null` here too?

0 commit comments

Comments
 (0)