tsconfig: explicit 'types': ['bun'] for VS Code LSP
bun:test types live in 'bun-types', which is pulled in transitively by @types/bun via a /// <reference types="bun-types" /> directive. bunx tsc finds this via auto-discovery, but VS Code's TS Language Server doesn't always honor auto-discovered @types/* packages under moduleResolution: bundler, so it shows a phantom 'Cannot find module bun:test' error in the editor. Adding 'types': ['bun'] to compilerOptions makes the inclusion explicit and matches what 'bun init' generates for new projects. tsc still passes; the bun test suite still passes; the editor LSP now resolves bun:test correctly.
This commit is contained in:
+2
-1
@@ -10,7 +10,8 @@
|
|||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"noUncheckedIndexedAccess": true
|
"noUncheckedIndexedAccess": true,
|
||||||
|
"types": ["bun"]
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts", "tests/**/*.ts"]
|
"include": ["src/**/*.ts", "tests/**/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user