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

Allow allowImportingTsExtensions to be set in any module resolution mode #52230

Merged

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.

@@ -1089,7 +1089,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
{
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.

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.

4 participants