
Linting, Static Analysis, and the Pre-Commit Hook That Saved My Sanity
The Agent Writes Code. Who Checks It? In the last post, I talked about why tests come first when working with an AI agent. Tests tell you if the code works . But they don't tell you if the code is good . An agent will happily write code that passes all your tests and is also: Inconsistently formatted Full of type errors Psalm would catch Using deprecated patterns Missing semicolons in one file and using them in another Tests catch behavioral bugs. Linting catches structural rot. You need both. The Tooling Stack I added five tools to this Laravel + React codebase, and each one closed a different gap: Tool Language What It Catches Pint PHP Code style (PSR-12, Laravel conventions) Psalm PHP Static analysis (type errors, null safety, dead code) Prettier JS/CSS/Blade Formatting (consistent whitespace, quotes, line length) ESLint TypeScript/React Lint rules (unused vars, hook deps, accessibility) TypeScript TypeScript Type checking (compile-time type safety) One make lint command runs all fi
Continue reading on Dev.to
Opens in a new tab



