This plugin contains rules for maintaining a valid, consistent package.json
dependency setup.
npm install --save-dev eslint eslint-plugin-package-json-dependencies
- Add the plugin and its parser to your eslint config file
overrides
section:
// eslintrc.json
{
"overrides": [
{
"files": ["*.json"],
"parser": "eslint-plugin-package-json-dependencies",
"plugins": ["package-json-dependencies"]
}
]
}
- Apply the specific rules applicable to your repo, e.g.:
// eslintrc.json
{
"rules": {
"package-json-dependencies/no-missing-types": "error"
}
}
- no-missing-types
- alphabetically-sorted-dependencies
- controlled-versions
- better-alternative
- valid-versions
- duplicate-dependencies
npm install
npm test
npm run format