Skip to content
All templates

Hooks · Hook

Pre-commit Lint Check

Run linting before each commit to catch issues early

hooklintpre-commit
Template content
# Hook Configuration (for ~/.claude/settings.json)

{
  "hooks": {
    "PreCommit": [
      {
        "command": "npm run lint --fix",
        "description": "Run linter with auto-fix before committing"
      }
    ]
  }
}

# Notes
- This runs before every commit Claude Code makes
- If the lint command fails, the commit is blocked
- Auto-fix is applied so minor issues are resolved automatically

Use this template in the editor

Open PromptEditor.io to customize this template, save it, and inject it into any AI chat.

Open the editor