Disallow usage of the implicit any type in catch clauses.
This rule applies only to .js and .ts files.
// code-linter.json5
{
"rules": {
"@typescript-eslint/no-implicit-any-catch": "error"
}
} By default, this rule does not allow the implicit any type. However, the {"allowExplicitAny": true} object can be accepted as a rule parameter to allow the explicit any type.
Example:
// code-linter.json5
{
"rules": {
"@typescript-eslint/no-implicit-any-catch": ["error", {"allowExplicitAny": true}]
}
} The following is not considered a warning with {"allowExplicitAny": true}.
try {
// ...
} catch (e: any) {
// ...
} try {
// ...
// By default, the implicit any type is not allowed.
} catch (e) {
// ...
} plugin:@typescript-eslint/all
For details about how to configure Code Linter check rules, see Code Linter.