Enhancement: [use-unknown-in-catch-callback-variable] Option to only check inline functions #9057
Open
4 tasks done
Labels
enhancement: plugin rule option
New rule option for an existing eslint-plugin rule
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
triage
Waiting for maintainers to take a look
Before You File a Proposal Please Confirm You Have Done The Following...
My proposal is suitable for this project
Link to the rule's documentation
https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable/
Description
I propose an option to only check on inline functions, i.e.
.catch((foo) => bar)
and not.catch(baz)
. Ifbaz
acceptsany
, it's either from an external library or will be flagged by--noImplicitAny
/no-explicit-any
.Use case: I have a few instances of
.catch(console.error)
in my codebase to log errors without throwing.console.error
is typed as(...data: any[]): void
, and as such this rule triggers an error.Fail
Pass
Additional Info
No response
The text was updated successfully, but these errors were encountered: