Warning: main(): unterminated entity reference _ol\]\:list-outside ol{list-style-position:outside}.\[\&_ol\]\:list-decimal ol{list-style-type:decimal}.\[\&_ol\]\:pl-4 ol{padding-left:1rem}.\[\&_ul\]\:list-outside ul{list-style-position:outside}.\[\&_ul\]\:list-disc ul{list-style-type:disc}.\[\&_ul\]\:pl-4 ul{padding-left:1rem} in /home/feelan/public_html/ir.apponweb.api/tools/agfdsjafkdsgfkyugebhekjhevbyujec.php on line 264
Install TypeScript declarations for Bun | Bun Examples
Bun

GuidesRuntime

Install TypeScript declarations for Bun

To install TypeScript definitions for Bun's built-in APIs in your project, install @types/bun.

bun add -d @types/bun # dev dependency

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.

{
  "compilerOptions": {
    // Environment setup & latest features
    "lib": ["ESNext"],
    "target": "ESNext",
    "module": "Preserve",
    "moduleDetection": "force",
    "jsx": "react-jsx",
    "allowJs": true,

    // Bundler mode
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "verbatimModuleSyntax": true,
    "noEmit": true,

    // Best practices
    "strict": true,
    "skipLibCheck": true,
    "noFallthroughCasesInSwitch": true,
    "noUncheckedIndexedAccess": true,
    "noImplicitOverride": true,

    // Some stricter flags (disabled by default)
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "noPropertyAccessFromIndexSignature": false,
  },
}

Refer to Ecosystem > TypeScript for a complete guide to TypeScript support in Bun.