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

Below 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’ll also need to add "types": ["bun"] to your compilerOptions. See TypeScript 6 and 7 for details.
Refer to Ecosystem > TypeScript for a complete guide to TypeScript support in Bun.