Skip to content

String-backed enum cases that have single-quotes break TS unions #99

@harrison-bouche

Description

@harrison-bouche

Description

The enum generated uses single-quotes as the string delimiter, but doesn't escape any single quotes inside the value of the case. This might be the case with native TS enums as well, but I do not use native enums in my TS code.

Desired functionality

export type properEnumUnion = 'Bachelor\'s degree' | 'Associate\'s degree';

Current functionality

export type brokenEnumUnion = 'Bachelor's degree' | 'Associate's degree';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions