beta

ESLint Pre-Edit Hook

Hooks

Hook that runs ESLint after every file edit to catch issues immediately.

2803/23/2026

Version 1

Published

Initial version

Created 3/23/2026

Initial version — no previous version to compare

Hook Script
# ESLint Pre-Edit Hook

## Configuration (settings.json)
```json
{
  "hooks": {
    "postToolUse": [
      {
        "matcher": "Edit|Write",
        "command": "npx eslint --fix \"$FILE_PATH\" 2>/dev/null || true"
      }
    ]
  }
}
```

## What It Does
- Runs after every Edit or Write tool call
- Auto-fixes what it can (--fix)
- Suppresses errors for non-JS files (|| true)
- Zero overhead for non-lintable files

## Customization
- Add --quiet to suppress warnings
- Add --rule '{"no-console": "error"}' for stricter rules
- Change matcher to only run on specific file types