-
Notifications
You must be signed in to change notification settings - Fork 1
Configuration
tannerbaum edited this page Feb 26, 2020
·
3 revisions
The scriptlint CLI is configured by either
- CLI command flags or
- a config object that stems from
- a
scriptlint
property inpackage.json
- a
.scriptlintrc
file in JSON or YAML format - a
.scriptlintrc.json
file - a
.scriptlintrc.yaml
,.scriptlintrc.yml
, or.scriptlintrc.js
file - a
scriptlint.config.js
file exporting a JS object
- a
With a combination of both the CLI command flags take precedence!
{
"strict": false,
"fix": false,
"config": false,
"json": false,
"rules": {},
"ignoreScripts": [],
"customRules": []
}
This defines what set of rules will be used. "strict": false
means enabling the minimum ruleset, while "strict": true
uses all of the rules available with their default values. See here for an in-depth explanation of each rule.
Turn a rule on/off like this:
{
"strict": true,
"rules": {
"uses-allowed-namespace": false
}
}
Output the issues in a json format
[
{
"message": "Use of unix double ampersand (&&) in script 'test' is not allowed, consider using npm-run-all/run-s (no-unix-double-ampersand)",
"type": "warning",
"affected": "test"
}
]
Print the config as json for debugging purposes.
🚨 This alters the contents of your package.json
, only use it in a version controlled environment!
Attempt to fix all found issues. Not every rule has a autofix function ready, but some do.
{
"strict": true,
"ignoreScripts": ["my-funny-scriptname"]
}
Scripts in this list will be exempt from linting.
See here.
- Motivation
- The scriptlint "standard" tl;dr
-
The scriptlint "standard"
- Rules enforceable via the scriptlint CLI
- Best practices
- The scriptlint CLI
- Contributing to scriptlint