StyLua icon indicating copy to clipboard operation
StyLua copied to clipboard

Improve formatting of leading tokens in type union / intersection

Open JohnnyMorganz opened this issue 1 year ago • 1 comments

#854 will introduce support for leading tokens in unions / interesctions, but we should format them better:

  • If single line, remove a leading token
  • If multi line, start with a leading token:
type Foo = 
    | X
    | Y

JohnnyMorganz avatar Nov 16 '24 17:11 JohnnyMorganz

Prettier will probably be a good example for these cases. Interestingly, they only format leading for unions, not intersections:

image

JohnnyMorganz avatar Nov 17 '24 19:11 JohnnyMorganz