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/runtime/typescript#recommended-compileroptions
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Bun",
"docs": "https://bun.sh/docs/runtime/typescript",
"compilerOptions": {
// add Bun type definitions
"types": [
"bun-types"
],
// enable latest features
"lib": [
"ESNext"
],
"module": "esnext",
"target": "esnext",
// if TS 5.x+
"moduleResolution": "bundler",
"noEmit": true,
"allowImportingTsExtensions": true,
"moduleDetection": "force",
// support JSX
"jsx": "react-jsx",
// best practices
"strict": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
}
}
You can find the code here.