sindresorhus/eslint-plugin-unicorn
The issue has been solved
A case for `prefer-flat-map` #311
tinovyatkin posted onGitHub
I think it will be way greater rule if it will be able to identify legacy (before .flat
got supported) code and suggest to refactor to flatMap
. I believe one of the most common scenario was use of [].concat
with array spread:
[].concat(...someArray.map(fn))
// is the same
someArray.flatMap(fn)