Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 455 Bytes

no-array-push-push.md

File metadata and controls

29 lines (21 loc) · 455 Bytes

Enforce combining multiple Array#push() into one call

Array#push() accepts multiple arguments. Multiple calls should be combined into one.

This rule is partly fixable.

Fail

foo.push(1);
foo.push(2, 3);

Pass

foo.push(1, 2, 3);
const length = foo.push(1);
foo.push(2);
foo.push(1);
bar();
foo.push(2);