Skip to main content

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

Type rules

Generates an error if node's value doesn't have the correct data type

Valid value rules

Generates an error if node's value doesn't match one of the values in the supplied array

Dependency rules

Generates an error if dependencies fail to meet the rules requirements

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