Skip to content

Export Type { Interface } creates empty export #47470

Open
@Caleb-T-Owens

Description

@Caleb-T-Owens

Bug Report

🔎 Search Terms

export type
export type interface
export type creates empty export

🕗 Version & Regression Information

From version 4.0 till nightly

The issue that I'm discovering is that my JS output is being covered in files containting export {} where I've defined a interface that gets exported. It would be preferable if these files could not be created.

⏯ Playground Link

Playground link with relevant code

💻 Code

interface Foo {

}

export type { Foo }

or

export type Foo = string

🙁 Actual behavior

Generates a JS file with an empty export, IE

export {}

🙂 Expected behavior

I would expect there to be no JS file generated as types are only used at compile time.

There really shouldn't be any imports for the interfaces left in the JS so having these loose exports tidied up shouldn't cause any unexpected side effects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    In DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions