feat: add Husky pre-commit hook for Biome checks - fixes #38

This commit is contained in:
GitHub Copilot
2025-05-07 14:48:27 -04:00
parent 6d91b331ab
commit 825ac2eb4e
7 changed files with 1255 additions and 3 deletions

38
HOOKS.md Normal file
View File

@@ -0,0 +1,38 @@
# Git Hooks
This project uses Git hooks to enforce code quality standards. The hooks are managed using [Husky](https://typicode.github.io/husky/).
## Pre-commit Hook
The pre-commit hook runs automatically before each commit and performs the following checks:
- Runs Biome checks (`npm run check`) to ensure code formatting and linting standards are met
### Usage
The hook runs automatically when you commit changes:
```bash
git add .
git commit -m "Your commit message"
```
If the code doesn't pass the Biome checks, the commit will be rejected with an error message.
### Bypassing the Hooks
In rare cases when you need to bypass the pre-commit hooks (not recommended for regular use), you can use the `--no-verify` flag:
```bash
git commit -m "Your commit message" --no-verify
```
> **Warning:** Bypassing hooks should be done only in exceptional circumstances. It's better to fix code quality issues than to bypass the checks.
## Adding New Hooks
To add additional Git hooks:
1. Create a new script in the `.husky` directory
2. Make it executable: `chmod +x .husky/your-hook-name`
3. Update this documentation to include information about the new hook