Skip to content

Conversation

@jtkiesel
Copy link
Contributor

@jtkiesel jtkiesel commented Sep 9, 2025

What changed with this PR:

Nested ternaries are now broken together as a single group, rather than individually, as Prettier TypeScript does.

Example

Input

class Example {

  void example() {
    aaaaaaaaaa ? bbbbbbbbbb : cccccccccc ? dddddddddd : eeeeeeeeee ? ffffffffff : gggggggggg;
  }
}

Output

class Example {

  void example() {
    aaaaaaaaaa
      ? bbbbbbbbbb
      : cccccccccc
        ? dddddddddd
        : eeeeeeeeee
          ? ffffffffff
          : gggggggggg;
  }
}

Relative issues or prs:

Closes #769

@jtkiesel jtkiesel merged commit 9f1817d into jhipster:main Sep 9, 2025
6 checks passed
@jtkiesel jtkiesel deleted the fix/break-nested-ternaries-together branch September 9, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-ternary collapsed in a single line

1 participant