git init # if git is not initialized
npm init -y # if project doesn't contain package.json
# for linux/mac
npm i -D @commitlint/{cli,config-conventional}
# for windows
npm i -D @commitlint/cli @commitlint/config-conventional
echo "{ \"extends\": [\"@commitlint/config-conventional\"] }" > .commitlintrc.json
npm i -D husky
"postinstall": "husky install"
npx husky add .husky/commit-msg "npx commitlint --edit $1"
# commit the configuration
git add .
git commit -m "feat: configure commitlint"