jev-lint
日本語
A lint tool that uses Jev -- a fast classifier that
answers a natural-language question with a calibrated probability instead of
writing text -- to decide what a parser cannot.
Try it on tracked files
To run your first lint check, you need Node.js 24+, a Git working tree, and either OPENROUTER_API_KEY or TYPESAFE_API_KEY. Choose one of the following commands.
Free trial with OpenRouter. The free Decider model requires an OpenRouter account and API key. Get an OpenRouter key.
export OPENROUTER_API_KEY='<your-openrouter-key>'
npx -y jev-lint --model openrouter:perplexity/pplx-decider-v1.3:free
TypeSafe Jev. We recommend Jev for regular use and CI because the shipped thresholds are calibrated on it. If both keys are exported, unset OPENROUTER_API_KEY to connect to TypeSafe directly. Get a TypeSafe key.
export TYPESAFE_API_KEY='<your-typesafe-key>'
npx -y jev-lint
With no API key, run npx -y jev-lint --dry-run to preview the files and candidate rules offline.
Without a config, the CLI asks once, selects starter rules from up to 64 tracked filenames (8 KiB of paths), prints the proposed YAML, then lints up to three files (16 KiB each, 32 KiB total). The OpenRouter trial uses the free Decider for both selection and lint. Saving the YAML is optional. An existing config uses its own files and rules.
Example finding
This function is wrong, and nothing in your toolchain will say so:
/** Returns the cart, or null when no cart has this id. */
export function getCart(id: string): Cart {
const cart = carts.get(id);
if (!cart) throw new Error(`no cart ${id}`);
return cart;
}
The comment promises null. The body throws. The return type is Cart, not
Cart | null. It type-checks and it lints clean.
A jev-lint rule is one sentence. An ast-grep
matcher picks which code to look at, and a model is asked that sentence about
each match -- here, the comment above this code claims something that is not
true of the code -- answering with a probability. The code being judged is
sent to an API, which is what the key pays for; nothing runs locally except
the matcher.
export TYPESAFE_API_KEY=... # https://typesafe.ai
npx -y jev-lint check examples
examples/cart.ts
16 flag The comment above this code claims something that is not true of the code.
comment-describes-declaration 0.89 cutoff 0.56
...
0.89 is the model's agreement and 0.56 the cutoff this rule ships with; under
it, nothing is reported. Six findings over two files, for a tenth of a cent;
what a bigger run costs is measured, not extrapolated.
What it catches
Sixty-eight distinct rule IDs ship, most of them asked in several languages -- 121
rules in all. Roughly:
- A name against the thing it names. A function, method, binding, type,
class, trait or module; an npm script against the command it runs; an sqlc
query name against its SQL.
applyDiscount that also saves the cart,
isAdmin bound to a string.
- A guarantee the name implies. Whether
safe* is safe, pure* is pure,
an idempotent-sounding function is idempotent, whether Go's MustX panics
on the failure its name promises.
- A comment against the code under it. The doc comment above a
declaration, a comment inside a block, and a stated failure contract --
@throws, # Errors, Raises: -- against the body.
- A test against what it claims. A test that would pass with the
behaviour its name claims broken; a failure path no test reaches; a
snapshot standing in for a behaviour claim; a mock that has replaced the
subject.
- A failure that goes quiet. A
catch that hides one, an error message
that does not match its condition, a log level that does not match the
event.
- What a shell script does to the machine that its reader cannot see:
run code it downloaded, read secrets it was not given, install
persistence, delete past its own scope, weaken a defence, open a way in,
take orders from elsewhere, hide what it runs.
- Whether a document is worth reading. Slop, filler, padding, vagueness;
a section that opens with an agenda or ends by previewing the next.
- Whether
AGENTS.md is usable. Each section's instructions must be
clear enough to follow and consistent with the rest of the file.
- A commit message against its diff, and a change against the
instructions the repository wrote for itself --
AGENTS.md in its own
tree, or CLAUDE.md when AGENTS.md is absent, read as of that change.
Only the instructions a diff can be held against: "never edit the generated file" is judged,
"develop test-first" is not.