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

Replace _.uniq with native #1687

Merged
merged 2 commits into from Jan 11, 2022
Merged

Replace _.uniq with native #1687

merged 2 commits into from Jan 11, 2022

Conversation

XhmikosR
Copy link
Contributor

@XhmikosR XhmikosR commented Jan 10, 2022

At some point, it might be worth trying to replace the other lodash functions too, they should be ~ 6 cases only.

@XhmikosR XhmikosR marked this pull request as ready for review January 10, 2022 15:42
@XhmikosR
Copy link
Contributor Author

This is the list of the remaining lodash function:

  1. camelCase
  2. kebabCase
  3. snakeCase
  4. defaultsDeep
  5. get
  6. lowerFirst
  7. pick
  8. upperFirst

lowerFirst and upperFirst should be easy to replace later if someone wants to try :)

@sindresorhus sindresorhus merged commit 3c00345 into sindresorhus:main Jan 11, 2022
@sindresorhus
Copy link
Owner

I don't really see the need to replace Lodash functions unless it's super easy to write it in plain JS. In this case, it is. But in many of the mentioned cases, it's not.

@XhmikosR XhmikosR deleted the patch-2 branch January 11, 2022 07:05
@XhmikosR
Copy link
Contributor Author

I know, I know, I'm just saying we should keep in mind the deps while not totally reinventing the wheel. lodash is currently the biggest dependency of eslint-plugin-unicorn, and while it's probably used by other dependencies, it's always good to try to reduce the footprint.

Just my 2 cents.

@fisker
Copy link
Collaborator

fisker commented Jan 14, 2022

We can replace lodash with lodash.* packages.

@XhmikosR
Copy link
Contributor Author

IIRC the individual packages are considered deprecated. I still use them for small things, though, and many others do.

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.

None yet

3 participants