typescript/ban-types
typescript plugin · pedantic
No autofix
.oxlintrc.json
{
"rules": {
"typescript/ban-types": "error"
}
}This rule bans specific types and can suggest alternatives. Note that it does not ban the corresponding runtime objects from being used.
let foo: String = 'foo';
let bar: Boolean = true;let foo: string = 'foo';
let bar: boolean = true;Examples from the Oxlint documentation.
ESLint does not have this rule.
typescript/ban-types
typescript plugin · pedantic
{
"rules": {
"typescript/ban-types": "error"
}
}complexity/noBannedTypes
complexity · since 1.0.0
{
"linter": {
"rules": {
"complexity": {
"noBannedTypes": "error"
}
}
}
}Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects
Require switch-case statements to be exhaustive
Enforce using String#startsWith and String#endsWith over other equivalent methods of checking substrings
Enforce consistent usage of type exports
Enforce consistent usage of type imports
Disallow async functions which do not return promises and have no await expression