Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: Enabling typescript isolated modules #212835

Closed
Tracked by #212907
SimonSiefke opened this issue May 15, 2024 · 1 comment · Fixed by #212913
Closed
Tracked by #212907

feature request: Enabling typescript isolated modules #212835

SimonSiefke opened this issue May 15, 2024 · 1 comment · Fixed by #212913
Assignees
Labels
engineering VS Code - Build / issue tracking / etc. feature-request Request for new features or functionality wont-fix
Milestone

Comments

@SimonSiefke
Copy link
Contributor

SimonSiefke commented May 15, 2024

Related #160416

For migrating towards ESM in VSCode, it seems the tsconfig isolatedModules option could be useful, ensuring that imports are compatible with ESM.

For example, this typescript code transpiled to javascript would cause a runtime error because of the someType export:

import { someType, someFunction } from "someModule";
 
someFunction();

export { someType, someFunction };

The isolatedModules rule would enforce a type only import for someType:

import { type someType, someFunction } from "someModule";
 
someFunction();

export { type someType, someFunction };

Enabling the isolatedModules tsconfig option in VSCode, it seems these files would need to adjusted:

Found 26 errors in 6 files.

Errors  Files
     9  src/vs/base/common/amd.ts:57
     4  src/vs/base/node/processes.ts:14
     1  src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.ts:636
     1  src/vs/workbench/contrib/inlineChat/common/inlineChat.ts:172
     8  src/vs/workbench/contrib/performance/browser/perfviewEditor.ts:331
     3  src/vs/workbench/contrib/tasks/common/taskService.ts:18
@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label May 22, 2024
@vscodenpa vscodenpa added this to the May 2024 milestone May 22, 2024
@jrieken jrieken assigned jrieken and unassigned mjbvz May 22, 2024
@jrieken jrieken added engineering VS Code - Build / issue tracking / etc. feature-request Request for new features or functionality labels May 22, 2024
@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels May 24, 2024
@benibenj benibenj added verified Verification succeeded verification-needed Verification of issue is requested labels May 28, 2024
@microsoft microsoft locked and limited conversation to collaborators Jul 6, 2024
@jrieken jrieken reopened this Sep 2, 2024
@jrieken jrieken added wont-fix and removed verified Verification succeeded verification-needed Verification of issue is requested labels Sep 2, 2024
@vs-code-engineering vs-code-engineering bot removed the insiders-released Patch has been released in VS Code Insiders label Sep 2, 2024
@jrieken
Copy link
Member

jrieken commented Sep 2, 2024

We reverted this because we learnt, albeit very late, that it has disabled inlining of const enums. See #227372

@jrieken jrieken closed this as not planned Won't fix, can't repro, duplicate, stale Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
engineering VS Code - Build / issue tracking / etc. feature-request Request for new features or functionality wont-fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants