npm i husky @commitlint/cli @commitlint/config-conventional --save -dev
yarn add husky @commitlint/cli @commitlint/config-conventional --dev
"devDependencies": {
"@commitlint/cli": "^17.4.4",
"@commitlint/config-conventional": "^17.4.4",
"husky": "^8.0.3"
}
root 폴더에 생성
해당 폴더 내부에 commit-msg
파일 추가
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no -- commitlint --edit
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"postinstall": "husky install"
},
root 폴더에 추가
module.exports = { extends: ["@commitlint/config-conventional"] };