Repository navigation
Description
Two defects in the shared rtk lint path. The first makes rtk report lint results for a command that failed to execute; the second adds a path argument the user did not type to a command that writes files.
Provenance: AI-assisted source audit, human-directed, at v0.44.2 (700bdde). Both behaviours were reproduced by running the shipped rtk 0.44.2 binary; argv was captured with a stand-in on PATH. Outputs are verbatim.
1. biome <subcommand> runs a tool named after the subcommand — and rtk reports lint results anyway
src/discover/rules.rs:171-172 rewrites biome/eslint/lint to rtk lint. src/cmds/js/lint_cmd.rs:77-88 (detect_linter) then treats the first non-flag argument as the linter's name. For biome, that argument is the subcommand.
$ rtk rewrite biome check --write
rtk lint check --write
$ rtk -v lint check --write
Running: check with structured output
Lint: 2 errors, 0 warnings
npm error could not determine executable to run
rtk tried to run a tool literally named check (via npx --no-install), npm could not find it — and rtk still printed Lint: 2 errors, 0 warnings, synthesised from npm's own error output. biome never ran. An agent reading that summary is told there are two lint errors in the project.
Same shape for biome format ., biome ci, biome lint, and for the npx biome … forms.
2. eslint --fix gains a .
src/cmds/js/lint_cmd.rs:152-160 appends . when it decides no path was supplied, and an argument that starts with - or contains = never counts as a path. Captured argv:
| user typed | argv rtk built |
|---|---|
eslint --fix |
eslint -f json --fix . |
eslint src/ |
eslint -f json src/ ✓ |
eslint --stdin --fix --stdin-filename=x.js |
eslint -f json --stdin --fix "--stdin-filename=x.js" . |
Row 1 is the problem: --fix writes to disk, and rtk widened its scope from "whatever eslint's config resolves by default" to an explicit whole-tree .. Row 3 is broken differently — ESLint rejects file arguments together with --stdin, so that invocation now fails outright.
Adding a default path is reasonable for a read-only lint; doing it for a write command changes what the command modifies.
Suggested directions (untested — no programmer has reviewed these)
- For biome: recognise its subcommand grammar (
check/format/lint/ciare subcommands, not linter names) rather than taking the first non-flag argument as the tool. At minimum, if the resolved tool cannot be executed, do not print a lint summary — the fabricatedLint: N errorsline is worse than no output, because it is indistinguishable from a real result. - For the
.injection: skip it when a write flag is present (--fix,--write), and when--stdinis present.src/cmds/python/ruff_cmd.rs:46-50andsrc/cmds/php/pint_cmd.rs:41already handle both the--flag=valueand--flag valueforms correctly and are the pattern to copy.
Related
src/cmds/js/vitest_cmd.rs:232 (the jest arm) and src/cmds/js/playwright_cmd.rs:269 have the same space-separated-value blind spot: playwright test --reporter line tests/ drops the flag but keeps line, which Playwright then treats as a test-path filter — likely selecting zero tests, which the filter reports as a clean run. Not verified against real Playwright (not installed here); noted because the root cause is identical.
Activity
pszymkowiak commentedon Aug 4, 2026
🔍 Automated Triage
bughighSummary
Shared rtk lint path misdetects biome subcommands as tool names (still printing a fabricated lint summary) and appends '.' to eslint --fix, silently widening a write command to the whole tree — fix detect_linter in src/cmds/js/lint_cmd.rs and the biome rewrite in src/discover/rules.rs.
📁 Relevant files
src/cmds/js/lint_cmd.rssrc/discover/rules.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
HetCreep commentedon Oct 23, 2026
Linking related work so this can close together with the rest of the group.
Part 1 here (the biome subcommand taken as the linter name) overlaps #3117, which was filed earlier, and the closed #2540 and #2906. Three open PRs address that part, each filed against one of those issues rather than this one:
biomename in the rewriteESLint output (JSON parse failed), masking real status #2540): keeps explicit biome/eslint rewrite prefixespnpm exec biome ci .→rtk lint ci .drops the explicitbiomename and runscias the linter (exit 254 misreported as "possibly out of memory") #2906): splits the biome, eslint andlintrules and limitsdetect_linterto known executablesI have read their descriptions, not run them, so I am not claiming any of them covers the exact repro above (including the
npx biomeforms). On develop32b2ec43the behaviour is unchanged:src/discover/rules.rs:209still rewritesbiometortk lint, anddetect_linterstill takes the first non-flag argument as the tool name.Part 2 (
eslint --fixgetting a.appended) is separate; none of the three PR descriptions mention it.Produced with AI assistance (Claude Code) operated by me (HetCreep); the line cites were read at
32b2ec43.