You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/esm-migration-plan.md
+26-6Lines changed: 26 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,27 @@
4
4
5
5
This document outlines the plan to migrate from TypeScript's deprecated `"moduleResolution": "node"` (node10) to `"moduleResolution": "node16"` or `"nodenext"`. This change is necessary because the published ESM packages have extensionless imports that don't work correctly in modern ESM environments.
6
6
7
+
## TL;DR - Remaining Work
8
+
9
+
-[x] expressions - Migrated ✅
10
+
-[x] workflow-parser - Migrated ✅
11
+
-[x] languageservice - Migrated ✅
12
+
-[x] languageserver - Add `.js` extensions to imports ✅
13
+
-[ ] languageserver - Update `tsconfig.build.json` to `moduleResolution: "node16"` (blocked by vscode-languageserver)
14
+
-[ ] languageserver - Upgrade `vscode-languageserver` to stable v10+ when released
15
+
16
+
**Blocker:**`vscode-languageserver@8.0.2` lacks ESM exports. Stable v10 with `exports` field needed.
17
+
18
+
### ⚠️ Important: `skipLibCheck: true` Required
19
+
20
+
All migrated packages use `skipLibCheck: true` in their `tsconfig.build.json`. This works around a TS2386 "Overload signatures must all be optional or required" error in `@types/node/module.d.ts`.
21
+
22
+
**Why can't we just fix the error?** The error is in `@types/node`, a third-party package maintained by DefinitelyTyped. We can't modify `node_modules`, and upstream fixes take time.
23
+
24
+
**Is `skipLibCheck` safe?** Yes. It only skips type checking of `.d.ts` files (declaration files from dependencies). Our own `.ts` source files are still fully type-checked. This is a common and recommended workaround for issues in third-party type definitions.
With `moduleResolution: "node16"`, TypeScript follows Node.js ESM resolution rules which require explicit `exports` for subpath imports like `vscode-languageserver/browser` and `vscode-languageserver/node`.
201
222
202
-
**Status:**Verified December 2025. Version 9.0.1 is available but ESM export support is not confirmed.
223
+
**Status:**Partial - `.js` extensions added, waiting for stable `vscode-languageserver` release with ESM exports to complete migration.
203
224
204
-
**Current Decision:**The languageserver package is **deferred** from this migration until the upstream `vscode-languageserver` package adds proper ESM exports. It will continue using the old`moduleResolution: "node"`configuration.
225
+
**Completed:**All relative imports in languageserver source files have been updated to use `.js` extensions. This is compatible with the current`moduleResolution: "node"`and will enable a seamless migration once a stable vscode-languageserver version with ESM exports is available.
205
226
206
227
**Options to resolve:**
207
-
- Wait for vscode-languageserver to add ESM exports
208
-
- Try upgrading to vscode-languageserver v9.x to see if exports were added
209
-
- Use a bundler to work around the module resolution
228
+
- Wait for stable vscode-languageserver v10+ with ESM exports
229
+
- Use pre-release `vscode-languageserver@10.0.0-next.16` (has proper exports but is unstable)
0 commit comments