Last active
December 27, 2021 10:00
-
-
Save wojtekmaj/0b2c9bb53813e4240221358d8408bfcb to your computer and use it in GitHub Desktop.
Install Husky & commitlint with conventional config using Yarn Berry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git fetch | |
git checkout main | |
git pull | |
git checkout -b husky | |
yarn add @commitlint/config-conventional @commitlint/cli husky@^7.0.0 --dev | |
yarn dedupe | |
echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js | |
# if you're on windows, check EOL sequence in the file created | |
yarn husky install | |
yarn husky add .husky/commit-msg 'yarn commitlint --edit "$1"' | |
# if you're on windows, you need to make sure chmod is set correctly | |
git update-index --chmod=+x .husky/commit-msg | |
npm set-script postinstall "husky install" | |
# you might want to sort your scripts at this point as set-script adds it at the end | |
git add . | |
git commit -m "Add husky and commitlint with conventional config" | |
git push --set-upstream origin husky | |
git checkout main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment