You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 messageFoo: 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',},},},],};
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".
The text was updated successfully, but these errors were encountered:
Closed by #247. Thanks for the great idea! I tweaked it a little in the implementation, but it is similar as you can see in the docs. (also connects to options with check-types and no-undefined-types)
Users should be able to set the preference of types. The option could looks like this:
See @typescript-eslint/ban-types.
As a side note,
ban-types
is a better name thancheck-types
. The namecheck-types
could mean "check type is valid", "check type is consistent to how it is used" or "check the style of types".The text was updated successfully, but these errors were encountered: