-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do this
Milestone
Description
TypeScript Version: 3.7.3
Search Terms: export default
Code
Does not throw an error:
// a.ts
// whoops this should be a named export!
export { default } from "./b"
// b.ts
export const foo = "bar"But this does throw an error:
// a.ts
// Error: Module has no default export
import foo from "./b"
export default foo;
// b.ts
export const foo = "bar"Expected behavior:
Shorthand export { default } from syntax should error in the same way import foo from syntax does when no default export is present.
Actual behavior:
Shorthand export { default } from does not error as expected. I noticed this when debugging TSServer due to broken intellisense suggestions. The suggestions would not appear anywhere in our project, due to TSServer error "Alias targets of default exports must have a parent".
Playground Link:
Related Issues:
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do this