Skip to content

Commit c2613aa

Browse files
authored
docs: add instructions to use the package installed locally (conventional-changelog#3626)
1 parent e74f1a9 commit c2613aa

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Diff for: README.md

+7
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@ yarn husky install
112112
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
113113
```
114114

115+
**Or use installed package instead**
116+
```
117+
npm pkg set scripts.commitlint="commitlint --edit"
118+
npx husky add .husky/commit-msg 'npm run commitlint ${1}'
119+
```
120+
121+
115122
Check the [husky documentation](https://typicode.github.io/husky/#/?id=manual) on how you can automatically have Git hooks enabled after install for different `yarn` versions.
116123

117124
**Detailed Setup instructions**

Diff for: docs/guides-local-setup.md

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ yarn husky install
4343
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
4444
```
4545

46+
**Or use installed package instead**
47+
```
48+
npm pkg set scripts.commitlint="commitlint --edit"
49+
npx husky add .husky/commit-msg 'npm run commitlint ${1}'
50+
```
51+
4652
**Please note that currently @commitlint/cli doesn't support yarn v2 Plug'n'Play (using yarn v2 with `nodeLinker: node-modules` in your .yarnrc.yml file may work sometimes)**\
4753
Check the [husky documentation](https://typicode.github.io/husky/#/?id=manual) on how you can automatically have Git hooks enabled after install for different `yarn` versions.
4854

0 commit comments

Comments
 (0)