Skip to content

Commit

Permalink
Update usage advice of husky to 1.0 (facebook#5071)
Browse files Browse the repository at this point in the history
Husky had an overhaul of the API, see https://github.com/typicode/husky
Therefore the usage advice here has been adjusted.
  • Loading branch information
martinlechner1 authored and Timer committed Sep 24, 2018
1 parent bd3d282 commit 0730c35
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0730c35

Please sign in to comment.