-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Description
Prettier 3.7.3
Playground link
--parser babel-tsInput:
// Correct
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx()((
props: xxxxxxxxxxxxx,
) => {
//
});
// Correct
const x = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx((
props: xxxxxxxxxxxxx,
) => {
//
});
// Incorrect, weird group breaking
const x = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx()((
props: xxxxxxxxxxxxx,
) => {
//
});Output:
// Correct
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx()(
(props: xxxxxxxxxxxxx) => {
//
},
);
// Correct
const x = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
(props: xxxxxxxxxxxxx) => {
//
},
);
// Incorrect, weird group breaking
const x = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx()((
props: xxxxxxxxxxxxx,
) => {
//
});Expected output:
// Correct
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx()(
(props: xxxxxxxxxxxxx) => {
//
},
);
// Correct
const x = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
(props: xxxxxxxxxxxxx) => {
//
},
);
// Incorrect, weird group breaking
const x = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx()(
(props: xxxxxxxxxxxxx) => {
//
},
);Why?
Original issue in oxc-project/oxc#16255.
The incorrect example's output is weird; it should be the same as other similar cases, because the argument has no changes in these three cases.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels