eslint-plugin-unicorn
eslint-plugin-unicorn copied to clipboard
Support check `.unshift()` in `no-array-push-push`
no-array-push-push was added in #1015, only check .push(), opening a new issue to see if someone need this.
Fail
foo.unshift(1);
foo.unshift(2);
Pass
const length = foo.unshift(1);
foo.unshift(2);
Note: .unshift() is a little different, need change arguments order, and consider side effects in each call.(.push only consider side effect in second call).
Original issue #937
Sounds good 👍