Skip to main content

valid-values-publishConfig

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

Example .npmpackagejsonlintrc configuration

{
"rules": {
"valid-values-publishConfig": ["error", [
{"access": "public"}
]]
}
}

Rule Details

Incorrect example(s)

{
"publishConfig": "public"
}
{
"publishConfig": {
"access": "private"
}
}

Correct example(s)

{
"publishConfig": {
"access": "public"
}
}

Shorthand for disabling the rule in .npmpackagejsonlintrc configuration

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

History

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