Skip to main content

preferGlobal-type

Enabling this rule will result in an error being generated if the value in preferGlobal is not a boolean.

Example .npmpackagejsonlintrc configuration

{
"rules": {
"preferGlobal-type": "error"
}
}

Rule Details

Incorrect example(s)

{
"preferGlobal": 1
}
{
"preferGlobal": ["true"]
}
{
"preferGlobal": "true"
}
{
"preferGlobal": {
"enabled": "true"
}
}

Correct example(s)

{
"preferGlobal": true
}

History

  • Introduced in version 0.1.0