Closed
Description
When importing with just types no export {}
should be added. And I would also opine that if a person wants to emit export {}
they should actually write that into their code themselves or be able to add a hook into the compiler which says to do that. This breaks my browser code. We shouldn't have magical code like this in the compiler. And service workers do not understand the keyword export
.
Code
import { Tester } from "./tester"
(async function test() : Promise<Tester> { return { hello: "export" } }())
Expected behavior:
(async function test() { return { hello: "export" }; }());
Actual behavior:
(async function test() { return { hello: "export" }; }());
export {};
Related Issues:
#38696
#38713
https://stackoverflow.com/questions/64798609/typescript-appends-export-to-end-of-file-in-typescript-4-but-not-typescript-3