Open jaydenseric opened 4 years ago
As a workaround you can use no-restricted-imports
:
"no-restricted-imports": [
"error",
{
"paths": [
{
// lodash/chaining should catch this, but there's a bug: https://github.com/wix/eslint-plugin-lodash/issues/246
"name": "lodash/chain",
"message": "Do not use lodash/chain, as it breaks tree-shaking. Please nest your calls to lodash."
}
]
}
]
Any updates on this?
The
lodash/chaining
rule doesn’t work when using a deep import, which is a best practice for bundle-size:It only works when
chain
is imported as a named import fromlodash
:Or when
_.chain
is used from the main default import: