From add4a2d60c728be5f4932e07a6ea86a3b9f1cdc6 Mon Sep 17 00:00:00 2001 From: nokeo08 Date: Wed, 17 Jun 2026 21:15:41 -0500 Subject: [PATCH] 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 /// 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. --- tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index fff48fe..1a3509c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,8 @@ "allowImportingTsExtensions": true, "verbatimModuleSyntax": true, "resolveJsonModule": true, - "noUncheckedIndexedAccess": true + "noUncheckedIndexedAccess": true, + "types": ["bun"] }, "include": ["src/**/*.ts", "tests/**/*.ts"] }