Last active
January 4, 2020 19:39
-
-
Save maiquealmeida/3d1aee4cc7e15fb20e9999db076c3568 to your computer and use it in GitHub Desktop.
Automates git commit messages patterns.
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
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