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?
You should set "htmlWhitespaceSensitivity": "ignore"
in your project's .prettierrc file.
https://prettier.io/docs/en/options.html#html-whitespace-sensitivity
Since the issue finally got resolved:
You can now use bracketSameLine: true
in the prettier settings to control the behaviour.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With