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

TS: do not import with extensions #5261

Closed
wants to merge 1 commit into from
Closed

Conversation

Murderlon
Copy link
Member

Ref & blocked on: #5258

@Murderlon Murderlon requested review from mifi and aduh95 June 18, 2024 11:07
@Murderlon Murderlon self-assigned this Jun 18, 2024
Copy link
Member

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

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

Strong -1 from me, we waited for TS to support that before we started migrating, extension-guessing is just adding confusion somewhere it's simply not necessary.

Copy link

@remcohaszing remcohaszing left a comment

Choose a reason for hiding this comment

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

File extensions shouldn’t be used. Instead, the .js extension should be used to import .ts or .tsx files, and module in tsconfig.json should be set to nodenext.

I’m fiddling with this, but I see this causes some problems with Vitest.

@remcohaszing
Copy link

After some discussions on Slack and some fiddling, it turns out using the .ts / .tsx extension, or even extensionless or importing a directory containing an index.d.ts file is fine from within a declaration file. That means this change is unnecessary.

@Murderlon Murderlon closed this Jun 18, 2024
@Murderlon Murderlon deleted the ts-no-extensions branch June 18, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants