user13094449
user13094449

Reputation:

VS Code changes the default format of my HTML

I don't really understand why VS Code changes the format of my HTML, I have already removed prettify. Any idea how to retain the format for the code that I've pulled? Because when I click save the format changes.

This is the format of the code when I pulled it

<div>
                    <ng-container *ngIf="formSnapshot">
                      <feedback-request-form-renderer [answers]="answers"
                        [canEditFeedbackForm]="canEditFeedbackForm"
                        [canEditFeedbackResponse]="canEditFeedbackResponse"
                        [formName]="templateNameDisplay()"
                        [sections]="formSnapshot"
                        (whenEditFeedbackResponse)="editFeedbackResponse($event)"
                        (whenEditNote)="editNote($event)"
                        (whenRemoveNote)="removeNote($event)"
                        (whenRemoveQuestion)="removeQuestion($event)"
                        (whenRephraseQuestion)="rephraseQuestion($event)"
                      >
                      </feedback-request-form-renderer>

                      <div fxLayout="row" fxLayoutGap="24px" *ngIf="hasReceivedResponse">
                        <div fxFlex fxLayout="row">
                          <mat-form-field appearance="outline" class="pr-4" fxFlex>
                            <mat-label>Employee's comments</mat-label>
                            <textarea
                              cdkTextareaAutosize
                              cdkAutosizeMinRows="3"
                              formControlName="comments"
                              matInput
                            >
                            </textarea>
                          </mat-form-field>
                        </div>
                      </div>

But when I save it, the format changes to

<div>
                  <ng-container *ngIf="formSnapshot">
                    <feedback-request-form-renderer [answers]="answers" [canEditFeedbackForm]="canEditFeedbackForm"
                      [canEditFeedbackResponse]="canEditFeedbackResponse" [formName]="templateNameDisplay()"
                      [sections]="formSnapshot" (whenEditFeedbackResponse)="editFeedbackResponse($event)"
                      (whenEditNote)="editNote($event)" (whenRemoveNote)="removeNote($event)"
                      (whenRemoveQuestion)="removeQuestion($event)" (whenRephraseQuestion)="rephraseQuestion($event)">
                    </feedback-request-form-renderer>

                    <div fxLayout="row" fxLayoutGap="24px" *ngIf="hasReceivedResponse">
                      <div fxFlex fxLayout="row">
                        <mat-form-field appearance="outline" class="pr-4" fxFlex>
                          <mat-label>Employee's comments</mat-label>
                          <textarea cdkTextareaAutosize cdkAutosizeMinRows="3" formControlName="comments" matInput>
                            </textarea>
                        </mat-form-field>
                      </div>
                    </div>
                  </ng-container>
                </div>

Where is the setting in VS Code for that ? I want to follow the format of the code from the team I don't want to change it

Upvotes: 0

Views: 46

Answers (2)

ShrewdStyle
ShrewdStyle

Reputation: 520

Click settings in your VS code in the bottom left and type in save in the search bar, untick the Editor: Format On Save box and that should do it

Upvotes: 1

cd3k
cd3k

Reputation: 812

I'm pretty sure that's one of your plugins, I don't think VSCode does that on its own.

If you think you've definitely uninstalled all your plugins (which should be listed under one of the options on the left hand side). Close the app and start it up again.

Upvotes: 0

Related Questions