Prettier 3.8.1
Playground link
Input:
|
interface foo1 { |
|
bar3/* foo */ (/* baz */) // bat |
|
bar/* foo */ ? /* bar */ (/* baz */) /* bat */; |
|
bar2/* foo */ (/* baz */) /* bat */ |
|
} |
|
|
|
interface foo2 { |
|
bar/* foo */ ? /* bar */ (bar: /* baz */ string): /* bat */ string; |
|
} |
|
|
class foo1 {
bar() /* bat */;
}
class Test {
foo (/* 2 */) /* 3 */;
}
Output:
class foo1 {
bar /* bat */();
}
class Test {
foo /* 3 */(/* 2 */);
}
Expected output:
Same as input
class foo1 {
bar() /* bat */;
}
class Test {
foo(/* 2 */) /* 3 */;
}
Why?
Should keep the comments in their original place rather than break the order and move them to an incorrect place.
Prettier 3.8.1
Playground link
Input:
prettier/tests/format/typescript/comments/method_types.ts
Lines 1 to 10 in 812a4d0
Output:
Expected output:
Same as input
Why?
Should keep the comments in their original place rather than break the order and move them to an incorrect place.