Skip to content

Conversation

@andrewbranch
Copy link
Member

When #51669 landed, bundler was the only module resolution mode capable of resolving TS files via .ts-extensioned imports. But since #51435 was merged, every module resolution mode resolves these imports, so there’s no reason to predicate allowImportingTsExtensions on module resolution mode anymore. In fact, allowing .ts-extensioned imports can be useful in --moduleResolution nodenext for users who are targeting Node with a TypeScript-transpiling loader like https://github.com/esbuild-kit/esm-loader.

name: "allowImportingTsExtensions",
type: "boolean",
affectsModuleResolution: true,
affectsSemanticDiagnostics: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a mistake—the option has very intentionally never affected how module resolution works, only whether an error is raised. I’m not sure whether it caused the issue we observed during the bug bash, but I added a unit test that shows the error disappearing when updating this option.

@andrewbranch andrewbranch merged commit 436833a into microsoft:main Jan 17, 2023
@andrewbranch andrewbranch deleted the allowImportingTsExtesions-any-mode branch January 17, 2023 23:13
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

4 participants