Pre-Commit Lint
Pre-Commit Lint hooks into the pre-tool-use event for Bash commands that contain 'git commit'. Before the commit executes, it runs ESLint on staged files and checks Prettier formatting. If any lint errors or formatting issues are found, it blocks the commit and reports the problems so Claude can fix them first. This ensures every commit meets your project's code quality standards without manual intervention.
Hook Code
Add this hook to your Claude Code settings or .claude/settings.json to activate.
Terminal Preview
About Pre-Commit Lint
Claude Code hooks let you run custom shell commands automatically in response to specific events during Claude's operation. Pre-Commit Lint is a Pre-Tool hook at the Beginner level that automates tasks at key moments in your development workflow, reducing manual steps and enforcing consistency across your team.