-
-
Notifications
You must be signed in to change notification settings - Fork 353
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance no-array-for-each
to handle optional chaining
#1753
Enhance no-array-for-each
to handle optional chaining
#1753
Conversation
Tests are not enough, please duplicate all these cases
?. and test them all.
|
This comment was marked as outdated.
This comment was marked as outdated.
Forget about the indention, let other rule handle it, even if (foo) for (const returnStatement of returnStatements) {
// ...
} is fine to me. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
# Conflicts: # rules/no-array-for-each.js # test/snapshots/no-array-for-each.mjs.md # test/snapshots/no-array-for-each.mjs.snap
@zaicevas Please take a look, please let me know if you find something wrong. |
|
I'll take a look later today |
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.
Looks much cleaner! I cracked my head trying to understand why you removed most tests. Then I finally found flatMap(code => [code, code.replace('.forEach', '?.forEach')]),
馃槄
Thanks for contributing :) |
Closes #1632
That's my first contribution, so let me know if I missed anything 馃槄