r/reactjs • • Aug 13 '24

Resource Remove Garbage NPM Packages with eslint-plugin-depend

https://www.trevorlasn.com/blog/eslint-plugin-depend

[removed] — view removed post

0 Upvotes

1 comment sorted by

3

u/byt4lion Aug 13 '24 edited Aug 13 '24

Maybe I misunderstanding but your isNumber alternative is does not produce the same outcome as the package version. So wouldn’t this eslint potentially break my code? If so that’s an absolute no no.

The package version “5” returns true. So if I want to test if a string is a number - I can use it for that.

Edit: nvm I see the lint wants you to basically do the same as the package but inline it.

Edit for actual comments: I’m not sure suggesting alternative implementations to packages is really the best the thing - it definitely doesn’t feel like a lint thing.

What I think would be amazing is the lint suggested built in alternatives for like for like functionality. For example groupBy is now available. So _.groupBy should be discouraged.