You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR gives people the Babel behavior that synthesizes a namespace with a default export with plucked properties.
We want people to actually use this because it gives people a migration path to using Node's interop scheme for ES modules.
One change: allowSyntheticDefaultExports no longer actually allows you to default-import from .ts and .js files where inappropriate. Only from .d.ts files.
What about calling and constructing namespace imports?
import*asexpressfrom"express"express();
When using this flag, this will break; otherwise, users will get the same behavior.
Do we want to introduce an error?
That's considered breaking for most people.
But we want to push people to use best practices.
Put it as a default in tsc --init.
Also, if a .d.ts file has a variable named __esModule, then we do the "right" thing.
Should we start emitting __esModule in .d.ts files?
Seems arguable based on the output and the intent.
CommonJS interop
#19675
Let's call this
esModuleInterop
.This PR gives people the Babel behavior that synthesizes a namespace with a default export with plucked properties.
One change:
allowSyntheticDefaultExports
no longer actually allows you to default-import from.ts
and.js
files where inappropriate. Only from.d.ts
files.What about calling and constructing namespace imports?
Do we want to introduce an error?
But we want to push people to use best practices.
tsc --init
.Also, if a
.d.ts
file has a variable named__esModule
, then we do the "right" thing.__esModule
in.d.ts
files?Comparability Relationship Adjustment
#19587
#19322
#19926
a
property nor theb
property.never
should be comparable to/from anything apart fromnever
.The text was updated successfully, but these errors were encountered: