no-unnecessary-array-flat-depth
March 27, 2026 ยท View on GitHub
๐ 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();