bun check passed six type errors. It never checked one.

By Esteban Trillo7 min readupdated TypeScriptTooling

The step went green. The checker never got the job.
The step went green. The checker never got the job.

I seeded a small TypeScript project with six type errors and ran Bun’s new type checker on it:

bun check on Bun 1.4.3
$ bun check
$ echo THIS IS MY check SCRIPT, NOT bun check
THIS IS MY check SCRIPT, NOT bun check # exit 0

Exit code 0. Put that in a CI step and the pull request goes green with all six errors still in it. The checker didn’t miss them. It never started, and this blog’s own package.json has the line that stops it.

Bun v1.4.3 shipped bun check on October 10, 2026. I diffed it against tsc 7 on three projects and timed it. The errors matched every time. But that trap is one of three places where it stays quiet, and it’s the one that turns CI green.

A check script wins

The project had this in package.json:

package.json
{
"scripts": {
"check": "echo THIS IS MY check SCRIPT, NOT bun check"
}
}

That’s on purpose, and the docs say so: “Your script wins. bun check runs it, like bun run check, and passes it your flags.” This blog has "check": "astro check" from the verify setup in my agents post, so here bun check runs Astro’s checker instead.

Someone filed it as a bug, and the report has the sentence that matters: “a CI step that uses bun check for type checking can pass without type checking anything”. The fix, a --no-script flag, merged on October 16, six days after 1.4.3. It isn’t in a release yet, so on 1.4.3 your script gets it like any other flag:

--no-script on 1.4.3
$ bun check --no-script --no-pretty
THIS IS MY check SCRIPT, NOT bun check --no-script --no-pretty

Until it ships, two things work on 1.4.3:

  • bun --check with no file. It type-checked the project, found all six errors and exited 1.
  • bun check --cwd <dir> run from outside the project. That’s how I checked this blog without touching its check script.

Or rename the script so plain bun check means the type checker again. Just don’t make it "check": "bun check". The docs warn that any Bun without the checker runs that script forever, and an older bun in node_modules/.bin counts. They suggest typecheck.

Your package.json has "check": "biome check". In CI on Bun 1.4.3 you run bun check. What happens?

What bun check is

It’s a port of typescript-go, pinned to TypeScript 7.0.2. The release post says it passes 100% of TS 7.0.2’s conformance suite, 51,210 tests. It reads your tsconfig.json, uses every CPU core, and doesn’t need the typescript package installed. My seeded project only had @types/bun.

You can see the version it speaks:

the TypeScript inside Bun
bun -e 'console.log(process.versions.typescript)'
# 7.0.2

That matters if your project is still on TS 6, like this blog. bun check judges it by TS 7 rules, including the new defaults I listed in the TypeScript 7 side-by-side post.

What it doesn’t do:

  • Emit anything. No JS, no .d.ts, no source maps, no .tsbuildinfo, even with declaration or incremental on. The docs say to keep tsc for .d.ts files.
  • Cache. Every run checks the whole project.
  • Run as a language server, load language service plugins, or work with Yarn PnP.

Does it agree with tsc?

Bun publishes a recipe for checking that, and says any difference is “a bug in Bun”:

Bun's diff recipe
bunx -p typescript@7.0.2 tsc --noEmit --pretty false > tsc.txt
bun check --no-pretty > bun.txt
diff tsc.txt bun.txt

I ran it with an npm-installed tsc 7.0.2 instead of bunx, on the seeded project with its check script removed:

Seeded error tsc 7.0.2 bun check
wrong property type TS2322 TS2322
xs[0].toUpperCase() with noUncheckedIndexedAccess TS2532 TS2532
s.length on string | undefined TS18048 TS18048
unused @ts-expect-error TS2578 TS2578
error in a file only reached by computed import() TS2322 TS2322
add(1, "2") in a test file TS2345 TS2345
(raw as { n: number }).n.toFixed(), wrong at runtime not caught not caught

