eslint-plugin-lodash icon indicating copy to clipboard operation
eslint-plugin-lodash copied to clipboard

Rule suggestion: detect _.filter(...).each wrong usages

Open Lucas-C opened this issue 6 years ago • 0 comments

Hi.

On an application that was using both lodash & UnderscoreJS (sigh) I switched to only using lodash.

Then I realized I kept some pieces of code that where using UnderscoreJS ability to chain those operations like this:

_(list).filter(() => true).each(...)

Which became after my erroneous refactoring:

_.filter(list, () => true).each(...)

Do you think it could be possible to detect the use of .each or .forEach on the value returned by lodash _.filter & _.map functions ?

If so I am willing to contribute such rule with a PR

Lucas-C avatar May 16 '19 14:05 Lucas-C