Skip to main content

valid-values-license

Enabling this rule will result in an error being generated if the value in license is not equal to one of the values in the array of valid values.

Example .npmpackagejsonlintrc configuration

{
"rules": {
"valid-values-license": ["error", [
"private",
"unlicensed"
]]
}
}

Rule Details

Incorrect example(s)

{
"license": "MIT"
}

Correct example(s)

{
"license": "private"
}
{
"license": "unlicensed"
}

Shorthand for disabling the rule in .npmpackagejsonlintrc configuration

{
"rules": {
"valid-values-license": "off"
}
}

History

  • Improved messaging when an invalid configuration is detected in version 6.1.0
  • Introduced in version 1.4.0