The diff was empty. It was also empty on this blog (no errors from either) and on Playwright at commit 27219bd, where both printed the same 13 TS2307 errors for generated files I hadn’t built. The last row is fair: a cast that lies isn’t a type error, and neither checker claims to catch it.

The recipe has two traps of its own. Its second line is bun check, so in a repo with a check script, bun.txt holds your script’s output. And paths are relative to where you run each command, so run both from the same directory. My first Playwright diff didn’t, and every line differed.

My three projects are a small sample. Bun’s own numbers are bigger: on 72 open-source projects, 1,102 of 1,103 configs matched tsc. There are also 24 open issues with “bun check” in the title as of October 20, among them a false TS2589 on a Prisma schema with about 500 models and a missed TS7053. Search for your stack before you switch.

How fast is it?

The release post claims 3.0x to 6.4x faster than tsc 7.0.2, measured on a 16-core Apple silicon Mac. My numbers are from a smaller machine:

  • Apple M1, 8 cores, 16 GB RAM, macOS 27.0.1
  • Bun 1.4.3 (c6da4a4d3), tsc 7.0.2 from npm, Node 24.16.0
  • One warmup run, then repeated runs under /usr/bin/time -l, reporting the median wall time and median peak memory

Playwright first, 710 files checked, seven runs each:

Checker Median wall Median peak memory
tsc 6.0.3 (3 runs) 7.78s 1222 MB
tsc 7.0.2 1.36s 1115 MB
bun check 1.4.3 0.41s 414 MB

That’s 3.3x faster than tsc 7 with 2.7x less memory. Bun’s figure for Playwright is 4.2x on twice the cores.

This blog went the other way. It has 55 files to check, and over seven runs bun check came out slower:

Checker Median wall Median peak memory
astro check (3 runs) 5.92s 729 MB
tsc 6.0.3 (3 runs) 1.30s 488 MB
tsc 7.0.2 0.23s 245 MB
bun check 1.4.3 0.35s 201 MB

On a project this small, fixed overhead wins. Fewer threads didn’t help either: --threads 1 took 0.52s. Both TS 7 checkers are still several times faster than the TS 6 tsc this blog has today.

That’s two projects, not a scaling test. tsc 7 won at 55 files and bun check won at 710, and I can’t tell you where in between yours lands. Time it.

I also ran Playwright on a GitHub Actions ubuntu-latest runner with four vCPUs, same commit, one warmup and seven runs each. tsc 7 took 3.01s and 1150 MB at the median, and the bunx recipe timed the same. bun check took 1.22s and 320 MB.

On half the M1’s cores the lead shrank to 2.5x, with 3.6x less memory. The speedup depends on the machine as well as the project. That run only timed the checkers. I didn’t compare their errors on Linux.

--check only follows imports

1.4.3 also added a --check flag to bun run, bun test and bun build. It type-checks first and stops on an error. A failed bun build --check wrote no output directory at all.

The catch is scope. --check checks the entry file and what it imports statically. It doesn’t follow workers, computed import(), require() in TypeScript, spawned processes or preloaded files. On the seeded project:

--check on the seeded project
$ bun run --check src/main.ts
Found 1 error in 1 file, checked 2 files # exit 1
$ bun run --check src/loader.ts
loader ran # exit 0, plugin.ts error missed
$ bun test --check
Found 1 error in 1 file, checked 1 file # exit 1, five errors not checked

src/loader.ts loads plugin.ts through a computed import(), so nothing looked at its type error. bun test --check looked at the test file and its imports, which here is one file.

src/loader.ts loads ./${name}.ts with import(), and that file has a type error. Which command catches it?

The flags are good in a local loop, where you’re running that entry anyway. They don’t replace a whole-project bun check.

.astro files are invisible

Neither bun check nor tsc reads .astro files. In a copy of this blog I added one line to the frontmatter of src/components/Kbd.astro:

