-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
no-extraneous-dependencies: option to allow resolved dependencies #1934
Comments
Can you help me understand why it would be resolveable, but why you wouldn't want it in package.json? |
It's resolvable because I know beforehand that mypackage > pkg2@2.0.0 which is bad because those can confict and it's unnecessary extra bundle size. What I want is mypackage > pkg1 > pkg2@1.0.0 while still being able to configure |
Is there any follow-up? |
@silverwind if one thing requires v1 and another v2, then in fact they are both necessary, and the bundle size increase is as well. If they can be deduped, they should be, and then there'd be no need to alter the linter to cover that. Additionally, pnpm and yarn 2 will refuse to allow you to import pkg2 unless it's in package.json. |
There's certainly modules out there that tend to this pattern, sometimes they expose I'm fine if you want to close this, such modules are generally better avoided in any case. |
I don't think it's actually slim - yarn has overrides, and npm is planning to add them. I'll close this for the time being. Thanks for the discussion! |
I have a case of where
pkg1
depends onpkg2
and I like to importpkg2
to work with it directly without having to add a potentially conflicting/duplicate version ofpkg2
topackage.json
. Suggesting an option likeallowResolved
to no-extraneous-dependencies to not trigger the rule when the imported package is resolvable.The text was updated successfully, but these errors were encountered: