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

"Root has devDependencies" #114

Open
theKashey opened this issue Sep 17, 2021 · 3 comments
Open

"Root has devDependencies" #114

theKashey opened this issue Sep 17, 2021 · 3 comments

Comments

@theKashey
Copy link

I would like to raise a concern about this rule mostly due to the problem with npm audit and the general expectation of some underlaying tools that only dependencies should be scanned for vulnerabilities.

Still creates a huge room for some uncertainly of decision which dep should do where, but I would like to have this rule configurable.

@Offirmo
Copy link

Offirmo commented May 1, 2022

I agree with this. The "Root has devDependencies" is too opiniated.

@Offirmo
Copy link

Offirmo commented May 1, 2022

Also the main reason "The root package.json of a monorepo is not published" is incorrect. There are many uses in having root dependencies or not, in prod or dev. Examples:

  • I deploy a portion of my monorepo through Netlify, which insists on installing prod dependencies even when not needed
  • I have build scripts which requires a few core modules to be installed.

Hence my need for "devDependencies" and not "dependencies".

@steve-taylor
Copy link
Contributor

steve-taylor commented Jul 9, 2022

I second this, but would prefer to see this as an option, defaulting to the current behaviour. This would then necessitate another rule for those of us who use Bolt: Ensure that any dependency in a sub-package that's in dependencies is in the root package.json's dependencies, and the same for devDependencies. This would be mutually exclusive with the "Root has devDependencies" rule and perhaps only active for monorepo package managers that require all dependencies be declared in the root. (Bolt is the only one that I know about.) Having said that, I'm aware that @mitchellhamilton recommends Yarn workspaces over Bolt.

My use case: I'm Dockerizing a Next.js app in the monorepo and I want to exclude devDependencies for a smaller Docker image. I have to Dockerize from the root because of symlinks.

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

No branches or pull requests

3 participants