Prettier 3.7.3
Playground link
Input:
export type AbcdProps = Readonly<
{
/**
* comment
*/
"data-test-id"?: string;
} & (
| {
/**
* comment
*/
image: string | null;
}
| {
image?: never;
} // comment comment comment commment comment comment
) &
(// comment comment comment commment comment.
XyzProps | AbcProps)
>;
Output:
export type AbcdProps = Readonly<
{
/**
* comment
*/
"data-test-id"?: string;
} & (
| {
/**
* comment
*/
image: string | null;
}
| {
image?: never;
} // comment comment comment commment comment comment
// comment comment comment commment comment.
) &
(XyzProps | AbcProps)
>;
Why?
If you copy the output to the input, you get the input - e.g. each time prettier writes you get a new version of the file.
This means just using prettier write and check, we can never have a passing file.
Of course I will change the comments on the original file to avoid this issue, but its still problematic.
Prettier 3.7.3
Playground link
Input:
Output:
Why?
If you copy the output to the input, you get the input - e.g. each time prettier writes you get a new version of the file.
This means just using prettier write and check, we can never have a passing file.
Of course I will change the comments on the original file to avoid this issue, but its still problematic.