-
-
Notifications
You must be signed in to change notification settings - Fork 211
Add getEach
to map
autofixer for no-array-prototype-extensions
rule
#1632
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
Conversation
@bmish Please help review this PR as well. Thank you! |
getEach
to map
autofixer for no-array-prototype-extensions rulegetEach
to map
autofixer for no-array-prototype-extensions
rule
@tgvrssanthosh can you fix the merge conflict? |
@tgvrssanthosh amazing work so far, a few questions:
|
@bmish Resolved merge conflicts. Can you please take a look? |
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.
Thanks!
@bmish I don't think we can write autofixers for mutation methods. As mutation methods are linked to reactivity, we need to rely on |
@bmish Since we came up with autofixers for all the functions other than mutation methods, I believe we can release a minor version. |
@tgvrssanthosh can we still handle |
@bmish Even |
@tgvrssanthosh got it. I'll plan to release everything today along with #1395 as soon as I can get it merged. |
@tgvrssanthosh can you add a note to the rule doc explaining that everything is autofixable except MutableArray methods and firstObject/lastObject with a brief explanation of why and link to documentation about why it's unsafe? |
Summary
Added auto-fixer for
no-array-prototype-extensions
which replacesgetEach
withmap
.Description
Recently, the proposal to deprecate array prototype extensions has been approved and got merged. The plan is to add autoFixers to replace ember array prototype extensions with the native array methods. In this PR, an auto fixer has been added which will replace the ember array method
getEach
with the native array methodmap
.Testing
Modified test case to check if the right output is generated after the fix.