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 package.json in monorepo not checked? #308

Open
lautarodragan opened this issue Jul 9, 2020 · 0 comments
Open

Root package.json in monorepo not checked? #308

lautarodragan opened this issue Jul 9, 2020 · 0 comments

Comments

@lautarodragan
Copy link

I'm running npm-package-json-lint, version 5.1.0 in a monorepo that has a root package.json and then several projects under a packages directory, each with their own package.json file.

I added a "lint-package-json": "npmPkgJsonLint ." script to the root package.json and ran yarn lint-package-json from the root, but it's only reporting issues with the children package.json files, ignoring the root one.

$ node -v
v14.4.0
$ npm -v
6.14.5
$ yarn -v
1.22.4

$ cat .npmpackagejsonlintrc.json 
{
  "rules": {
    "prefer-absolute-version-dependencies": "error"
  }
}
$ yarn lint-package-json
yarn run v1.22.4
$ npmPkgJsonLint .

./packages/backend/api/package.json
✖ prefer-absolute-version-dependencies - node: dependencies - You are using an invalid version range. Please use absolute versions.
1 error
0 warnings

./packages/backend/serverless/package.json
✖ prefer-absolute-version-dependencies - node: dependencies - You are using an invalid version range. Please use absolute versions.
1 error
0 warnings

./packages/frontend/admin/package.json
✖ prefer-absolute-version-dependencies - node: dependencies - You are using an invalid version range. Please use absolute versions.
1 error
0 warnings

./packages/frontend/catalog/package.json
✖ prefer-absolute-version-dependencies - node: dependencies - You are using an invalid version range. Please use absolute versions.
1 error
0 warnings

./packages/frontend/editor/package.json
✖ prefer-absolute-version-dependencies - node: dependencies - You are using an invalid version range. Please use absolute versions.
1 error
0 warnings

./packages/frontend/figma-plugin/package.json
✖ prefer-absolute-version-dependencies - node: dependencies - You are using an invalid version range. Please use absolute versions.
1 error
0 warnings

./packages/frontend/next-shared/package.json
✖ prefer-absolute-version-dependencies - node: dependencies - You are using an invalid version range. Please use absolute versions.
1 error
0 warnings

Totals
7 errors
0 warnings
0 files ignored
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Nothing's reported about the root package.json, even though it does contain a few dependencies that use invalid version ranges.

Am I using npm-package-json-lint incorrectly? How do I get it to lint the root package.json?

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

1 participant