Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 746 Bytes

no-unnecessary-array-flat-depth.md

File metadata and controls

28 lines (19 loc) · 746 Bytes

Disallow using 1 as the depth argument of Array#flat()

💼 This rule is enabled in the ✅ recommended config.

🔧 This rule is automatically fixable by the --fix CLI option.

Passing 1 as the depth argument to Array#flat(depth) is unnecessary.

Examples

// ❌
foo.flat(1);

// ✅
foo.flat();
// ❌
foo?.flat(1);

// ✅
foo?.flat();