Files
dotfiles/.claude/hooks/stop-lint-gate.sh
Ismo Vuorinen cff83e4738 refactor(claude): migrate hooks to external scripts and add new hooks
Replace inline command strings in settings.json with external scripts
in .claude/hooks/ for readability and maintainability. Consolidate
three PostToolUse formatters into one script and add markdown/yaml
formatting. Add new hooks: SessionStart context banner, Stop lint
gate, async Bats test runner, idle desktop notification, and
PostToolUseFailure logger.
2026-03-20 04:38:18 +02:00

17 lines
318 B
Bash
Executable File

#!/usr/bin/env bash
# Stop gate: run yarn lint before Claude finishes.
# Exit 2 sends feedback back and keeps Claude working.
cd "$CLAUDE_PROJECT_DIR" || exit 0
output=$(yarn lint 2>&1)
status=$?
if [ $status -ne 0 ]; then
echo "Lint failed — fix before finishing:" >&2
echo "$output" >&2
exit 2
fi
exit 0