Skip to content

Latest commit

Β 

History

History
30 lines (20 loc) Β· 821 Bytes

File metadata and controls

30 lines (20 loc) Β· 821 Bytes

no-unnecessary-array-flat-depth

πŸ“ Disallow using 1 as the depth argument of Array#flat().

πŸ’Ό This rule is enabled in the following configs: βœ… recommended, β˜‘οΈ unopinionated.

πŸ”§ 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();