Step 2: The strictest linter
Step 2: The strictest linter
The second step of the harness I put around my coding agents: a linter with every rule you can defend, as errors, so a convention holds every time.
Part of the series: Codebase Harness, Step by Step · View all parts
Previously in this series: Step 1: The strictest type checker
An agent follows your conventions most of the time. A linter follows them every time. Turn on every rule you can defend, even the noisy ones: with an agent fixing the errors, a noisy rule costs tokens, not your afternoon. A rule the linter holds, you never ask for again.
Two dimensions. A guide acts before the agent, a sensor after. Each is inferential, judged by a model, or computational, decided by a program. Inferential guides are what the agent reads, AGENTS.md, a skill, a plan, sharper written in the literature's words; computational guides are deterministic tools, a codemod, a generator, a command that acts in the agent's place, code mode, where the agent writes a program instead of a string of actions, a language server. Inferential sensors are a review by a model or a person; computational sensors are the type checker, the linter, tests and fitness functions. Each practice moves a judgement toward computation, and the computational sensor is the optimum.
- 1 · type checker
- 2 · lintertoday
In Birgitta Böckeler's grid of guides and sensors, a lint rule is a computational sensor. A convention written in a prompt is an inferential guide: the model reads it, and may not follow. The series' map: Guides and Sensors: Mapping Your Attention to Free It
In practice, turn on whole categories as errors rather than hand-picked rules. In oxlint: correctness and suspicious. An agent can leave a warning in place; an error it has to fix before the commit.
Then the rules for the shortcuts an agent takes when it is stuck: no-explicit-any, the exit from the type checker, and no-floating-promises, the await it forgot.
One check that is not a lint rule works like one: the formatter in check mode. Style stops being a correction you ask for.
If you want an example, here is my oxlint config: lbdremy/phax/.oxlintrc.json
Next in this series: Step 3: A dead-code finder in the loop
A thought after reading?
If you would like to discuss about this article, you can write to me here. I share because I care and I want to learn. Please teach me with care.