Skip to content

feat: Add commitlint for enforcing conventional commit messages #284

@amondnet

Description

@amondnet

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 husky

2. 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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions