Skip to content

Commit

Permalink
Chore: add autofix npm script (#12330)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo authored and mysticatea committed Sep 29, 2019
1 parent 04b6adb commit 160b7c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile.js
Expand Up @@ -473,12 +473,12 @@ target.all = function() {
target.test();
};

target.lint = function() {
target.lint = function([fix = false] = []) {
let errors = 0,
lastReturn;

echo("Validating JavaScript files");
lastReturn = exec(`${ESLINT} .`);
lastReturn = exec(`${ESLINT}${fix ? "--fix" : ""} .`);
if (lastReturn.code !== 0) {
errors++;
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -10,6 +10,7 @@
"scripts": {
"test": "node Makefile.js test",
"lint": "node Makefile.js lint",
"fix": "node Makefile.js lint -- fix",
"fuzz": "node Makefile.js fuzz",
"generate-release": "node Makefile.js generateRelease",
"generate-alpharelease": "node Makefile.js generatePrerelease -- alpha",
Expand Down

0 comments on commit 160b7c4

Please sign in to comment.