Skip to content

Commit 979d87c

Browse files
Amadou Sallescapedcat
Amadou Sall
authored andcommitted
docs: update local setup guide with latest version of husky (conventional-changelog#489)
1 parent 2e7e34d commit 979d87c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docs/guides-local-setup.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,20 @@ Install `husky` as devDependency, a handy git hook helper available on npm.
2828
npm install --save-dev husky
2929
```
3030

31-
This allows us to add [git hooks](https://github.com/typicode/husky/blob/master/HOOKS.md#hooks) directly into our `package.json` scripts.
31+
This allows us to add [git hooks](https://git-scm.com/docs/githooks) directly into our `package.json` via the `husky.hooks` field.
3232

3333
```json
34+
// package.json
3435
{
35-
"scripts": {
36-
"commitmsg": "commitlint -E GIT_PARAMS"
36+
"husky": {
37+
"hooks": {
38+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
39+
}
3740
}
3841
}
3942
```
4043

41-
Using `commitmsg` gives us exactly what we want: It is executed whenever a new commit is created. Passing husky's `GIT_PARAMS` to `commitlint` via the `-E|--env` flag directs it to the relevant edit file. `-e` would default to `.git/COMMIT_EDITMSG`.
44+
Using `commit-msg` gives us exactly what we want: It is executed whenever a new commit is created. Passing husky's `HUSKY_GIT_PARAMS` to `commitlint` via the `-E|--env` flag directs it to the relevant edit file. `-e` would default to `.git/COMMIT_EDITMSG`.
4245

4346
## Test
4447

0 commit comments

Comments
 (0)