Skip to content

[2.10.1] class keyword causes unwanted split #956

Description

@boris-petrov

Prettier-Java 2.10.1

Playground link

--print-width 40

Input:

var a = b
  ? c.c().c(A.class).c()
  : c.c().c(A.class).c();

Output:

var a = b
  ? c
      .c()
      .c(A.class)
      .c()
  : c
      .c()
      .c(A.class)
      .c();

Expected behavior:
Unchanged because Prettier for JS does that. Note that it's because of the class keyword. If you change it to something else, the output becomes correct.

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