프로젝트에서 Bun 의 내장 API 를 위한 TypeScript 정의를 설치하려면 @types/bun 을 설치하세요.
sh
bun add -d @types/bun # dev dependency아래는 Bun 프로젝트를 위한 권장되는 전체 compilerOptions 세트입니다. 이 tsconfig.json 을 사용하면 top-level await, 확장자 포함 또는 확장자 없는 import 및 JSX 를 사용할 수 있습니다.
json
{
"compilerOptions": {
// 환경 설정 및 최신 기능
"lib": ["ESNext"],
"target": "ESNext",
"module": "Preserve",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
// 번들러 모드
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,
// 모범 사례
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
// 일부 더 엄격한 플래그 (기본적으로 비활성화됨)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}Bun 의 TypeScript 지원에 대한 완전한 가이드는 런타임 > TypeScript 를 참조하세요.