Skip to content

Comments

Add Pre-Commit Hook with Husky#18

Merged
VialsShiny merged 1 commit intomainfrom
setup/ci
Nov 30, 2025
Merged

Add Pre-Commit Hook with Husky#18
VialsShiny merged 1 commit intomainfrom
setup/ci

Conversation

@VialsShiny
Copy link
Owner

🪝 Add Pre-Commit Hook with Husky

Description

This PR adds a pre-commit hook to complement the existing pre-push hook, providing an additional layer of code quality validation earlier in the development workflow.

What's Changed

✨ New Features

Pre-Commit Hook

  • 🎣 Automatic code validation before each commit
  • ⚡ Runs linting checks on staged files only
  • 🚫 Prevents commits if validation fails
  • 🔄 Works alongside existing pre-push hook

Why This Change?

Benefits:

  • 🛡️ Earlier detection: Catch issues before committing, not just before pushing
  • Faster feedback: Immediate validation on changed files
  • 🎯 Targeted checks: Only lints staged files (faster than pre-push)
  • 📝 Cleaner history: Ensures every commit meets quality standards
  • 🔄 Better workflow: Fix issues incrementally, not all at once before push

How It Works

# On every git commit
1. Husky intercepts the commit command
2. Runs ESLint on staged files only
3. If errors found → commit blocked ❌
4. If all clear → commit proceeds ✅

Impact: Medium - Improves development workflow with earlier quality checks, minimal performance impact

@VialsShiny VialsShiny self-assigned this Nov 30, 2025
@VialsShiny VialsShiny added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 30, 2025
@vercel
Copy link

vercel bot commented Nov 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
mini-social Ready Ready Preview Comment Nov 30, 2025 11:47pm

@VialsShiny VialsShiny merged commit 8edc2fe into main Nov 30, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant