784 B
784 B
Respect trailingComma in Angular templates (#15926 by @fisker)
If you are using an old version of Angular doesn't support trailing comma, make sure add
overrides:
- files: "<patterns-of-my-angular-files>"
options:
trailingComma: none
to your .prettierrc file.
// Input
<div
[ngClass]="{
'px-lg': ctx.spacing == 'lg',
'px-md': ctx.spacing == 'md',
'px-xs': ctx.spacing == 'xs',
}"
></div>
// Prettier stable
<div
[ngClass]="{
'px-lg': ctx.spacing == 'lg',
'px-md': ctx.spacing == 'md',
'px-xs': ctx.spacing == 'xs'
}"
></div>
// Prettier main
<div
[ngClass]="{
'px-lg': ctx.spacing == 'lg',
'px-md': ctx.spacing == 'md',
'px-xs': ctx.spacing == 'xs',
}"
></div>