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").
Examples
Section titled “Examples”{ "scripts": { "invalidName": "node ./scripts/build.js", "another:invalidCommand": "node ./scripts/another.js" }}{ "scripts": { "valid-command": "node ./scripts/build.js", "another:valid-command": "node ./scripts/another.js" }}Options
Section titled “Options”| Name | Description | Type |
|---|---|---|
ignoreNames |
Specific script names to ignore. | Array |
ignorePatterns |
Regex patterns for script names to ignore. | Array |
ignoreNames
Section titled “ignoreNames”Define an array of specific script names that should be ignored by this rule.
{ "scripts-name-casing": [ "error", { "ignoreNames": ["myCustomScript", "anotherScript"] } ]}ignorePatterns
Section titled “ignorePatterns”Define an array of regex patterns that should be ignored by this rule.
{ "scripts-name-casing": [ "error", { "ignorePatterns": ["^myCustom.*", ".*Script$"] } ]}Related Rules
Section titled “Related Rules”require-scripts- Enforces that thescriptsproperty is present.valid-scripts- Enforces that thescriptsproperty is valid.bin-name-casing- Enforces that keys ofbinare in kebab case.