Skip to main content
To add TypeScript definitions for Bun’s built-in APIs to your project, install @types/bun.
terminal

Here is the full set of recommended compilerOptions for a Bun project. With this tsconfig.json, you can use top-level await, extensioned or extensionless imports, and JSX.
tsconfig.json

If you’re using TypeScript 6.0 or later, you also need "types": ["bun"] in your compilerOptions. See TypeScript 6 and 7 for details.
See TypeScript.