This repository uses commitlint to enforce our conventional commit standards.
If you want to run commitlint locally, install the dependencies:
npm installCheck the last commit:
npm run commitlintCheck commits in a range (CI):
npm run commitlint-ciTo automatically validate commits before they're created, you can install a git hook:
# Install husky (one-time setup)
npm install --save-dev husky
npx husky install
# Add commit-msg hook
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"'The commitlint configuration is in .commitlintrc.js and follows our standards:
- Types:
feat,fix,docs,style,refactor,perf,test,chore,build,ci,revert - Format:
type(scope): subject(scope is optional) - Subject: 10-72 characters, lowercase, no period
- Body: Should include "Files changed:" section
✅ Good commits:
feat: add commitlint configuration
Files changed:
- `.commitlintrc.js` - commitlint configuration
- `package.json` - commitlint dependencies
fix(api): handle null response in user service
Files changed:
- `src/api/user.service.js` - add null check
❌ Bad commits:
Fixed stuff # No type
feat: Add new feature. # Period at end
feat: a # Too short
FEAT: new feature # Wrong case
Commitlint is automatically enabled in our Super Linter configuration via:
VALIDATE_GIT_COMMITLINT=truein.github/super-linter.env- Integrated in
.github/workflows/reusable-super-linter.yml