Skip to main content

valid-values-author

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

Example .npmpackagejsonlintrc configuration

{
"rules": {
"valid-values-author": ["error", [
"Thomas",
"Thomas Lindner"
]]
}
}

Rule Details

Incorrect example(s)

{
"author": "Lindner"
}
{
"author": {
"name": "Lindner"
}
}

Correct example(s)

{
"author": "Thomas"
}
{
"author": {
"name": "Thomas"
}
}
{
"author": "Thomas Lindner"
}
{
"author": {
"name": "Thomas Lindner"
}
}

Shorthand for disabling the rule in .npmpackagejsonlintrc configuration

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

History

  • Improved messaging when an invalid configuration is detected in version 6.1.0
  • Renamed from author-valid-values to valid-values-author in version 1.0.0
  • Introduced in version 0.1.0