Skip to content
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

[eslint-plugin-vtex] Create rule to prevent assigning the return value of array methods that mutate the array #78

Open
kaisermann opened this issue Nov 25, 2020 · 1 comment
Labels
enhancement stale This will not be worked on

Comments

@kaisermann
Copy link
Contributor

Is your feature request related to a problem? Please describe.

As posted on slack:

Jay Phelps @_jayphelps
I feel very strongly that array.sort() in JS should 100% of the time be put on it's own line and return value never used. sort() mutates the original array, and returns that same array again, so when chained with functional methods like map/filter/reduce is very bug prone later https://pbs.twimg.com/media/EJnuzRGXkAIPCvB.png

Describe the solution you'd like

Reference: https://github.com/cartant/eslint-plugin-etc/blob/master/source/rules/no-assign-mutated-array.ts

@stale
Copy link

stale bot commented Dec 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
You can add the fresh label to prevent me from taking any action.
If this is a discussion thread, the most voted option will be final. Thank you for your contributions.

@stale stale bot added the stale This will not be worked on label Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement stale This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant