From e6728ef06968c15d17bf0582f7b69f2d8698a63e Mon Sep 17 00:00:00 2001 From: Stephen Edgar Date: Sun, 28 Jan 2018 14:14:28 +1100 Subject: [PATCH 1/2] chore: add `lint:fix` ESLint "fix" npm script --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 357695471aa4bd..6cc33d78c5bdf4 100644 --- a/package.json +++ b/package.json @@ -137,6 +137,7 @@ "build": "cross-env BABEL_ENV=default NODE_ENV=production webpack", "gettext-strings": "cross-env BABEL_ENV=gettext webpack", "lint": "eslint .", + "lint:fix": "eslint . --fix", "lint-php": "docker-compose run --rm composer run-script lint", "predev": "check-node-version --package", "dev": "cross-env BABEL_ENV=default webpack --watch", From c524285407f667a233e7e889892352bbba12bee1 Mon Sep 17 00:00:00 2001 From: Stephen Edgar Date: Mon, 29 Jan 2018 11:00:37 +1100 Subject: [PATCH 2/2] docs: Add `npm run lint:fix` docs to `testing-overview.md` --- docs/testing-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/testing-overview.md b/docs/testing-overview.md index 3c09db1615bd31..98065a2b10421b 100644 --- a/docs/testing-overview.md +++ b/docs/testing-overview.md @@ -12,7 +12,7 @@ Assuming you've followed the instructions above to install Node and project depe npm test ``` -Code style in JavaScript is enforced using [ESLint](http://eslint.org/). The above `npm test` will execute both unit tests and code linting. Code linting can be verified independently by running `npm run lint`. +Code style in JavaScript is enforced using [ESLint](http://eslint.org/). The above `npm test` will execute both unit tests and code linting. Code linting can be verified independently by running `npm run lint`. ESLint can also fix not all, but many issues automatically by running `npm run lint:fix`. To run unit tests only, without the linter, use `npm run test-unit` instead.