-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Deprecate return-await option "never" #9433
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
Comments
One thing to add - if anyone wants to prohibit all
That way, neither That is a better solution IMO than the 'never' option would have been, since the 'never' option still allows |
I think if never is removed, it would be good to document what is said above and how to achieve same result. That table that is worked on linked issue helps to understand these settings. But just a feedback, I think it’s not been very clear what the options do and when you want to use which option. I kinda thought that “never” would mean that you always need to return promise, I.e. you can’t return variable that was awaited earlier. As a side note, I sometimes wish there was page where you could see list of useful syntax to disallow with some examples. There are a lot of cases where ban syntax would be enough instead of creating new rule. It’s just an option that it’s easy to forget. |
|
Fully agree! This and some of the other promise rules are an area of active focus for improving the docs, and clarity in general. 🙂 |
Overview
Doc: https://typescript-eslint.io/rules/return-await#never
The "never" option really just enforces wrong and confusing behavior in error-handling scenarios. In #9364 (comment) / #9364 (comment) we're trying to update the docs in
return-await
and I'm finding it hard to say when you would want to use the option. @JoshuaKGoldberg and I are thinking this may be a reasonable time to just deprecate it rather than trying too hard to find something nice to say.Note that
no-return-await
(fixes #7581) eslint/eslint#7582) and eslint never added a "never" optionIt looks like very few people are using this option: https://sourcegraph.com/search?q=context:global+file:.*eslint%7Cjs%7Cjson%7Cyaml%7Cyml%7Cyaml.*+/%40typescript-eslint%5C/return-await.*never/+-file:.*node_modules.*+-file:dist%5C/.*+count:200000&patternType=standard&sm=0
I propose we document it as deprecated (in #9364), to be removed in a future major version.
The text was updated successfully, but these errors were encountered: