Skip to main content
Install @types/bun to get TypeScript definitions for Bun’s built-in APIs.
You can now reference the Bun global in your TypeScript files without seeing errors in your editor.

Suggested compilerOptions

Bun supports top-level await, JSX, and imports with .ts extensions, which TypeScript doesn’t allow by default. The following compilerOptions are recommended for a Bun project, so you can use these features without compiler warnings from TypeScript.
Running bun init in a new directory generates this tsconfig.json for you. (The stricter flags are disabled by default.)