Prettier 3.1.0
Playground link
Input:
export default class Foo {
constructor({
foo,
// bar = "bar",
// bazz = "bazz",
}: FooInit) {}
}
Output:
export default class Foo {
constructor({
foo,
} // bar = "bar",
// bazz = "bazz",
: FooInit) {}
}
Expected behavior:
I would expect no changes whatsoever to the original input:
export default class Foo {
constructor({
foo,
// bar = "bar",
// bazz = "bazz",
}: FooInit) {}
}
Notes
This behaviour is actually fairly buggy, not only is the output not desirable, the output isn't stable, feeding the output back into prettier changes it again:
export default class Foo {
constructor({
foo, // bar = "bar",
} // bazz = "bazz",
: FooInit) {}
}
which feeding back in becomes (and will from now on alternate between this and the above printing):
export default class Foo {
constructor({
foo, // bar = "bar",
// bazz = "bazz",
}: FooInit) {}
}
Prettier 3.1.0
Playground link
Input:
Output:
Expected behavior:
I would expect no changes whatsoever to the original input:
Notes
This behaviour is actually fairly buggy, not only is the output not desirable, the output isn't stable, feeding the output back into prettier changes it again:
which feeding back in becomes (and will from now on alternate between this and the above printing):