From 8f5ba3c3b41c93c76b86a86cf02f491d1796421b Mon Sep 17 00:00:00 2001 From: MeAkib Date: Wed, 22 Oct 2025 00:49:50 +0600 Subject: [PATCH] refactor(@schematics/angular): add trailing commas and remove leading commas in component template Added trailing commas to all component metadata properties in the schematic template to ensure cleaner diffs and consistent formatting. Removed unnecessary leading commas from conditional blocks since each property now ends with a trailing comma. --- ...__name@dasherize__.__type@dasherize__.ts.template | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template b/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template index c914d8a06628..dcea9394edb8 100644 --- a/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template +++ b/packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template @@ -8,16 +8,16 @@ import { <% if(changeDetection !== 'Default') { %>ChangeDetectionStrategy, <% }%

<%= dasherize(name) %> works!

- `<% } else { %> - templateUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %><%= ngext %>.html'<% } if(inlineStyle) { %>, + `,<% } else { %> + templateUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %><%= ngext %>.html',<% } if(inlineStyle) { %> styles: `<% if(displayBlock){ %> :host { display: block; } - <% } %>`<% } else if (style !== 'none') { %>, - styleUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>.<%= style %>'<% } %><% if(!!viewEncapsulation) { %>, - encapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } if (changeDetection !== 'Default') { %>, - changeDetection: ChangeDetectionStrategy.<%= changeDetection %><% } %> + <% } %>`,<% } else if (style !== 'none') { %> + styleUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>.<%= style %>',<% } %><% if(!!viewEncapsulation) { %> + encapsulation: ViewEncapsulation.<%= viewEncapsulation %>,<% } if (changeDetection !== 'Default') { %> + changeDetection: ChangeDetectionStrategy.<%= changeDetection %>,<% } %> }) export <% if(exportDefault) {%>default <%}%>class <%= classifiedName %> {