Rules
Rules allow npm-package-json-lint to be fully customizable. npm-package-json-lint will only run the rules supplied. As of v2.7.0, there are multiple ways to supply configuration. One of the easiest way is via a .npmpackagejsonlintrc.json file. Please see the default config module, npm-package-json-lint-config-default instead.
Require node rules
Generates an error if node is missing from package.json file
- require-author
- require-bin
- require-bugs
- require-bundledDependencies
- require-config
- require-contributors
- require-cpu
- require-dependencies
- require-description
- require-devDependencies
- require-directories
- require-engines
- require-files
- require-funding
- require-homepage
- require-keywords
- require-license
- require-main
- require-man
- require-module
- require-name
- require-optionalDependencies
- require-os
- require-peerDependencies
- require-preferGlobal
- require-private
- require-publishConfig
- require-repository-directory
- require-repository
- require-scripts
- require-type
- require-types
- require-typings
- require-version
Type rules
Generates an error if node's value doesn't have the correct data type
- bin-type
- bundledDependencies-type
- config-type
- cpu-type
- dependencies-type
- description-type
- devDependencies-type
- directories-type
- engines-type
- files-type
- homepage-type
- keywords-type
- license-type
- main-type
- man-type
- name-type
- optionalDependencies-type
- os-type
- peerDependencies-type
- preferGlobal-type
- private-type
- repository-type
- scripts-type
- type-type
- version-type
Valid value rules
Generates an error if node's value doesn't match one of the values in the supplied array
- valid-values-author
- valid-values-engines
- valid-values-license
- valid-values-name-scope
- valid-values-private
- valid-values-publishConfig
- valid-values-type
Dependency rules
Generates an error if dependencies fail to meet the rules requirements
-
dependencies
- no-absolute-version-dependencies
- no-archive-dependencies
- no-caret-version-dependencies
- no-file-dependencies
- no-git-dependencies
- no-restricted-dependencies
- no-restricted-pre-release-dependencies
- no-tilde-version-dependencies
- prefer-absolute-version-dependencies
- prefer-alphabetical-dependencies
- prefer-caret-version-dependencies
- prefer-no-version-zero-dependencies
- prefer-tilde-version-dependencies
-
devDependencies
- no-absolute-version-devDependencies
- no-archive-devDependencies
- no-caret-version-devDependencies
- no-file-devDependencies
- no-git-devDependencies
- no-restricted-devDependencies
- no-restricted-pre-release-devDependencies
- no-tilde-version-devDependencies
- prefer-absolute-version-devDependencies
- prefer-alphabetical-devDependencies
- prefer-caret-version-devDependencies
- prefer-no-version-zero-devDependencies
- prefer-tilde-version-devDependencies
-
bundledDependencies
-
optionalDependencies
-
peerDependencies
Scripts rules
Generates an error if scripts fail to meet the rules requirements
Format rules
Generates an error if node's value fails to meet the format requirements
Package.json property rules
Generates an error if the package.json properties fail to meet the desired requirements
Disallowed node rules
Generates an error if the node is present