New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configs: include return-await
in recommended-type-checked
preset
#8667
Comments
Heh, I personally prefer this, but have memories of people getting ✨ very upset ✨ over it. Maybe we should put it in |
What did people get upset about with |
I don't have many primary resources that I can find in 5 minutes of searching 😞 but vaguely:
Do you have references? Maybe relevant: eslint/eslint#18166 |
I'm big +1 to this, but, I am also concerned that the current rule is too opinionated, and would cause a lot of unnecessary flagging in existing codebases. I'd propose we have an unopinionated option that only flags on the parts of the rule that impact correctness, if we are to add the rule to recommended; see #9030. Note that all the disagreements center around the portion of the rule that I'm proposing to disable. |
The rule has an autofixer for any cases that aren't |
...but they should! If you I'm +1 to this provided the caveats Kirk mentioned are accounted for. |
Mostly, it's just that I would be scared we'd not get the rule into a recommended preset at all if we reawaken the opinion-charged conversations referenced in #8667 (comment). The thought is that, strategically speaking, we could sidestep all that and still get the most important benefits (IMO) of return-await.
I completely agree that full consistency (whether |
If backlash that it's too opinionated where it doesn't affect the outcome of execution is not a concern, then everything I've said is moot! 🙂 |
Before You File a Proposal Please Confirm You Have Done The Following...
Description
I recently debugged a difficult bug in my code where I was try-catching an async call that I was returning right away.
I was surprised when I finally figured this out, because I love and rely on e.g.
no-floating-promises
to catch missingawait
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 therecommended-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 torecommended-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
recommended-type-checked
Additional Info
No response
The text was updated successfully, but these errors were encountered: