-
Notifications
You must be signed in to change notification settings - Fork 13.4k
export * as default from "module" syntax should work as per ECMA-262 #39769
Copy link
Copy link
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptES NextNew featurers for ECMAScript (a.k.a. ESNext)New featurers for ECMAScript (a.k.a. ESNext)Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Milestone
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptES NextNew featurers for ECMAScript (a.k.a. ESNext)New featurers for ECMAScript (a.k.a. ESNext)Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Type
Fields
Give feedbackNo fields configured for issues without a type.
TypeScript Version: 4.0.0-beta
Search Terms:
ESModule, export star as default, "export * as default from"
Expected behavior:
export * as default from "module"should export the namespace of "module" as thedefaultexport.This is valid ES Module syntax from this stage-4 proposal. See the test in test-262.
I also tested this syntax in Chrome and it was supported.
Actual behavior:
You get the following errors:
Code
Output
Compiler Options
{ "compilerOptions": { "noImplicitAny": true, "strictNullChecks": true, "strictFunctionTypes": true, "strictPropertyInitialization": true, "strictBindCallApply": true, "noImplicitThis": true, "noImplicitReturns": true, "alwaysStrict": true, "esModuleInterop": true, "declaration": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, "moduleResolution": 2, "target": "Latest", "jsx": "React", "module": "ESNext" } }Playground Link: Provided