Skip to content

Commit 8f5ba3c

Browse files
committed
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.
1 parent e7d955b commit 8f5ba3c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ import { <% if(changeDetection !== 'Default') { %>ChangeDetectionStrategy, <% }%
88
<p>
99
<%= dasherize(name) %> works!
1010
</p>
11-
`<% } else { %>
12-
templateUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %><%= ngext %>.html'<% } if(inlineStyle) { %>,
11+
`,<% } else { %>
12+
templateUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %><%= ngext %>.html',<% } if(inlineStyle) { %>
1313
styles: `<% if(displayBlock){ %>
1414
:host {
1515
display: block;
1616
}
17-
<% } %>`<% } else if (style !== 'none') { %>,
18-
styleUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>.<%= style %>'<% } %><% if(!!viewEncapsulation) { %>,
19-
encapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } if (changeDetection !== 'Default') { %>,
20-
changeDetection: ChangeDetectionStrategy.<%= changeDetection %><% } %>
17+
<% } %>`,<% } else if (style !== 'none') { %>
18+
styleUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>.<%= style %>',<% } %><% if(!!viewEncapsulation) { %>
19+
encapsulation: ViewEncapsulation.<%= viewEncapsulation %>,<% } if (changeDetection !== 'Default') { %>
20+
changeDetection: ChangeDetectionStrategy.<%= changeDetection %>,<% } %>
2121
})
2222
export <% if(exportDefault) {%>default <%}%>class <%= classifiedName %> {
2323

0 commit comments

Comments
 (0)