25 lines
No EOL
871 B
JSON
25 lines
No EOL
871 B
JSON
{
|
|
"hooks": {
|
|
"PostToolUse": [
|
|
{
|
|
"matcher": "Write|Edit|MultiEdit",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": ".claude/hooks/lint-on-edit.sh",
|
|
"timeout": 30,
|
|
"statusMessage": "Linting..."
|
|
},
|
|
{
|
|
"type": "command",
|
|
"if": "Write(*.ts)|Write(*.tsx)|Edit(*.ts)|Edit(*.tsx)|MultiEdit(*.ts)|MultiEdit(*.tsx)",
|
|
"command": "output=$(npm run typecheck 2>&1); rc=$?; if [ $rc -ne 0 ]; then printf '{\"hookSpecificOutput\":{\"hookEventName\":\"PostToolUse\",\"additionalContext\":\"TypeCheck failed:\\n%s\"}}' \"$(echo \"$output\" | tail -30 | sed 's/\"/\\\\\"/g; s/$/\\\\n/' | tr -d '\\n')\"; fi",
|
|
"timeout": 60,
|
|
"statusMessage": "Type-checking...",
|
|
"async": true
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
} |