eslint-plugin

@masknet/array/no-unneeded-flat-map

Disallow Array#flatMap((x) => x) when simpler alternatives exist

Rule Details

:x: Incorrect

declare const elements: string[][]
elements.flatMap((x) => x)

:white_check_mark: Correct

declare const elements: string[][]
elements.flat()

Attributes