Skip to content

Minor: No Pre-commit Hooks or Code Quality Automation #23

@AliiiBenn

Description

@AliiiBenn

Priority

🟡 Minor - Code Quality & Team Workflow

Location

Repository root - missing .husky directory and related config

Problem Description

The project has no automated code quality checks before commits.

Missing Automations

1. Pre-commit Hooks

No automated checks before commit - code with errors gets committed.

2. Linting on Commit

  • TypeScript errors committed
  • ESLint warnings committed
  • Prettier formatting not applied

3. Test Verification

No tests run before commit - broken tests can be committed

4. Commit Message Linting

No enforced commit message format - inconsistent commit styles

Issues

1. Broken Code in Repository

Can commit code with syntax errors.

2. Inconsistent Formatting

Different developers use different formatting styles.

3. TypeScript Errors in Git History

Bisecting becomes difficult, CI/CD fails after merge.

4. Manual Review Required

Must manually check code quality - wastes reviewer time.

Expected Behavior

Pre-commit Setup

Install husky and lint-staged, configure pre-commit hooks.

Commit Message Linting

Enforce conventional commits format.

Benefits

For Developers

  • Immediate feedback on code quality
  • Automatic formatting
  • Prevents bad commits
  • Faster development

For Reviewers

  • Consistent code style
  • Fewer nitpicks
  • Focus on logic, not formatting
  • Faster reviews

For Project

  • Clean git history
  • Fewer CI failures
  • Better code quality
  • Professional workflow

Related Issues

Steps to Fix

Phase 1: Basic Hooks

  1. Install husky and lint-staged
  2. Set up pre-commit hook
  3. Configure lint-staged
  4. Test with intentional bad code

Phase 2: Commit Messages

  1. Install commitlint
  2. Configure commit message rules
  3. Add commit-msg hook

Phase 3: Additional Checks

  1. Run affected tests on commit
  2. Check for console.log/debugger
  3. Validate file sizes

Phase 4: Team Onboarding

  1. Document in contributing guide
  2. Ensure hooks work for all platforms
  3. Add to setup documentation

Additional Context

Pre-commit hooks are a best practice for professional projects. They catch issues at the commit stage, preventing bad code from ever entering the repository. This is especially important for teams.

Git Hooks vs CI/CD

Pre-commit hooks: Catch issues immediately (fast)
CI/CD: Catch issues after push (slow, but comprehensive)
Both needed for optimal workflow

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions