Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@tsconfig/bun

tsconfig285.3kMIT1.0.8

A base TSConfig for working with Bun.

tsconfig, bun

readme

A base TSConfig for working with Bun.

Add the package to your "devDependencies":

npm install --save-dev @tsconfig/bun
yarn add --dev @tsconfig/bun

Add to your tsconfig.json:

"extends": "@tsconfig/bun/tsconfig.json"

The tsconfig.json:

{
  // This is based on https://bun.sh/docs/typescript#suggested-compileroptions
  "$schema": "https://json.schemastore.org/tsconfig",
  "docs": "https://bun.sh/docs/typescript",

  "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
  }
}

You can find the code here.