Skip to main content

scripts-type

Enabling this rule will result in an error being generated if the value in scripts is not an object or any of the individual scripts aren't strings.

Example .npmpackagejsonlintrc configuration

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

Rule Details

Incorrect example(s)

{
"scripts": 1
}
{
"scripts": ["install", "bower install"]
}
{
"scripts": "install: bower install"
}
{
"scripts": {
"myscript": false
}
}
{
"scripts": {
"myscript": {
"start": "node index.js"
}
}
}

Correct example(s)

{
"scripts": {
"install": "bower install"
}
}

History

  • Enhanced to validate that individual scripts are strings in version 3.0.0
  • Introduced in version 0.1.0