Skip to content

Instantly share code, notes, and snippets.

@maiquealmeida
Last active January 4, 2020 19:39
Show Gist options
  • Save maiquealmeida/3d1aee4cc7e15fb20e9999db076c3568 to your computer and use it in GitHub Desktop.
Save maiquealmeida/3d1aee4cc7e15fb20e9999db076c3568 to your computer and use it in GitHub Desktop.
Automates git commit messages patterns.
Create a new file named commitlint.config.js with content:
module.exports = {
extends: ['@commitlint/config-conventional']
}
Add in package.json:
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
...and a new comand script...
"scripts": {
"commit": "npx git-cz"
}
Run command above in a initialized git repo:
$ yarn add -D commitizen @commitlint/config-conventional @commitlint/cli husky
$ yarn commitizen init cz-conventional-changelog --yarn --dev --exact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment