Skip to content

Conversation

tgvrssanthosh
Copy link
Contributor

Summary

Added auto-fixer for no-array-prototype-extensions which replaces uniqBy with reduce.

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 uniqBy with the native array method reduce.

Testing

Modified test case to check if the right output is generated after the fix.

@tgvrssanthosh tgvrssanthosh marked this pull request as ready for review October 10, 2022 17:00
@tgvrssanthosh
Copy link
Contributor Author

@bmish Can you help review this PR?

@tgvrssanthosh
Copy link
Contributor Author

@bmish Addressed your comments. Please take a relook. Thank you!

Copy link
Member

@bmish bmish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This autofix output is a bit complicated -- maybe we can follow-up to improve that if a simpler solution becomes available.

@bmish bmish merged commit 2075e67 into ember-cli:master Oct 11, 2022
@tgvrssanthosh
Copy link
Contributor Author

Thanks! This autofix output is a bit complicated -- maybe we can follow up to improve that if a simpler solution becomes available.

Agreed. It looks a bit complex. We might have to revisit this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants