npm-package-json-lint icon indicating copy to clipboard operation
npm-package-json-lint copied to clipboard

Unable to work with sibling packages

Open dietergeerts opened this issue 5 years ago • 1 comments

When reporting a bug, please include:

  • A little info about your environment

    • npm-package-json-lint version: 5
    • npm version: 6.14.5
    • node version: 12.18
  • The output from npm-package-json-lint

> npmPkgJsonLint ../

path should be a `path.relative()`d string, but got "../client-app-todo/package.json"
npm ERR! Test failed.  See above for more details.

Process finished with exit code 1
  • What you expected to happen That a relative path going upwards works, as I have a mono-repo with rush, where all packages are siblings. I have packages that do linting and testing, and they do this for their siblings.

  • The steps to reproduce the problem Use sibling packages, and set the glob to going up on level.

dietergeerts avatar Jun 26 '20 12:06 dietergeerts

As a workaround, I updated my script to:

    "test": "cd .. && npmPkgJsonLint ./*/package.json --configFile ./tools-linting-npm-package-json-lint/.npmpackagejsonlintrc.json"

But as you see, then you need to do "tricks", and your IDE will not help you anymore. I could also place the config file in the root of the mono-repo, but that feels weird as the purpose of that one package is to run and configure the linting.

dietergeerts avatar Jun 26 '20 13:06 dietergeerts