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
Enhancement: [return-await] Option for unopinionated "in-try-catch" #9030
Comments
I'm not quite sure what to name this option, since, unfortunately, |
Note that this would also make life easier for users of |
I'm a -1 here. What does one gain by allowing All I can personally see is a big downside - allowing the inconsistency creates a confusing code standard - "Why is this function I don't think there are any users that are evaluating this rule and this option, and skipping it because it's technically got some stylistic implications. In fact I'd say the opposite - people like that it enforces strict consistency. Consistency is good for style and correctness because it means people think less - allowing them to get it right more often. "never use |
I don't feel strongly about it... I would personally only ever use "always".
This minimizes the "big diff bad" complaint when newly enabling something in a codebase, and differentiates between signal and noise (control flow changes vs consistency changes) when reviewing the changeset. Mostly, my thought is that this is a means to an end to make it palatable for the
Thus far, I just have existence proof of one person in the wild (and who isn't me 😄) who asked for this as a prerequisite for adoption.
Agreed! Again, for which reason I'd use Another approach here might be restructuring the options as |
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/return-await
Description
The current
in-try-catch
option handles two separate concernsawait
where it impacts control flow (due totry-catch-finally
)await
elsewhereI would propose for there to be a rule option that handles only the correctness portion. That is to say, it should enforce
await
wherever in-try-catch currently does, but not report wherein-try-catch
forbidsawait
.Fail
Pass
Additional Info
I think this would be valuable in order to be able to recommend a less disruptive version of the rule in a preset, see #8667
The text was updated successfully, but these errors were encountered: