Favicon of Pre-commit Quality Gate

Pre-commit Quality Gate

Comprehensive pre-commit hook that runs linting, type checking, tests, and security scans before allowing commits. Prevents bad code from entering the repository.

How to Install Hooks

  1. Copy the hook configuration using the button below
  2. Add to your .claude/hooks/ directory in your project
  3. Save the hook as an executable script with appropriate permissions
  4. The hook will trigger on the specified events in your Claude Code workflows
# Pre-commit Quality Gate Hook

```bash
#!/bin/bash

set -e

echo "Running pre-commit quality checks..."

# Lint
echo "Linting..."
npm run lint

# Type check
echo "Type checking..."
npm run type-check

# Tests
echo "Running tests..."
npm test

# Security scan
echo "Security scan..."
npm audit

echo "All checks passed!"
```

## Installation

1. Save to `.git/hooks/pre-commit`
2. Make executable: `chmod +x .git/hooks/pre-commit`

## Requirements

- Git
- Node.js
- npm

## Integrations

- ESLint for linting
- TypeScript for type checking
- Jest/Vitest for testing
- npm audit for security

This hook prevents commits with quality issues, ensuring clean code in your repository.
Categories:

Share:

Ad
Favicon

 

  
 

Similar to Pre-commit Quality Gate

Favicon

 

  
  
Favicon

 

  
  
Favicon