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

- Published: 2026-10-27
- Updated: 2026-11-26
- Tags: TypeScript, Tooling
- URL: https://devtrillo.com/writing/bun-check-vs-tsc-7/

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

```text title="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](https://bun.com/blog/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.

_Already know this? Jump to [What I'd put in CI](https://devtrillo.com/writing/bun-check-vs-tsc-7/#what-id-put-in-ci)._

## A `check` script wins

The project had this in `package.json`:

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

That's on purpose, and [the docs](https://bun.com/docs/runtime/check) 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](/writing/your-agents-cant-see/), so here `bun check` runs Astro's checker instead.

Someone filed it as [a bug](https://github.com/oven-sh/bun/issues/45232), 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](https://github.com/oven-sh/bun/pull/45482), 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:

```text title="--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`.

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

- Bun type-checks, then runs biome
- Bun runs biome check and never type-checks
- Bun errors out: ambiguous command
- Bun type-checks and ignores the script

**Answer:** Bun runs biome check and never type-checks — A check script wins over the built-in command. On 1.4.3 use bun --check, and switch to bun check --no-script once it ships.

## 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:

```bash title="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](/writing/typescript-7-side-by-side/).

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":

```bash title="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](https://github.com/microsoft/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](https://github.com/oven-sh/bun/issues?q=is%3Aissue+is%3Aopen+%22bun+check%22+in%3Atitle) 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:

```text title="--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.

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

- bun run --check src/loader.ts
- bun test --check
- bun check
- None of them

**Answer:** bun check — --check follows static imports only. bun check checks everything your tsconfig.json includes.

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`:

```ts title="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:

```text title="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](https://github.com/oven-sh/bun/issues/45163) 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.

**Which file kinds each type checker reads**, from the lab:

| File kind | `bun check` | `bun run --check` | `bun test --check` | `tsc 7` | `astro check` |
| --- | --- | --- | --- | --- | --- |
| .ts reached by static imports (`src/price.ts`) | reads: TS2322 caught | reads: TS2322 caught, entry src/main.ts | misses: checked 1 file, not this one | reads: TS2322 caught | not tested |
| .ts reached only by a computed import() (`src/plugin.ts`) | reads: TS2322 caught | misses: entry src/loader.ts ran, exit 0 | misses: checked 1 file, not this one | reads: TS2322 caught | not tested |
| test files (`test/math.test.ts`) | reads: TS2345 caught | misses: not imported by src/main.ts | reads: TS2345 caught | reads: TS2345 caught | not tested |
| .astro files (`src/components/Kbd.astro`) | misses: “No type errors”, exit 0 | not tested | not tested | misses: exit 0 | reads: ts(2322) caught |

- `bun check`: Everything tsconfig.json includes, so all six seeded .ts errors. Nothing in .astro.
- `bun run --check`: 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.
- `bun test --check`: The test files and their static imports. On the seeded project, one file.
- `tsc 7`: The same reach as bun check, and the same six errors.
- `astro check`: The only one that read the .astro file. I didn't run it on the seeded project.

When package.json has a `check` script, `bun check` misses every file kind (your script ran instead): 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:

```yaml title=".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`:

```text title="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'.
```

> **Note:** With `--cwd`, the paths in those annotations are relative to that directory.
> In a monorepo subfolder they may not line up with the files in your pull
> request. I haven't tested that on a real runner.

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.

> **Tip:** Whichever way you go, prove the step can fail. Push a commit with a deliberate
> type error and watch the job go red. The green run at the top of this post
> fails that test.

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.
