Skip to content

Emit a better warning when default-exporting an inappropriate declaration #3917

@DanielRosenwasser

Description

@DanielRosenwasser

Courtesy of @LPGhatguy in #3914.

Instead of going off the rails, we should resiliently parse the following:

export default interface User {
    hi: string;
}

And give an error like

An 'interface' declaration cannot be 'export default'. Consider writing 'export default User;' separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions