Skip to content

Commit

Permalink
chore: add lint:fix ESLint "fix" npm script (#4712)
Browse files Browse the repository at this point in the history
* chore: add `lint:fix` ESLint "fix" npm script

* docs: Add `npm run lint:fix` docs to `testing-overview.md`
  • Loading branch information
ntwb authored Jan 29, 2018
1 parent c166dc3 commit 477e27e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/testing-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 477e27e

Please sign in to comment.