npm-package-json-lint-config-package
raw JSON → 0.1.0 verified Fri May 01 auth: no javascript
Shareable npm-package-json-lint configuration for packages. Version 0.1.0 provides a set of linting rules for package.json files, intended for personal or small-scale use. It extends the base npm-package-json-lint tool (peer dependency >=7.1.0) and requires Node >=18.0.0. The configuration is minimal and can be extended or overridden. The package is maintained by a single author and follows a low release cadence. Key differentiator: purpose-built for packages rather than general projects, but lacks the broad community support of alternatives like stylelint's config.
Common errors
error Cannot find module 'npm-package-json-lint' ↓
cause Peer dependency npm-package-json-lint not installed.
fix
npm install --save-dev npm-package-json-lint@^7.1.0
error Configuration for rule "valid-values-license" is invalid ↓
cause Rule options not compatible with this config; likely a version mismatch.
fix
Ensure npm-package-json-lint is >=7.1.0 and config is latest
Warnings
gotcha Requires npm-package-json-lint >=7.1.0 as a peer dependency; failing to install it will cause the CLI to fail. ↓
fix Run 'npm install --save-dev npm-package-json-lint@^7.1.0'
deprecated Version 0.1.0 is very early; semver-major changes may occur without notice. ↓
fix Pin exact version or use tilde range ~0.1.0
gotcha Configuration is intended for packages; may not be suitable for monorepos or non-package projects. ↓
fix Override rules per project need; see npm-package-json-lint docs
breaking Node >=18.0.0 required; older Node versions will fail. ↓
fix Upgrade Node to >=18.0.0
Install
npm install npm-package-json-lint-config-package yarn add npm-package-json-lint-config-package pnpm add npm-package-json-lint-config-package Imports
- npm-package-json-lint-config-package wrong
import config from 'npm-package-json-lint-config-package' // Not a JS module, config is a JSON referencecorrectNo JavaScript import needed; use in config file: { "extends": "npm-package-json-lint-config-package" } - config object wrong
module.exports = { extends: 'npm-package-json-lint-config-package' } // That would be for a JS config file, but this package doesn't export a JS objectcorrect{ "extends": "npm-package-json-lint-config-package" } - npm-package-json-lint wrong
npm install --save-dev npm-package-json-lint-config-package // Missing peer dep npm-package-json-lintcorrectnpm install --save-dev npm-package-json-lint npm-package-json-lint-config-package
Quickstart
npm install --save-dev npm-package-json-lint npm-package-json-lint-config-package
echo '{"extends":"npm-package-json-lint-config-package"}' > .npmpackagejsonlintrc.json
npx npm-package-json-lint package.json