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. 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",