Prettier v3.8.1
Playground link
--parser babel
--tab-width 4
--no-semi
--experimental-ternaries
Input:
condition ? ifTrue
: [
// Hello, world!
]
Output:
condition ? ifTrue
// Hello, world!
: (
[
// Hello, world!
]
)
Expected output:
condition ? ifTrue
: [
// Hello, world!
]
Why?
Prettier should not duplicate the comment. I don't really have any specific expected output (other than preserving the fact that the comment is only written once), although wrapping the array in parentheses seems unnecessary.
Prettier v3.8.1
Playground link
Input:
Output:
Expected output:
Why?
Prettier should not duplicate the comment. I don't really have any specific expected output (other than preserving the fact that the comment is only written once), although wrapping the array in parentheses seems unnecessary.