valid-values-engines
Enabling this rule will result in an error being generated if the value in engines
is not equal to one of the values in the array of valid values or if the version range is invalid.
Example .npmpackagejsonlintrc configuration
{
"rules": {
"valid-values-engines": ["error", [
{"node": "^6.0.0"}
]]
}
}
Rule Details
Incorrect example(s)
{
"engines": "^6.0.0"
}
{
"engines": {
"node": "^10.0.0"
}
}
{
"engines": {
"node": "^6.a.0"
}
}
Correct example(s)
{
"engines": {
"node": "^6.0.0"
}
}
Shorthand for disabling the rule in .npmpackagejsonlintrc configuration
{
"rules": {
"valid-values-engines": "off"
}
}
History
- Improved messaging when an invalid configuration is detected in version 6.1.0
- Introduced in version 3.1.0