Search code examples
visual-studio-codeprettier

VSCode Prettier formats HTML in an odd way (greater-than-symbol on next line)


Since today VSCode with installed Prettier Extension formats my HTML in a really odd way. For example:

<button
  class="btn btn-secondary mr-2"
  (click)="updateEditState(EditState.preview)"
  *ngIf="!(preview | async)"
>
  <ng-container i18n="AppPreviewEditButton|Enables the Preview mode of the page@@AppPreviewButton"
    >Preview</ng-container
  >
</button>
<button class="btn btn-secondary mr-2" (click)="updateEditState(EditState.edit)" *ngIf="!(edit | async)">
  <ng-container i18n="AppPreviewEditButton|Enables the Edit mode of the page@@AppEditButton"
    >Edit</ng-container
  >
</button>

Notice the > on new lines. Did somebody else experienced the same and has a solution?


Solution

  • Since the issue finally got resolved: You can now use bracketSameLine: true in the prettier settings to control the behaviour.