git commitizen & commitlint & lint-staged
npm i gccl -D
# OR
yarn add gccl -D
- It just install these devDependencies commitizen、 commitlint、 lint-staged in your project
- add the info in your package.json and create a
commitlint.config.js
in your project{ ... "config": { "commitizen": { "path": "./node_modules/cz-conventional-changelog" } }, "husky": { "hooks": { "pre-commit": "lint-staged", "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" } }, "lint-staged": { "*.{js,vue}": [ "eslint --fix", "git add" ] } }