Replaced the old inline command (which just printed raw text and exited non-zero) with a small script at .claude/hooks/lint-on-edit.sh. When oxlint finds errors, the script outputs JSON with hookSpecificOutput .additionalContext, which explicitly injects the lint errors into Claude's context so it fixes them immediately rather than missing a background notification. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
No EOL
484 B
JSON
27 lines
No EOL
484 B
JSON
{
|
|
"hooks": {
|
|
"PostToolUse": [
|
|
{
|
|
"matcher": "Write|Edit|MultiEdit",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": ".claude/hooks/lint-on-edit.sh",
|
|
"timeout": 30,
|
|
"statusMessage": "Linting..."
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"Stop": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "npm run typecheck 2>&1"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
} |