Open threepointone opened 3 years ago
This sounds good, happy to accept a PR for it
I will work on this (maybe a little slowly haha), unless someone gets to it before me. Thank you!
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.
@threepointone this feature will be highly appreciated!
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.
That's a long title, but let me explain.
The broad rule that manypkg warns about, is that anything in
peerDependencies
, should also be indevDependencies
. 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 leveldevDependencies
. 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
anddevDependencies
if it's already available in a root'sdependencies
. It should still do a version check ("External Mistmatch" rule), however.