npm-package-json-lint-config-default
raw JSON → 9.0.1 verified Fri May 01 auth: no javascript
Default shareable configuration for npm-package-json-lint v10, providing a standard set of rules for linting package.json files. Current stable version 9.0.1 requires Node >=22, npm >=10, and npm-package-json-lint ^10.0.0 as a peer dependency. Release cadence is irregular, with breaking changes aligning with peer dependency updates (v4 dropped Node 10/12, v5 required npm-package-json-lint v6, v6 dropped Node 14, v7 dropped Node 16, v8 dropped Node 18, v9 requires Node 22). Key differentiators: authoritative default config from the npm-package-json-lint maintainer; simple extends-based setup; avoid duplicating rule configurations across projects.
Common errors
error Error: Cannot find module 'npm-package-json-lint-config-default' ↓
cause The config package is not installed or missing from node_modules.
fix
Run
npm install --save-dev npm-package-json-lint-config-default. error ReferenceError: module is not defined ↓
cause Using CommonJS require() in an ESM context or incorrect configuration syntax.
fix
Use a JSON config file (.npmpackagejsonlintrc.json) with "extends" field instead of JavaScript module.
error Invalid config: 'npm-package-json-lint-config-default' is not a valid config. ↓
cause The config package is installed but incompatible version (e.g., npm-package-json-lint peer mismatch).
fix
Ensure npm-package-json-lint meets the peerDependency requirements (^10.0.0 for v9.x of this config).
Warnings
breaking Node.js 18 support dropped in v8.0.0 ↓
fix Upgrade Node.js to v20 or later.
breaking Peer dependency npm-package-json-lint bumped to ^10.0.0 in v9.0.0 ↓
fix Update npm-package-json-lint to version 10.x in your project.
breaking Node.js 16 support dropped in v7.0.0 ↓
fix Upgrade Node.js to v18 or later.
breaking Node.js 14 support dropped in v6.0.0 ↓
fix Upgrade Node.js to v16 or later.
breaking Peer dependency npm-package-json-lint bumped to ^7.0.0 in v6.0.0 ↓
fix Update npm-package-json-lint to version 7.x.
breaking Peer dependency npm-package-json-lint bumped to ^6.0.0 in v5.0.0 ↓
fix Update npm-package-json-lint to version 6.x.
Install
npm install npm-package-json-lint-config-default yarn add npm-package-json-lint-config-default pnpm add npm-package-json-lint-config-default Imports
- default config wrong
using require() or import() for the configcorrect"extends": "npm-package-json-lint-config-default"
Quickstart
// 1. Install the linter and this config
npm install --save-dev npm-package-json-lint npm-package-json-lint-config-default
// 2. Create .npmpackagejsonlintrc.json with extends
// .npmpackagejsonlintrc.json
{
"extends": "npm-package-json-lint-config-default"
}
// 3. Run the linter
npx npm-package-json-lint . --configFile .npmpackagejsonlintrc.json