Skip to content

scripts-name-casing

💼 This rule is enabled in the 🎨 stylistic config.

💡 This rule is manually fixable by editor suggestions.

This rule enforces that the keys of the scripts object (representing the commands for each script) should be in kebab case (e.g. "my-script"). It also permits kebab case segments separated by colons (e.g. "test:my-script").

{
"scripts": {
"invalidName": "node ./scripts/build.js",
"another:invalidCommand": "node ./scripts/another.js"
}
}
Name Description Type
ignoreNames Specific script names to ignore. Array
ignorePatterns Regex patterns for script names to ignore. Array

Define an array of specific script names that should be ignored by this rule.

{
"scripts-name-casing": [
"error",
{
"ignoreNames": ["myCustomScript", "anotherScript"]
}
]
}

Define an array of regex patterns that should be ignored by this rule.

{
"scripts-name-casing": [
"error",
{
"ignorePatterns": ["^myCustom.*", ".*Script$"]
}
]
}