Skip to content

Commit eba5995

Browse files
martinlechner1Timer
authored andcommitted
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.
1 parent 77c32b5 commit eba5995

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/react-scripts/template/README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,14 @@ yarn add husky lint-staged prettier
326326

327327
Now we can make sure every file is formatted correctly by adding a few lines to the `package.json` in the project root.
328328

329-
Add the following line to `scripts` section:
329+
Add the following field to the `package.json` section:
330330

331331
```diff
332-
"scripts": {
333-
+ "precommit": "lint-staged",
334-
"start": "react-scripts start",
335-
"build": "react-scripts build",
332+
+ "husky": {
333+
+ "hooks": {
334+
+ "pre-commit": "lint-staged"
335+
+ }
336+
+ }
336337
```
337338

338339
Next we add a 'lint-staged' field to the `package.json`, for example:

0 commit comments

Comments
 (0)