npm install --save-dev @commitlint/config-conventional @commitlint/cli
create commitlint.config.js
file on your project root folder
module.exports = {
extends: ["@commitlint/config-conventional"],
};
-
npm install --save-dev commitizen
-
npm install --save-dev husky
In your package.json
add the following objects
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
You can also add git-cz
on your scripts object
"scripts": {
"commit": "git-cz"
}