Closed
Description
On https://commitlint.js.org/#/./guides-local-setup?id=guides-local-setup, there is the following block of instructions.
# Add hook
npx husky add .husky/commit-msg "npx --no-install commitlint --edit $1"
# or
yarn husky add .husky/commit-msg "yarn commitlint --edit $1"
If the file .husky/commit-msg already exists, you can edit the file and put this:
# .husky/commit-msg
# ...
npx --no-install commitlint --edit $1
# or
yarn commitlint --edit $1
Expected Behavior
Following the two sets of directions would produce the file with a $1
in it.
Current Behavior
When following the first direction yarn husky add .husky/commit-msg "yarn commitlint --edit $1"
, it puts yarn commitlint --edit
in the file.
Affected packages
- cli
- core
- prompt
- config-angular
Possible Solution
I believe changing the first set of directions to:
# Add hook
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit $1'
# or
yarn husky add .husky/commit-msg 'yarn commitlint --edit $1'
Steps to Reproduce (for bugs)
- Follow the first set of directions and look at the file.
- Look at the file and see a missing
$1
.
Context
No major impact, just required an extra step to puzzle out.
Your Environment
N/A