-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Prettier adds a colon after 'track' #15784
Copy link
Copy link
Labels
lang:angularIssues affecting Angular template (not general JS/TS issues used for Angular)Issues affecting Angular template (not general JS/TS issues used for Angular)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 3.1.1
Playground link
--parser babelInput:
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { UntilDestroy } from "@ngneat/until-destroy";
@UntilDestroy()
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: "example",
template: `
@for (item of items; let i = $index; track block) {}
`,
})
export class Example {
constructor() {}
ngOnInit() {}
ngAfterViewInit() {}
ngOnChanges() {}
ngOnDestroy() {}
}Output:
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { UntilDestroy } from "@ngneat/until-destroy";
@UntilDestroy()
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: "example",
template: `
@for (item of items; let i = $index; track: block) {}
`,
})
export class Example {
constructor() {}
ngOnInit() {}
ngAfterViewInit() {}
ngOnChanges() {}
ngOnDestroy() {}
}Expected behavior:
I was expecting no changes to the Input code, but Prettier adds a colon after 'track' , which is invalid syntax for Angular 17's control flow
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:angularIssues affecting Angular template (not general JS/TS issues used for Angular)Issues affecting Angular template (not general JS/TS issues used for Angular)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.