From 559831d08eadbda644ba6299a562c245316fa2e4 Mon Sep 17 00:00:00 2001 From: Gilles Debunne Date: Sun, 21 Oct 2018 17:28:19 +0200 Subject: [PATCH] Update husky integration code for husky v1.0.0 (#5266) Latest husky (version 1.0.0) moved its hooks config from the `scripts` field to a new `husky` field in `package.json` ([ChangeLog](https://github.com/typicode/husky/blob/master/CHANGELOG.md)). The `scripts` syntax described here, although shorter, will be deprecated soon. This change replaces it with the new husky syntax. The new syntax is already used in [precommit.md](https://github.com/prettier/prettier/blob/master/docs/precommit.md). --- website/pages/en/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/website/pages/en/index.js b/website/pages/en/index.js index 13da0bf3d..ac3ee206d 100755 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -298,11 +298,13 @@ class GetStartedSection extends React.Component { {bash`npm install pretty-quick husky --save-dev`} - Then edit package.json: + Then add this config to package.json: {json({ - scripts: { - precommit: "pretty-quick --staged" + husky: { + hooks: { + "pre-commit": "pretty-quick --staged" + } } })}