From eba5995b3db35d91d2bd5826abc9b3d5729bc58d Mon Sep 17 00:00:00 2001 From: Martin Lechner Date: Mon, 24 Sep 2018 22:11:35 +0200 Subject: [PATCH] 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. --- packages/react-scripts/template/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index 05c41008..4267cebb 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -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: