Skip to content

Commit ba74253

Browse files
chore: standardize npm script names per #14827 (#16315)
* chore: standardize npm script names per #14827 * put lint:fix right after lint * chore: fix ordering of :fix Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * chore: change release scripts to have "release:" prefix Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * docs: update package.json naming to include 'release' * docs: add css so abnf code formats okay * chore: exclude linting from npm test * docs: remove counter-reset. I guess that was a merge error Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
1 parent 6a8cd94 commit ba74253

3 files changed

Lines changed: 28 additions & 31 deletions

File tree

Makefile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ target.karma = () => {
632632
};
633633

634634
target.test = function() {
635-
target.lint();
636635
target.checkRuleFiles();
637636
target.mocha();
638637
target.karma();

docs/src/developer-guide/package-json-conventions.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,16 @@ The following applies to the "scripts" section of `package.json` files.
99

1010
npm script names MUST contain only lower case letters, `:` to separate parts, `-` to separate words, and `+` to separate file extensions. Each part name SHOULD be either a full English word (e.g. `coverage` not `cov`) or a well-known initialism in all lowercase (e.g. `wasm`).
1111

12-
Here is a summary of the proposal in EBNF.
13-
14-
```ebnf
15-
name = life-cycle | main ":fix"? target? option* ":watch"?
16-
17-
life-cycle = prepare | preinstall | install | postinstall | prepublish | preprepare | prepare | postprepare | prepack | postpack | prepublishOnly;
18-
19-
main = "build" | "lint" | "start" | "test";
20-
21-
target = ":" word ("-" word)* | extension ("+" extension)*;
22-
23-
option = ":" word ("-" word)*;
24-
25-
word = [a-z]+;
26-
27-
extension = [a-z0-9]+;
12+
Here is a summary of the proposal in ABNF.
13+
14+
```abnf
15+
name = life-cycle / main target? option* ":watch"?
16+
life-cycle = "prepare" / "preinstall" / "install" / "postinstall" / "prepublish" / "preprepare" / "prepare" / "postprepare" / "prepack" / "postpack" / "prepublishOnly"
17+
main = "build" / "lint" ":fix"? / "release" / "start" / "test"
18+
target = ":" word ("-" word)* / extension ("+" extension)*
19+
option = ":" word ("-" word)*
20+
word = ALPHA +
21+
extension = ( ALPHA / DIGIT )+
2822
```
2923

3024
## Order
@@ -41,6 +35,10 @@ Scripts that generate a set of files from source code and / or data MUST have na
4135

4236
If a package contains any `build:*` scripts, there MAY be a script named `build`. If so, SHOULD produce the same output as running each of the `build` scripts individually. It MUST produce a subset of the output from running those scripts.
4337

38+
### Release
39+
40+
Scripts that have public side effects (publishing the web site, committing to Git, etc.) MUST begin with `release`.
41+
4442
### Lint
4543

4644
Scripts that statically analyze files (mostly, but not limited to running `eslint` itself) MUST have names that begin with `lint`.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313
"./use-at-your-own-risk": "./lib/unsupported-api.js"
1414
},
1515
"scripts": {
16+
"build:docs:update-links": "node tools/fetch-docs-links.js",
17+
"release:generate:latest": "node Makefile.js generateRelease",
18+
"release:generate:alpha": "node Makefile.js generatePrerelease -- alpha",
19+
"release:generate:beta": "node Makefile.js generatePrerelease -- beta",
20+
"release:publish": "node Makefile.js publishRelease",
21+
"release:generate:rc": "node Makefile.js generatePrerelease -- rc",
22+
"build:site": "node Makefile.js gensite",
23+
"build:webpack": "node Makefile.js webpack",
24+
"lint": "node Makefile.js lint",
25+
"lint:fix": "node Makefile.js lint -- fix",
26+
"lint:docs:js": "node Makefile.js lintDocsJS",
27+
"lint:fix:docs:js": "node Makefile.js lintDocsJS -- fix",
1628
"test": "node Makefile.js test",
1729
"test:cli": "mocha",
18-
"lint": "node Makefile.js lint",
19-
"lint:docsjs": "node Makefile.js lintDocsJS",
20-
"fix": "node Makefile.js lint -- fix",
21-
"fix:docsjs": "node Makefile.js lintDocsJS -- fix",
22-
"fuzz": "node Makefile.js fuzz",
23-
"generate-release": "node Makefile.js generateRelease",
24-
"generate-alpharelease": "node Makefile.js generatePrerelease -- alpha",
25-
"generate-betarelease": "node Makefile.js generatePrerelease -- beta",
26-
"generate-rcrelease": "node Makefile.js generatePrerelease -- rc",
27-
"publish-release": "node Makefile.js publishRelease",
28-
"gensite": "node Makefile.js gensite",
29-
"webpack": "node Makefile.js webpack",
30-
"perf": "node Makefile.js perf",
31-
"docs:update-links": "node tools/fetch-docs-links.js"
30+
"test:fuzz": "node Makefile.js fuzz",
31+
"test:performance": "node Makefile.js perf"
3232
},
3333
"gitHooks": {
3434
"pre-commit": "lint-staged"

0 commit comments

Comments
 (0)