Skip to content

[2.9.7] Regression formatting return-statement with parentheses #921

@boris-petrov

Description

@boris-petrov

Prettier-Java 2.9.7

Playground link

--print-width 80

Input:

return (
  a(b) && a.a().a()
    ? a.a()
    : a
).toString();

Output:

return (a(b) && a.a().a()
  ? a.a()
  : a
).toString();

Expected behavior:

return (
  a(b) && a.a().a() ? a.a() : a
).toString();

Because Prettier for JS does this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions