Skip to content

Implement pre-commit hook with Husky to ensure project builds #25

@bhouston

Description

@bhouston

Implement pre-commit hook with Husky to ensure project builds

Description

Currently, there's no automated check before commits to ensure that the project builds successfully. This can lead to issues like the missing tags problem (issue #23) being pushed to the repository.

Proposed Solution

Implement a pre-commit hook using Husky that:

  1. Runs a build of the project before allowing a commit
  2. Prevents commits if the build fails or produces warnings
  3. Provides clear feedback to the developer about what needs to be fixed

Implementation Details

  • Use Husky for Git hooks management
  • Configure a pre-commit hook to run npm run build
  • Optionally add lint-staged for more efficient checks on staged files
  • Add appropriate documentation in the README about the pre-commit hook

Benefits

  • Prevents broken builds from being committed
  • Catches issues like missing tags early in the development process
  • Ensures consistent code quality across the project
  • Saves time by identifying issues before they're pushed to the repository

Priority

Medium - This is an enhancement to the development workflow that will prevent future issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions