Enforces the use of the spread operator (...) over
-
Array.from(…)Convert
IterabletoArray.This rule adds on to the built-in prefer-spread rule, which only flags uses of
.apply(). Does not enforce forTypedArray.from(). -
Array#concat(…)Concat an
Arraywith one or moreArray's orArrayelements. -
Array#slice()Shallow copy an
Array.
This rule is partly fixable.
Array.from(set).map(element => foo(element));const array = array1.concat(array2);const copy = array.slice();[...set].map(element => foo(element));const array = [...array1, ...array2];const tail = array.slice(1);const copy = [...array];