Skip to content

Commit de4435a

Browse files
docs(no-implicit-any-catch): when not to use it
1 parent 442daee commit de4435a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docs/rules/no-implicit-any-catch.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
<!-- end auto-generated rule header -->
1010

11-
This rule requires an explicit type annotation for error parameters in error handlers. It's similar to the typescript-eslint [`use-unknown-in-catch-callback-variable`](https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable/) rule or the TSConfig [`useUnknownInCatchVariables`](https://www.typescriptlang.org/tsconfig/#useUnknownInCatchVariables) option, but is for observables - not `try`/`catch` statements.
11+
This rule requires an explicit type annotation for error parameters in error handlers.
12+
It's similar to the typescript-eslint [`use-unknown-in-catch-callback-variable`](https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable/) rule
13+
or the TSConfig [`useUnknownInCatchVariables`](https://www.typescriptlang.org/tsconfig/#useUnknownInCatchVariables) option,
14+
but is for observables - not `try`/`catch` statements.
1215

1316
## Rule details
1417

@@ -89,6 +92,13 @@ This rule accepts a single option which is an object with an `allowExplicitAny`
8992
}
9093
```
9194

95+
## When Not To Use It
96+
97+
If your codebase is not yet able to enable `useUnknownInCatchVariables`,
98+
it likely would be similarly difficult to enable this rule.
99+
100+
Type checked lint rules are more powerful than traditional lint rules, but also require configuring type checked linting.
101+
92102
## Further reading
93103

94104
- [Catching Unknowns](https://ncjamieson.com/catching-unknowns/)

0 commit comments

Comments
 (0)