src/components/Kbd.astro
const width: number = "wide";

tsc 7 exited 0. bun check printed ✓ No type errors in 55 files and exited 0. Only astro check caught it:

astro check
src/components/Kbd.astro:3:7 - error ts(2322): Type 'string' is not assignable to type 'number'.
Result (109 files): 1 error

There’s an open request for .vue, .svelte and .astro support. Until then an Astro project keeps astro check. And @astrojs/check peers on typescript ^5.0.0 || ^6.0.0, so the TS 6 install stays too.

What I’d put in CI

Here’s what each command read in my tests. Pick one, then tick the box to see the trap from the top of the post.

Run
  • .ts reached by static importssrc/price.tsreadsTS2322 caughtreadsTS2322 caught, entry src/main.tsmisseschecked 1 file, not this onereadsTS2322 caughtnot testedmissesyour script ran instead
  • .ts reached only by a computed import()src/plugin.tsreadsTS2322 caughtmissesentry src/loader.ts ran, exit 0misseschecked 1 file, not this onereadsTS2322 caughtnot testedmissesyour script ran instead
  • test filestest/math.test.tsreadsTS2345 caughtmissesnot imported by src/main.tsreadsTS2345 caughtreadsTS2345 caughtnot testedmissesyour script ran instead
  • .astro filessrc/components/Kbd.astromisses“No type errors”, exit 0not testednot testedmissesexit 0readsts(2322) caughtmissesyour script ran instead

Everything tsconfig.json includes, so all six seeded .ts errors. Nothing in .astro.

The entry file and its static imports. From src/main.ts that was two files, and the computed import() in src/loader.ts went unread.

The test files and their static imports. On the seeded project, one file.

The same reach as bun check, and the same six errors.

The only one that read the .astro file. I didn't run it on the seeded project.

bun check ran the script instead. Mine was an echo, so it exited 0 and not one file was type-checked.

bun check can replace tsc --noEmit. Nothing in that map replaces astro check.

If your package.json has a check script, use bun --check in CI until --no-script ships, then switch to bun check --no-script, which the docs call “always the type checker”. Or rename your script to something like typecheck, so bun check is the checker for everyone.

On 1.4.3, a job looks like this:

.github/workflows/verify.yml
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.3
- run: bun install --frozen-lockfile
- run: bun --check # not `bun check` while a check script exists
- run: bun test

Otherwise it behaves well in CI. It exits 1 on errors and 0 on none. Errors go to stdout and the summary line to stderr. If it finds nothing to check, it exits 1 with TS18003, so a job running in the wrong directory fails instead of passing. On shared runners the docs suggest --threads 4, because it starts one thread per core by default.

It also writes GitHub Actions annotations by itself, no problem matcher needed. I pushed the seeded errors to a test pull request, and the check run got six annotations, each with the file, line, column and TS code. tsc 7 printed the same six errors and added none. Locally you can see the raw lines by setting GITHUB_ACTIONS=true:

bun check with GITHUB_ACTIONS=true
::error file=src/expect.ts,line=1,col=1,endLine=1,endColumn=40,title=TS2578::Unused '@ts-expect-error' directive.
::error file=src/first.ts,line=2,col=10,endLine=2,endColumn=15,title=TS2532::Object is possibly 'undefined'.

This blog’s CI pins Bun 1.3.8, which has no bun check at all. When it moves, a bun --check step makes a fast first gate in front of astro check, not a replacement for it.

Once --no-script ships, the trap closes for anyone who uses the flag. Until then, in a repo with a check script, bun check runs the script, and exit 0 only tells you the script passed.

Piwi hands a single letter to the user at a mailbox; a small note reads no noise.

Get the next one in your inbox

One email when a post goes out, with its sketch. Nothing in between, and one link to leave.

Sign in faster next time?

Add a passkey and skip the email link. Your fingerprint, face or device PIN is enough.