When using _.map
and _.flatten
, it can be more concise to use _.flatMap
instead.
This rule takes no arguments.
The following patterns are considered warnings:
_(a).map(f).flatten().value();
t = _.flatten(_.map(a, f));
The following patterns are not considered warnings:
t = _.map(a, f);
t = _.flatMap(a, f);
This rule is only relevant for Lodash 4. If you don't use Lodash 4, you should not use this rule.
If you do not want to enforce using _.flatMap
, and prefer _.map
and _.flatten
instead, you should not use this rule.