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

Ignore allowImportingTsExtensions in transpileModule to suppress option validation error with noEmit #53599

Conversation

andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Mar 31, 2023

Fixes ~ TypeStrong/ts-loader#1602
Fixes ~ TypeStrong/ts-node#1981

ts.transpileModule erases any value of noEmit from the incoming compiler options, but still creates a program that does option validation. One validation is that allowImportingTsExtensions requires noEmit to be set, so including this option in transpileModule calls was always an error. The fix is to erase allowImportingTsExtensions too—since its only purpose is to silence an error in checker code that doesn‘t run in transpilation, it’s not necessary to include in the first place. It can be completely ignored in transpilation.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Mar 31, 2023
@andrewbranch
Copy link
Member Author

@typescript-bot cherry-pick to release-5.0

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 31, 2023

Heya @andrewbranch, I've started to run the task to cherry-pick this into release-5.0 on this PR at 2823dd0. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

Hey @andrewbranch, I've opened #53600 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Mar 31, 2023
Component commits:
2823dd0 Ignore `allowImportingTsExtensions` in transpileModule to suppress option validation error with `noEmit`
@andrewbranch andrewbranch merged commit b29ed18 into microsoft:main Mar 31, 2023
@andrewbranch andrewbranch deleted the bug/allow-importing-ts-extensions-transpile-module branch March 31, 2023 16:10
DanielRosenwasser pushed a commit that referenced this pull request Apr 5, 2023
Yangqing pushed a commit to leptonai/leptonai that referenced this pull request Sep 8, 2023
drivron pushed a commit to scenari/typescript that referenced this pull request Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants