-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Enhancement: [no-confusing-void-expression] Add option to ignore void<->void #8538
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
@JoshuaKGoldberg @bradzacher I'm currently working on resolving the issue, but I have one question. The issue was about implementing an option to ignore the rule when the Void type is specified, but For example, should the following cases be ignore rule? (cc. @auvred @yeonjuan )
|
Hmm, yeah, I'd think that if there's an explicit We should wait to hear from @bradzacher too, if Brad has time. |
I'd agree - if the contextual type includes a void return type then we should ideally treat it the same as an explicit void return type annotation (eg ignore it). |
Thank you. When applying the new option, I will work to ignore the rule in the case mentioned in the comment above! |
Is this option doc good?
If so, I can send PR later. |
For the option name: since we'd like to eventually have it enabled by default, how about |
Looks like the option implemented in #10067 ignores too much. Examples:
I was expecting that it would require adding Maybe leave this open so we can have both: ignore all returns or ignore returns in void functions with literal void type annotation (as described in a comment above). If not, maybe rename this option to simply |
@phaux Could you kindly open a new issue with playground links for each of the concerns? |
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-confusing-void-expression
Description
Following from #8375 (review): we tried enabling
@typescript-eslint/no-confusing-void-expression
internally and very quickly found it to be inconvenient:Agreed. @bradzacher and I chatted briefly, and Brad suggested:
void
<->void
return caseAgreed! Filing this issue to add that option. We can file a followup if & when it gets in.
Fail
Pass
Additional Info
No response
The text was updated successfully, but these errors were encountered: