Skip to main content

Open source · MIT License

npm-package-json-lint

A configurable linter for package.json files

npm install --save-dev npm-package-json-lint
npm-package-json-lint logo

Lint every package.json in seconds

Pick the rules you care about, run the CLI, and get clear errors and warnings.

.npmpackagejsonlintrc.json

{
  "rules": {
    "require-license": "error",
    "require-repository": "error",
    "no-caret-version-dependencies": "warning"
  }
}

Terminal

$ npmPkgJsonLint .

./package.json
ERROR require-license - node: license - license is required
WARNING no-caret-version-dependencies - node: dependencies - Please do not use ^
1 error
1 warning

Configurable rules

Rules allow you to tailor your desired file format.

Browse the rules

Monorepo support

npm-package-json-lint is capable of scanning projects with multiple package.json files.

Lint a monorepo

Ready to tidy up your package.json files?

Check out the documentation to learn more.

Read the docs

Graphic design by Isak Knivsland. Thanks for the great illustrations!