eslint-plugin-unicorn
eslint-plugin-unicorn copied to clipboard
Rule proposal: `no-array-unshift-unshift`
Description
unshift
is like push
accept multiple arguments.
Fail
let arr = [];
arr.unshift('foo', 2)
arr.unshift(true)
Pass
let arr = [];
arr.unshift(true, 'foo', 2)
Additional Info
The error message should contain a notice that all elements from the second unshift
call should be placed first.
https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1019#issue-785860890, seems no one interested.
Effectively a duplicate of the issue https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1019