Skip to content

Commit 763085c

Browse files
Manubiescapedcat
andauthored
add husky v5 example setup code for HUSKY_GIT_PARAMS (#2340)
* add husky v5 example Hi, i just added the husky v5 example. https://typicode.github.io/husky/#/?id=husky_git_params-ie-commitlint- cheers * docs: linting Co-authored-by: hannes <[email protected]>
1 parent db0251c commit 763085c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Diff for: README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ To lint commits before they are created you can use Husky's 'commit-msg' hook.
9797

9898
Install in your project `npm install husky --save-dev` or `yarn add -D husky`.
9999

100-
After that, you can create a `.huskyrc` file or add to your `package.json` the following code:
100+
After that, you can create a `.huskyrc` file or add to your `package.json` the following code for
101+
102+
Husky V4:
101103

102104
```json
103105
{
@@ -109,6 +111,16 @@ After that, you can create a `.huskyrc` file or add to your `package.json` the f
109111
}
110112
```
111113

114+
Husky V5
115+
116+
```
117+
# .husky/pre-commit
118+
# ...
119+
npx --no-install commitlint --edit $1
120+
# or
121+
yarn commitlint --edit $1
122+
```
123+
112124
**Detailed Setup instructions**
113125

114126
- [Local setup](https://conventional-changelog.github.io/commitlint/#/guides-local-setup) - Lint messages on commit with husky

0 commit comments

Comments
 (0)