-
Notifications
You must be signed in to change notification settings - Fork 65
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
Rule idea: prefer individual per-function modules #163
Comments
Hi, thanks for opening an issue! |
However, the plugin currently doesn't handle per-function modules, and can only read imports of files from the lodash modules. (e.g. it recognizes |
as you later mentioned:
the I can only speak as a user, but I'm not sure the potential deprecation would have any near term impact on me or my desire for this rule. Its presence on the roadmap doesn't guarantee the per-function modules actually get discontinued. Nor is there any timeline as to when that might even happen. (The roadmap currently mentions ~2017 for v5 but that was clearly optimistic.) Even if the per-function modules are discontinued (which isn't a certainty) and even if it happens this year (which is unlikely), a lot of teams will still be using lodash v3 or v4 for quite some time to come (years, most likely). So this rule would still be valuable (at least to me) for quite some time. Indeed, the discontinuation might even make this rule _more_valuable. If the rule could be implemented in such a way as to be configurable between preferring per-function or rejecting per-function, then the rule would be useful both now in the short term (for current usage) and in the future when migrating to v5. |
That's a good point. |
I would like to but it's unlikely I'll have the time in the next few weeks. |
I went ahead and implemented this. Fixed in |
sweet, thanks!! |
Rule suggestion to prefer
import uniq from 'lodash.uniq';
overimport { uniq } from 'lodash';
to slim bundle sizes and call out explicit uses.The text was updated successfully, but these errors were encountered: