From 08f19401e48ccfeddff4300827da4c8677cb2b79 Mon Sep 17 00:00:00 2001 From: ohaddahan Date: Sat, 3 Feb 2024 14:44:32 +0200 Subject: [PATCH] Update install script for husky v9 (#16000) Co-authored-by: fisker Cheung --- docs/install.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/docs/install.md b/docs/install.md index c3af5d6d1b93..509f3a93a88e 100644 --- a/docs/install.md +++ b/docs/install.md @@ -121,18 +121,16 @@ For example, you can do the following to have Prettier run before each commit: ```bash npm install --save-dev husky lint-staged - npx husky install - npm pkg set scripts.prepare="husky install" - npx husky add .husky/pre-commit "npx lint-staged" + npx husky init + node --eval "fs.writeFileSync('.husky/pre-commit','npx lint-staged\n')" ``` ```bash yarn add --dev husky lint-staged - npx husky install - npm pkg set scripts.prepare="husky install" - npx husky add .husky/pre-commit "npx lint-staged" + npx husky init + node --eval "fs.writeFileSync('.husky/pre-commit','npx lint-staged\n')" ``` > If you use Yarn 2, see https://typicode.github.io/husky/#/?id=yarn-2 @@ -141,9 +139,8 @@ For example, you can do the following to have Prettier run before each commit: ```bash pnpm add --save-dev husky lint-staged - pnpm exec husky install - npm pkg set scripts.prepare="husky install" - pnpm exec husky add .husky/pre-commit "pnpm exec lint-staged" + npx husky init + node --eval "fs.writeFileSync('.husky/pre-commit','pnpm exec lint-staged\n')" ```