Skip to content

Commit

Permalink
fix(docs): minor changes to guides (#2913)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fzn0x authored Dec 10, 2021
1 parent 9d8d73f commit 499efd1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ yarn husky install

# Add hook
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"'
# Sometimes above command doesn't work in some command interpreters
# You can try other commands below to write npx --no -- commitlint --edit $1
# in the commit-msg file.
npx husky add .husky/commit-msg \"npx --no -- commitlint --edit '$1'\"
# or
npx husky add .husky/commit-msg "npx --no -- commitlint --edit $1"

# or
yarn husky add .husky/commit-msg 'yarn commitlint --edit $1'
```

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.
Expand Down
4 changes: 4 additions & 0 deletions docs/guides-local-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ configure `commitlint` to use it.
```bash
# Install and configure if needed
npm install --save-dev @commitlint/{cli,config-conventional}
# For Windows:
npm install --save-dev @commitlint/config-conventional @commitlint/cli

# Configure commitlint to use conventional config
echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
```

Expand Down

0 comments on commit 499efd1

Please sign in to comment.