Skip to content

Keep tags of tagged unions at beginning. #2962

@ForkKILLET

Description

@ForkKILLET

Language

Typescript

Input

type TaggedUnion =
  | { type: 'number', a: number, b: number }
  | { type: 'string', z: string, y: string }

Expected output

I think keeping tags of tagged unions at beginning (and perhaps sort by the tag?) would be sensible in this situation.

type TaggedUnion =
  | { type: 'number', a: number, b: number }
  | { type: 'string', y: string, z: string }

Actual output (or error message)

type TaggedUnion =
  | { a: number, b: number, type: 'number' }
  | { type: 'string', y: string, z: string }

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