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

New rule: prefer-native-method (Fixes #221)

Open TSMMark opened this issue 4 years ago • 3 comments

Fixes #221

The new rule in its current state in this branch only works with map as a proof of concept.

The fix for this rule is unsafe as _.map() can accept any collection and not only Array. So it has the potential to break code such as:

_.map({ a: 'c', b: 'd' }, (v, k) => whatever(v, k))

Open to feedback about how to get this rule actually in a state where it could be merged. Thanks

TSMMark avatar Oct 15 '21 17:10 TSMMark

Pull Request Test Coverage Report for Build 717

  • 10 of 10 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.05%) to 99.947%

Totals Coverage Status
Change from base Build 715: -0.05%
Covered Lines: 1009
Relevant Lines: 1009

💛 - Coveralls

coveralls avatar Oct 15 '21 17:10 coveralls

The fix could use optional chaining.

davidbonnet avatar Jun 22 '22 12:06 davidbonnet

I'm not putting any effort into a PR that's been open since 2021 with no attention, but you can go ahead if you want

TSMMark avatar Jun 22 '22 23:06 TSMMark