-
Notifications
You must be signed in to change notification settings - Fork 1
natural order
Moritz Jacobs edited this page Sep 18, 2020
·
2 revisions
This rule is fixable ✓
This rule is optional!
Scripts can be sorted in what we consider a "natural order", so pre*
/post*
hooks are grouped with their callers – the rest is alphabetical:
{
"prebuild": "foo",
"build": "foo",
"build:cleanup": "bar",
"postbuild": "foo",
"publish": "ok",
"prepublishOnly": "else",
"pretest": "baz",
"test": "jest",
"test:lint": "baz",
"posttest": "baz",
"update": "foo",
"update:dependencies": "updtr",
"update:typings": "something"
}
For this optional rule to work, you must turn it on and disable alphabetic-order in your config:
{
"strict": true,
"rules": {
"alphabetic-order": false,
"natural-order": true
}
}
- Motivation
- The scriptlint "standard" tl;dr
-
The scriptlint "standard"
- Rules enforceable via the scriptlint CLI
- Best practices
- The scriptlint CLI
- Contributing to scriptlint