Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TSMMark
Copy link
Contributor

@TSMMark TSMMark commented Oct 15, 2021

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

@coveralls
Copy link

coveralls commented Oct 15, 2021

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

to prevent changing order of operations after fix
@davidbonnet
Copy link

The fix could use optional chaining.

@TSMMark
Copy link
Contributor Author

TSMMark commented Jun 22, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule proposal: forbid use of blacklisted lodash methods
3 participants