Skip to content

cli: add --check flag to syntax-check a file without executing#30981

Open
robobun wants to merge 17 commits into
mainfrom
farm/e67ccbc8/add-check-flag
Open

cli: add --check flag to syntax-check a file without executing#30981
robobun wants to merge 17 commits into
mainfrom
farm/e67ccbc8/add-check-flag

test: assert exact exit code 1 for missing file in --check

d33d2eb
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 5, 2026 in 27m 1s

Code review found 1 potential issue

Found 3 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/runtime/cli/run_command.rs:3007-3012 exec_check ignores --loader/-l extension overrides

Annotations

Check warning on line 3012 in src/runtime/cli/run_command.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

exec_check ignores --loader/-l extension overrides

🟡 nit: `--loader`/`-l` is parsed alongside `--check` (Arguments.rs:851 → `ctx.args.loaders`) but `exec_check` only consults `DEFAULT_LOADERS.get(ext)` and never the user-supplied map — so e.g. `bun --check -l .js:ts script.js` parses as plain JS and rejects TS syntax, and `bun --check -l .config:ts app.config` falls back to TSX (where `<T>x` type assertions are JSX errors). Same accepted-but-ignored class as the `--if-present` case fixed in 11203f8, and unlike the deferred extension-resolution c