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
Rule Change: allow void
in array-callback-return
for Array.prototype.forEach
#17285
Comments
Hey @nopeless, I am not too familiar with this lint rule and I'm trying to repro in the playground but do not see it marking any of the examples you've provided as wrong. Am I missing something? Could you update the playground example? |
Makes sense to me 👍 |
I am also in favor. @nopeless do you want to submit a PR for this? |
Would you mind if i do this on the same PR thats currently open right now @nzakas |
@nopeless we need it on a separate pull request so we can evaluate each separately. |
@nopeless will you be able to create a separate PR? |
@snitin315 are you working on this currently? |
@Tanujkanti4441 feel free to work on this. |
* feat: allowVoid option in array-callback-return Refs #17285 * feat: refactor code and add docs * feat: allow void in return-statement * feat: add more tests for allowVoid
PR #17564 that implements the new option |
What rule do you want to change?
array-callback-return
What change to do you want to make?
Implement suggestions
How do you think the change should be implemented?
A new option
Example code
What does the rule currently do for this code?
Rightfully marks it as wrong, as return value of
forEach
's callback is ignoredHowever, even adding a void in front does not fix the issue, and there are no IDE suggestions
What will the rule do after it's changed?
add a new option
allowVoid
. It will share the same logic that I have implemented for detectingvoid
and suggesting fixes in #17282If #17282 passes, then it is logical that this rule has consistent options and behavior.
Participation
Additional comments
I think I saw an issue related to
forEach
andvoid
, but I can't seem to find it for nowThe text was updated successfully, but these errors were encountered: