Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bhouston opened this issue Mar 7, 2025 · 0 comments · Fixed by #26
Closed

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

bhouston opened this issue Mar 7, 2025 · 0 comments · Fixed by #26
Labels
enhancement New feature or request

Comments

@bhouston
Copy link
Member

bhouston commented Mar 7, 2025

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.

@bhouston bhouston added the enhancement New feature or request label Mar 7, 2025
bhouston added a commit that referenced this issue Mar 7, 2025
…ommit-hook

Fix #25: Add Husky pre-commit hook to ensure project builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant