Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Format interface members on separate lines #2420

Closed
Tracked by #2403
MichaReiser opened this issue Apr 13, 2022 · 0 comments · Fixed by #2511
Closed
Tracked by #2403

Format interface members on separate lines #2420

MichaReiser opened this issue Apr 13, 2022 · 0 comments · Fixed by #2511
Labels
A-Formatter Area: formatter good first issue Good for newcomers

Comments

@MichaReiser
Copy link
Contributor

MichaReiser commented Apr 13, 2022

Prettier formats each interface member on its own line whereas Rome tries to fit as many as possible on a single line Playground.

Input

interface X { a }

interface Y {
  method();
}

interface Z {
  new (): Y;
}

interface A {
  [index: string]: string;
}

// BUT!
type T = { a, b, c, d};

Prettier

interface X {
  a;
}

interface Y {
  method();
}

interface Z {
  new (): Y;
}

interface A {
  [index: string]: string;
}

// BUT!
type T = { a; b; c; d };

Rome

interface X { a }

interface Y { method() }

interface Z { new(): Y }

interface A { [index: string]: string }

// BUT!
type T = { a; b; c; d };

Expected

Rome formats every interface member on its own line but tries to fit as many type members on a single line as possible (same as Prettier)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Formatter Area: formatter good first issue Good for newcomers
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant