Skip to main content

valid-values-type

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

Example .npmpackagejsonlintrc configuration

{
"rules": {
"valid-values-type": ["error", [
"module"
]]
}
}

Rule Details

Incorrect example(s)

{
"type": "commonjs"
}

Correct example(s)

{
"type": "module"
}

Example .npmpackagejsonlintrc configuration

{
"type": [
"commonjs",
"module"
]
}

Rule Details

Incorrect example(s)

{
"type": "type"
}

Correct example(s)

{
"type": "commonjs"
}
{
"type": "module"
}

Shorthand for disabling the rule in .npmpackagejsonlintrc configuration

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

History

  • Introduced in version 7.0.1