Skip to content

[next] Fix invalid TypeScript for enums with no cases - #296

Merged
joetannenbaum merged 1 commit into
nextfrom
converting-empty-enums
Aug 10, 2026
Merged

[next] Fix invalid TypeScript for enums with no cases#296
joetannenbaum merged 1 commit into
nextfrom
converting-empty-enums

Conversation

@joetannenbaum

Copy link
Copy Markdown
Collaborator

An enum with no cases generated export type Foo = with nothing after the equals sign, which does not compile. It now generates never.

While in there, an empty object literal was rendering as { } inline and, worse, as {\n,\n} when not inline, so ObjectBuilder now returns {} when it has no keys. The enum file also had a stray blank line where the case constants would have gone.

Added a caseless enum to the workbench app and covered both the value and the type in the enum tests.

@joetannenbaum
joetannenbaum changed the base branch from main to next August 10, 2026 20:40
@joetannenbaum
joetannenbaum merged commit ab8505f into next Aug 10, 2026
2 checks passed
@joetannenbaum
joetannenbaum deleted the converting-empty-enums branch August 10, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant