-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Revert adding spaces in Angular Pipes #13887
Copy link
Copy link
Closed
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.status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
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.status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
Prettier 2.8.0
Prettier 2.8.0 "fixes" issue #13058
But it was not thoroughly discussed. I think it was not discussed at all in the Angular Repository. Opinions of a few Taiga UI users should not overweight all the examples in the official Angular documentation, where pipes are separated with spaces, and pipe arguments stand close to pipe names.
Reference:
https://angular.io/guide/pipes-transform-data
https://angular.io/api/common/CurrencyPipe#usage-notes
Input:
{{ (user$ | async).credit | currency:'CAD':'symbol-narrow':'4.2-2' }} {{ (user$ | async).items | slice:1:5 }}Output:
{{ (user$ | async).credit | currency : 'CAD' : 'symbol-narrow' : '4.2-2' }} {{ (user$ | async).items | slice : 1 : 5 }}Expected behavior:
{{ (user$ | async).credit | currency:'CAD':'symbol-narrow':'4.2-2' }} {{ (user$ | async).items | slice:1:5 }}Also, Webstorm displays names of arguments, and it does not look as good with additional spaces:

As a compromise, I suggest not adding spaces if a pipe argument is a string or a number, but add spaces in all other cases.
Expected behavior:
{{ (user$ | async).credit | currency:'CAD':'symbol-narrow':'4.2-2' }} {{ (user$ | async).items | slice:1:5 }} {{ chart | tuiFilter : filter : range | tuiMapper : toNumbers : range }}