-
-
Notifications
You must be signed in to change notification settings - Fork 112
feat: Add commitlint for enforcing conventional commit messages #284
Copy link
Copy link
Closed
Description
Description
This project would benefit from enforcing conventional commit message standards to maintain consistency across contributions and enable automated changelog generation.
Proposed Implementation
1. Install commitlint and dependencies
pnpm add -D @commitlint/cli @commitlint/config-conventional husky2. Configure commitlint
Create commitlint.config.js:
module.exports = {
extends: ['@commitlint/config-conventional']
};3. Setup Git hooks with Husky
- Initialize husky for git hooks
- Add commit-msg hook to validate commit messages
- Update package.json with prepare script
4. CI Integration
Add GitHub Actions workflow to validate:
- PR titles follow conventional format
- All commits in PRs are properly formatted
5. Documentation
Update contributing guidelines with commit message format requirements
Benefits
- ✅ Consistent commit history
- ✅ Automated changelog generation capability
- ✅ Better semantic versioning support
- ✅ Clearer project history
Current State
The project currently uses a mix of conventional and non-conventional commit messages. Recent commits show usage of prefixes like fix:, feat:, chore:, ci:, and build:, but this is not enforced.
References
Tasks
- Install commitlint dependencies
- Create commitlint configuration
- Setup Husky git hooks
- Add GitHub Actions workflow
- Update documentation
Reactions are currently unavailable