Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 411 Bytes

prefer-spread.md

File metadata and controls

19 lines (11 loc) · 411 Bytes

Prefer the spread operator over Array.from()

Enforces the use of the spread operator over Array.from(). This rule adds on to the built-in prefer-spread rule, which only flags uses of .apply(). Does not enforce for TypedArray.from();

This rule is fixable.

Fail

Array.from(set).map(() => {});

Pass

[...set].map(() => {});