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

[DISCUSS] lodash get / set should be avoided, we should introduce an eslint rule #75915

Open
mattkime opened this issue Aug 25, 2020 · 1 comment
Labels

Comments

@mattkime
Copy link
Contributor

lodash set and get undermine type safety. This can make refactoring more difficult since changed object paths won't be caught by type checks and code that would otherwise throw will provide defaults or create object paths.

Further, the usefulness of _.get has been reduced by optional chaining and nullish coalescing.

@legrego
Copy link
Member

legrego commented Aug 26, 2020

@watson introduced eslint rules to disallow lodash's set function in #67452, because it is susceptible to prototype pollution. We introduced a safer drop-in replacement for this, but I'm not personally opposed to dropping this altogether either.

I do want to make sure that we aren't making life difficult for other teams though -- I'd rather support our custom, "safer" set function than have a developer add another similar dependency that flies under the radar, which in turn ends up breaking type safety and/or is vulnerable itself.

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

No branches or pull requests

2 participants