Skip to content

Add explicit types: ["node"] to tsconfig - #161

Merged
aneshlya merged 1 commit into
mainfrom
fix/tsconfig-node-types
Sep 30, 2026
Merged

aneshlya merged 1 commit into
mainfrom
fix/tsconfig-node-types

Conversation

@aneshlya

Copy link
Copy Markdown
Collaborator

Summary

Context

#154 (bump vscode-languageclient 9 → 10.1.2) is the fix for the three open Dependabot alerts on transitive brace-expansion@2.0.3 (under vscode-languageclient@9 → minimatch@5). v10 pulls in minimatch@10 → brace-expansion@5.x, clearing all three GHSAs.

But #154 fails CI:

src/extension.ts(8,23): error TS2591: Cannot find name 'path'. Do you need to install type definitions for node?

TypeScript's own remedy is quoted verbatim: "and then add 'node' to the types field in your tsconfig." On main, vscode-languageclient@9's type surface transitively triggers auto-inclusion of @types/node; v10 no longer does, so we need to name it explicitly.

@types/vscode is imported via a module path (from "vscode") rather than an ambient global, so it doesn't need to be in types — the module resolver still finds it via node_modules/@types/vscode.

Test plan

🤖 Generated with Claude Code

TypeScript emits `Cannot find name 'path'/'net'/'process'` when compiling
`extension.ts` against `vscode-languageclient@10.x` (see #154's failing
CI). The messages come with TS's own remedy: "add 'node' to the types
field in your tsconfig".

The v9 → v10 upgrade drops a transitive that used to trigger
auto-inclusion of `@types/node`; declaring `types: ["node"]` explicitly
loads `@types/node` regardless.

`@types/vscode` is imported by module path and doesn't need to appear in
`types`, so IntelliSense on `vscode` APIs is unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aneshlya
aneshlya merged commit 98d6490 into main Sep 30, 2026
6 checks passed
@aneshlya
aneshlya deleted the fix/tsconfig-node-types branch October 7, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant