husky: validate-commit-msg git的提交 message 检测
检测 git message 是否符合常用标准
安装
yarn add @commitlint/{cli,config-conventional}
配置 commitlint.config.js
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
husky
添加一个
commit-msg
的 hook
npm install --save-dev husky
npx husky init
# Add commit message linting to commit-msg hook
echo "npx --no -- commitlint --edit \$1" > .husky/commit-msg