-
Notifications
You must be signed in to change notification settings - Fork 38
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
chore: Add @typescript-eslint/no-confusing-void-expression
rule
#2910
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this rule need to be ignored in Promise.all calls and some other places?
...rackerless-network/test/end-to-end/content-delivery-layer-node-with-real-connections.test.ts
Show resolved
Hide resolved
It would be better to refactor these tests. In practice, the arguments sent to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could move the void expressions above the Promise.all blocks in all cases to get rid of the eslint-disable comments
Added new
eslint
rule: https://typescript-eslint.io/rules/no-confusing-void-expression/This rule disallows e.g. using
return foobar()
whenfoobar()
method returnsvoid
. It is better to just call the method and do explicit return separately, if needed. (Quite typically thereturn
is not needed at all as the line is the last line of the method.)Simplified
multiple-publisher-plugins.test.ts
so that it usesPromise<void>
instead ofPromise<unknown>
and therefore doesn't need any special handling related to this rule.