Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have read the FAQ and my problem is not listed.
Description
I recently debugged a difficult bug in my code where I was try-catching an async call that I was returning right away.
async function asyncFoo() {
try {
return asyncBar() // no await
} catch (err) {
// so my error handling code here wasn't getting hit
}
}
I was surprised when I finally figured this out, because I love and rely on e.g. no-floating-promises
to catch missing await
s, but it hadn't caught this one.
I found that return-await
exists to help here, but was then also surprised that it wasn't included in the recommended-type-checked
preset that we use.
I thought the whole purpose of that preset was to at least help ensure correctness (separate from style) — and this was definitely a correctness issue.
I've now enabled return-await
in my codebase, and am feeling great. But can I suggest adding this to recommended-type-checked
to prevent other developers from hitting easily preventable bugs like this?
Thank you for your consideration and for a great tool!
Impacted Configurations
Additional Info
No response