Open meowtec opened 3 years ago
Neither of those are actually tree-shaking friendly, because they both necessitate tree-shaking. The best choice is to deep import exactly what you need, and never touch the default bag-o-things at all.
Separately, it seems like lodash-es shouldn’t be providing both named and default exports - doing that is definitely not something many packages do and is absolutely an antipattern. However, Babel import interop does allow doing both, this is true.
Many packages support both "tree shacking friendly" exports style and "legacy" exports style, like this:
vs
Need a rule to disable the second one.
Example
Options:
valid:
invalid:
Draft implement: https://github.com/meowtec/eslint-plugin-import/tree/feat/no-specific-imports