Skip to content

Commit 499efd1

Browse files
authored
fix(docs): minor changes to guides (#2913)
* fix(docs): missing for windows command sync with README.md * docs: add missing add hook alternative * docs: add other add hooks commands add hooks produce different result in different command interpreter
1 parent 9d8d73f commit 499efd1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ yarn husky install
107107

108108
# Add hook
109109
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"'
110+
# Sometimes above command doesn't work in some command interpreters
111+
# You can try other commands below to write npx --no -- commitlint --edit $1
112+
# in the commit-msg file.
113+
npx husky add .husky/commit-msg \"npx --no -- commitlint --edit '$1'\"
114+
# or
115+
npx husky add .husky/commit-msg "npx --no -- commitlint --edit $1"
116+
117+
# or
118+
yarn husky add .husky/commit-msg 'yarn commitlint --edit $1'
110119
```
111120

112121
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.

docs/guides-local-setup.md

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ configure `commitlint` to use it.
1212
```bash
1313
# Install and configure if needed
1414
npm install --save-dev @commitlint/{cli,config-conventional}
15+
# For Windows:
16+
npm install --save-dev @commitlint/config-conventional @commitlint/cli
17+
18+
# Configure commitlint to use conventional config
1519
echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
1620
```
1721

0 commit comments

Comments
 (0)