Repository navigation
Description
Environment
- rtk 0.37.2 (Homebrew,
/opt/homebrew/bin/rtk) - macOS darwin 25.4.0 (arm64)
- Claude Code 2.1.x with the
rtk hook claudePreToolUse hook shipped byrtk init
Repro
Project uses Biome, not ESLint. package.json:
{
"scripts": {
"lint": "biome check"
}
}rtk rewrite "npm run lint"->rtk lint(exit 0).- Claude Code hook rewrites
npm run linttortk lintbefore execution. rtk lintshells out to biome, biome exits 0 with plain-text output, and the lint adapter attempts to parse biome's output as ESLint JSON.- Observed output:
ESLint output (JSON parse failed: EOF while parsing a value at line 1 column 0), process exit 0.
Expected
npm run lint passes through to the project's actual lint script without being forced into the ESLint adapter. Either:
- route
npm run lintthroughrtk npm run lint(mirrors the fix in PR fix(rewrite): route pnpm lint through rtk pnpm #678 forpnpm lint), or - detect Biome from
package.json/ presence ofbiome.jsonand dispatch to the existingrtk biomefilter added in Support Biome for lint command #316.
Either way, the adapter's JSON parse should never run on biome output.
Actual
rtk rewrite sends every npm run lint into the ESLint adapter regardless of what the script actually invokes. The adapter fails to parse biome output, prints a JSON-parse-failed warning, and exits 0. Agents see exit 0 and move on; the real lint result is discarded silently.
Reproduced cleanly with an empty-stdout target:
$ rtk lint ./no-op.sh
ESLint output (JSON parse failed: EOF while parsing a value at line 1 column 0)
$ echo $?
0
Also tried
[hooks] exclude_commands = ["npm run lint"]inconfig.toml: no effect onrtk rewriteor the Claude hook (matches Support exclude_commands config for auto-rewrite hook #243 / bug(hooks): exclude_commands has no effect on rtk rewrite or hook output in 0.36.0 #1335)..rtk/filters.tomlwith a matchingmatch_command: only applies to unhandled commands; cannot override the built-in rewrite (also noted in bug(hooks): exclude_commands has no effect on rtk rewrite or hook output in 0.36.0 #1335).RTK_DISABLED=1 rtk lint: still runs the ESLint-JSON parse and still prints the warning. Not an escape hatch for this collision.rtk proxy npm run lint: works per-command but strips all downstream filtering if the agent reflexively applies it more broadly.
Related
- pnpm lint causing issue when ESLint isn't used #665 (open)
pnpm lintshows the same symptom on Biome projects. - PR fix(rewrite): route pnpm lint through rtk pnpm #678 (open, checks green) routes
pnpm lintthroughrtk pnpm lint. Does not covernpm run lint. - PR feat(npm): structured NpmCommands sub-enum with smart script routing #443 (open) is the active
NpmCommandssub-enum restructure for smart script routing. As currently written it wiresnpm run lint -> lint_cmd(the ESLint adapter), which codifies this bug rather than fixing it. Addressing the Biome case here, before feat(npm): structured NpmCommands sub-enum with smart script routing #443 merges, seems cheapest. - Support Biome for lint command #316 (closed, 0.30.0) added the Biome output filter, but only on the direct
rtk biome lintpath, not through thertk lintrewrite. - Support exclude_commands config for auto-rewrite hook #243 / bug(hooks): exclude_commands has no effect on rtk rewrite or hook output in 0.36.0 #1335 (both open) document that
[hooks] exclude_commandsis not threaded into the Claude Code hook rewrite path, so config-level opt-out is not currently an option.
Likely cause
src/discover/rules.rs maps any npm run lint (and pnpm lint, biome check, npm run check) to the rtk lint adapter, which assumes ESLint JSON. PR #678 patches the pnpm lint row; the npm run lint row should follow the same routing change. The natural landing spot is PR #443's NpmCommands::Run { script: "lint", .. } branch: either detect Biome from package.json / biome.json and dispatch to the existing biome filter, or fall through to the generic npm_cmd::run_script boilerplate-stripper when detection is uncertain. Either beats running the ESLint JSON parser on biome output.
Impact
AI coding agents see exit 0 with a suspicious-looking warning and often ignore it. Real lint failures (and anything downstream that gates on lint) can pass silently on Biome projects for multiple commits before the regression is noticed by a human.
Activity
pszymkowiak commentedon Apr 24, 2026
🔍 Automated Triage
bughighSummary
npm run lint is unconditionally rewritten to the ESLint JSON adapter, silently discarding real lint failures on Biome projects; fix is localized to rules.rs and PR #1491 is already open.
📁 Relevant files
src/discover/rules.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
fix(rtk): guard Biome rewrite collisions
fix(rtk): guard all biome invocations from RTK rewrite, including cd-…
rofreytag commentedon May 18, 2026
likely related: when claude tries to run
pnpm lint-> it executesrtk lintinstead, which in my case errors withinstead it should run
timqi commentedon Sep 28, 2026
Another case of this one, this time with oxlint, on rtk 0.50.0 (the rule is still in
src/discover/rules.rsonmaster@ 7efbaef).Repro (a project whose
lintscript is oxlint, with no ESLint installed):rtk lintwith no linter named falls back to ESLint (npx eslint … --format json). Here npx fails withnpm error could not determine executable to runand writes nothing to stdout. The only thing the agent sees is the JSON parse error, and it exits 2 on a tree whose own gate passes. The hook sits in front of every agentnpm run lint, so the project looks broken on every branch until someone traces it back to the rewrite.Expected: a rewrite of
npm run lint/pnpm [run] lintshould run the script as written. That means passing it through, orrtk npm run lint(asnpm run lint:fixalready does). Failing that,rtk lintcould read the script body frompackage.jsonand only take the ESLint path when the script actually runs ESLint. Separately, when the linter process fails to start or prints nothing, its stderr and exit code should be surfaced, not a JSON parse error.Workaround:
[hooks] exclude_commands = ["npm run lint", "pnpm run lint", "pnpm lint"]inconfig.toml. The patterns match as word prefixes, so they also covernpm run lint -- --fix.Tools: with rtk on, a sync keeps `npm run lint` out of rtk's rewrite
jerosa commentedon Oct 13, 2026
Another variant of the same rewrite, with ESLint itself (not Biome/oxlint): npm workspace flags are passed through to
rtk lint, which forwards them to eslint.Same for
npm run lint -w front -- --no-cache.-w/--workspace(and--workspaces,--if-present) are npm options and should stay with npm, or the command shouldn't be rewritten at all when they're present.rtk 0.51.0, macOS, Claude Code hook.
atharvworkshere commentedon Nov 7, 2026
Another variant, with ESLint itself: the rewrite drops the script's path scope, so
npm run lintlints the whole repo.rtk 1.1.0 (Homebrew, macOS arm64),
rtk hook claude.rtk lintwith no paths then runseslint -f json .from the repo root, noteslint src. In a large frontend monorepo that run went 17 min at ~100% CPU before we killed it;npm run lint(scoped tosrc) is far shorter. Nothing errors, so the agent just waits. Running the script as written (rtk npm run lint, as PR #2860 proposes for pnpm) would fix this too.akumublade commentedon Nov 11, 2026
Still reproduces on rtk 1.2.0 (Homebrew, macOS 15.7.7 arm64) with pnpm 12.17.0 and oxlint 1.90.0, through
rtk hook claude. The rule is unchanged ondevelop: thertk lintrule insrc/discover/rules.rsstill listspnpm run lintandpnpm lint.ESLint is not installed, so
rtk lintfalls back to it, gets no output, and the agent sees a failing lint on a clean tree. Same case as the oxlint report above, now with pnpm on the current release.charlesroper commentedon Nov 13, 2026
Another data point on rtk 1.2.0, Linux arm64, in a project with no ESLint installed at all:
The real cause is on stderr:
npm error npx canceled due to missing packages and no YES option: ["[email protected]"]So the adapter reports a parse failure on stdout and exits 1, while the actual problem (no ESLint present) is only visible on stderr. Same masking as #3846, but the exit code is 1 here, unlike the exit 0 in the report above.
Repro project is a
package.jsonwith"lint": "biome check ."plus abiome.json, nothing else.rtk lintfails before Biome runs.Workaround for Biome projects until this lands: name the script something the rewrite rule does not match, for example:
rtk rewrite "npm run check:lint"leaves it alone, andrtk npm run check:lintpreserves the exit code.