Update usage advice of husky to 1.0 (#5071)

Husky had an overhaul of the API, see https://github.com/typicode/husky
Therefore the usage advice here has been adjusted.
This commit is contained in:
Martin Lechner
2018-09-24 22:11:35 +02:00
committed by Joe Haddad
parent 77c32b5631
commit eba5995b3d

View File

@@ -326,13 +326,14 @@ yarn add husky lint-staged prettier
Now we can make sure every file is formatted correctly by adding a few lines to the `package.json` in the project root.
Add the following line to `scripts` section:
Add the following field to the `package.json` section:
```diff
"scripts": {
+ "precommit": "lint-staged",
"start": "react-scripts start",
"build": "react-scripts build",
+ "husky": {
+ "hooks": {
+ "pre-commit": "lint-staged"
+ }
+ }
```
Next we add a 'lint-staged' field to the `package.json`, for example: