Automattic / wp-prettier

Prettier is an opinionated JavaScript formatter.
https://prettier.github.io/prettier/
MIT License
51 stars 1 forks source link

Extraneous space in 2.6.2 when the close-paren starts a line #34

Closed anomiex closed 1 year ago

anomiex commented 2 years ago

wp-prettier 2.6.2

# Options (if any):
--paren-spacing

Input:

const foo = (
    'Something long enough that prettier wraps the parens' ? 'and has to be' : 'an expression so it keeps them'
).bar();

Output:

const foo = (
  "Something long enough that prettier wraps the parens"
    ? "and has to be"
    : "an expression so it keeps them"
 ).bar();

Note the space at the start of the last line.

Expected behavior:

const foo = (
  "Something long enough that prettier wraps the parens"
    ? "and has to be"
    : "an expression so it keeps them"
).bar();
jsnajdr commented 1 year ago

Fixed in wp-prettier@2.8.5, thanks for reporting!