Enhancement: no-misused-promises
should not flag functions whose contents are wrapped in try
/catch
#9319
Closed
4 tasks done
Labels
enhancement: plugin rule option
New rule option for an existing eslint-plugin rule
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
wontfix
This will not be worked on
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/no-misused-promises/
Description
The
no-misused-promises
documentation does not explain the motivation for the rule, so I'm left to infer that it is because promise rejections are not handled properly. There are a couple references tono-floating-promises
in the docs, which support this view. However, if a function is wrapped entirely in atry
/catch
then we know it can never error and so any triggering of this rule would be a false positiveFail
Pass
Additional Info
No response
The text was updated successfully, but these errors were encountered: