eslint-plugin-lodash
eslint-plugin-lodash copied to clipboard
Rule suggestion: detect _.filter(...).each wrong usages
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