# @jgoz/esbuild-plugin-typecheck

> TypeScript type-checking plugin for esbuild

Latest version **5.0.0** (published 2026-09-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jgoz/esbuild-plugin-typecheck
pnpm add @jgoz/esbuild-plugin-typecheck
yarn add @jgoz/esbuild-plugin-typecheck
bun add @jgoz/esbuild-plugin-typecheck
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2026-09-07 |
| First published | 2022-02-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 44 |
| Author | John Gozde <john@gozde.ca> |
| Maintainers | jgoz |
| Keywords | checking, diagnostics, esbuild, esbuild-plugin, typescript |

## Links

- npm: https://www.npmjs.com/package/@jgoz/esbuild-plugin-typecheck
- Repository: https://github.com/jgoz/esbuild-plugins
- Homepage: https://github.com/jgoz/esbuild-plugins#readme
- Issues: https://github.com/jgoz/esbuild-plugins/issues
- npm.io page: https://npm.io/package/@jgoz/esbuild-plugin-typecheck

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 5.0.0 (latest) — 2026-09-07
- 4.0.5 — 2026-09-06
- 4.0.4 — 2025-10-21
- 4.0.3 — 2025-02-13
- 4.0.2 — 2024-10-24
- 4.0.1 — 2024-07-11
- 4.0.0 — 2024-05-21
- 3.1.3 — 2024-05-11
- 3.1.2 — 2024-05-11
- 3.1.1 — 2024-02-13
- 3.1.0 — 2023-09-06
- 3.0.3 — 2023-07-04
- 3.0.2 — 2023-02-27
- 3.0.1 — 2023-01-18
- 3.0.0 — 2023-01-16
- … 5 more at https://npm.io/package/@jgoz/esbuild-plugin-typecheck/versions

## README

# @jgoz/esbuild-plugin-typecheck

An esbuild plugin for TypeScript type checking and side-channel compilation.

### Features

- Runs asynchronously in a worker thread
- Supports project references and build mode
- Reports errors to `@jgoz/esbuild-plugin-livereload`

### Install

```console
$ npm i @jgoz/esbuild-plugin-typecheck
```

### Usage

Add it to your esbuild plugins:

```js
const esbuild = require('esbuild');
const { typecheckPlugin } = require('@jgoz/esbuild-plugin-typecheck');

await esbuild.build({
  // ...
  plugins: [typecheckPlugin()],
});
```

### API

#### `function typecheckPlugin(options?: TypecheckPluginOptions): Plugin`

**Plugin options:**

<!-- prettier-ignore-start -->
<!-- markdown-interpolate: node ../../scripts/docs.mjs ./src/types.ts TypecheckPluginOptions -->
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| [build](https://www.typescriptlang.org/docs/handbook/project-references.html#tsc--b-commandline) | `boolean \| BuildOptions` | - | Run the compiler in build mode, equivalent to running `tsc --build`. Normally, this will be inferred if `tsconfig.json` sets `"composite": true` but it can be overridden by this option.<br><br>This option also accepts an object, which implicitly turns build mode on. The object accepts build-mode-specific options that will be passed to the TypeScript compiler API. |
| buildMode | `"readonly" \| "write-output"` | `'readonly'` | Changes the behavior of build mode with respect to program output (JavaScript, type definitions, sourcemaps, and .tsbuildinfo files).<br><br>- `readonly` (default) — output files will be written to an in-memory file system and discared   after esbuild exits<li>`write-output` — output files will be written to disk as though you had invoked `tsc --build`<br><br>There are tradeoffs between the two modes. In `readonly` mode, the initial typecheck may be slower, especially if the output/.tsbuildinfo files do not match the source files. However, subsequent incremental typechecks may be slightly faster since no I/O is involved. This mode is also the least surprising because typechecking implies a different intent than compilation, but TypeScript's build mode needs to produce output in order to remain fast for incremental compilation.<br><br>In `write-output` mode, the output files will always be in sync with the input files, so the initial compilation may be slightly faster. However, subsequent incremental typechecks might be slightly slower due to I/O overhead. This mode would be appropriate to enable as an alternative to invoking `tsc --build` manually, e.g., in the case where the TypeScript output itself may be used outside of esbuild. |
| [compilerOptions](https://www.typescriptlang.org/tsconfig) | `CompilerOptions` | `{}` | TypeScript compiler option overrides that will be merged into the options in "tsconfig.json". |
| configFile | `string` | - | Path to "tsconfig.json". If not specified, this will use ESBuild's "tsconfig" option, finally falling back to TypeScript's config file resolution algorithm. |
| logger | `Logger` | - | Logger to use instead of the default. |
| omitStartLog | `boolean` | `false` | Omit "Typecheck started" messages. |
| watch | `boolean` | - | Enable typescript's watch mode |
<!-- end -->
<!-- prettier-ignore-end -->

---
_Source: https://npm.io/package/@jgoz/esbuild-plugin-typecheck · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
