Skip to content

Commit 08f1940

Browse files
ohaddahanfisker
andauthored
Update install script for husky v9 (#16000)
Co-authored-by: fisker Cheung <[email protected]>
1 parent 6d0b1d2 commit 08f1940

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

docs/install.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,16 @@ For example, you can do the following to have Prettier run before each commit:
121121

122122
```bash
123123
npm install --save-dev husky lint-staged
124-
npx husky install
125-
npm pkg set scripts.prepare="husky install"
126-
npx husky add .husky/pre-commit "npx lint-staged"
124+
npx husky init
125+
node --eval "fs.writeFileSync('.husky/pre-commit','npx lint-staged\n')"
127126
```
128127

129128
<!--yarn-->
130129

131130
```bash
132131
yarn add --dev husky lint-staged
133-
npx husky install
134-
npm pkg set scripts.prepare="husky install"
135-
npx husky add .husky/pre-commit "npx lint-staged"
132+
npx husky init
133+
node --eval "fs.writeFileSync('.husky/pre-commit','npx lint-staged\n')"
136134
```
137135

138136
> 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:
141139

142140
```bash
143141
pnpm add --save-dev husky lint-staged
144-
pnpm exec husky install
145-
npm pkg set scripts.prepare="husky install"
146-
pnpm exec husky add .husky/pre-commit "pnpm exec lint-staged"
142+
npx husky init
143+
node --eval "fs.writeFileSync('.husky/pre-commit','pnpm exec lint-staged\n')"
147144
```
148145

149146
<!--END_DOCUSAURUS_CODE_TABS-->

0 commit comments

Comments
 (0)