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

Revert "feat: allow synthetic default imports when testing typescript for esm" #204

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

d-goog
Copy link

@d-goog d-goog commented Dec 13, 2024

Reverts #203

We actually do not want allowSyntheticDefaultImports here (affecting all Node.js TypeScript repos) as it may hide runtime issues within our system tests:

If they encountered an error with import *, it may have appeared as if enabling allowSyntheticDefaultImports would fix it, but in fact it only silenced the build-time error while emitting code that would crash in Node.

Source: https://www.typescriptlang.org/docs/handbook/modules/appendices/esm-cjs-interop.html

Instead, in places where we are relying on a default, we should use import * as something from 'file.ts' appropriately.

@d-goog d-goog requested a review from a team as a code owner December 13, 2024 18:58
@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Dec 13, 2024
@sofisl
Copy link
Contributor

sofisl commented Dec 13, 2024

This PR relies on this setting currently. Can we get tests passing here without the setting before merging this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants