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

manypkg check shouldn't warn to mirror peerDependencies into devDependencies when they're already available in the root's dependencies. #88

Open
threepointone opened this issue Feb 3, 2021 · 5 comments · May be fixed by #101

Comments

@threepointone
Copy link

threepointone commented Feb 3, 2021

That's a long title, but let me explain.

The broad rule that manypkg warns about, is that anything in peerDependencies, should also be in devDependencies. This is reasonable (and imo also correct).

However, in a monorepo (i.e. something using workspaces), root level dependencies are used as a substitute for package level devDependencies. This keeps it easier to keep the versioning of those deps across workspaces simple, and avoids repeating them across workspaces.

Hence my feature request: You shouldn't warn about mirroring peerDependencies and devDependencies if it's already available in a root's dependencies. It should still do a version check ("External Mistmatch" rule), however.

@emmatown
Copy link
Member

emmatown commented Feb 3, 2021

This sounds good, happy to accept a PR for it

@threepointone
Copy link
Author

I will work on this (maybe a little slowly haha), unless someone gets to it before me. Thank you!

@jroebu14
Copy link
Contributor

Hello. I like your suggestion @threepointone but I'm thinking it would make more sense to choose one rule and not allow a combination of both because I think this would mean people would have to arbitrarily decide where to put dependencies - the package devDependencies or the root dependencies.

My thinking was inspired by the "Root has devDependencies" check:

The root package.json of a monorepo is not published so whether a dependency is in devDependencies or dependencies does not make a difference and having one place to put dependencies in the root means that people do not have to arbitrarily decide where a dependency should go every time they install one.

@slavagoreev
Copy link

@threepointone this feature will be highly appreciated!

@steve-taylor
Copy link
Contributor

Not all monorepos that use Manypkg have all dependencies hoisted to the root. I'd like this to be an option to ignore the rule, rather than removing this entirely.

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

Successfully merging a pull request may close this issue.

5 participants