-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Labels
Description
Users should be able to set the preference of types. The option could looks like this:
{
'@typescript-eslint/ban-types': [
'error',
{
types: {
// ban type `Foo` using the default error message
Foo: null,
// ban type `Bar` with a custom message.
Bar: "Don't use Bar!",
// ban type `String` and tell the plugin how to fix it.
String: {
message: 'Use string instead',
fixWith: 'string',
},
},
},
],
};See @typescript-eslint/ban-types.
As a side note, ban-types is a better name than check-types. The name check-types could mean "check type is valid", "check type is consistent to how it is used" or "check the style of types".
vulkd and brettz9