Skip to content

Commit fdeff17

Browse files
MeAkibclydin
authored andcommitted
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. (cherry picked from commit a660d69)
1 parent 3620d32 commit fdeff17

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 <%= classify(name) %><%= classify(type) %> {
2323

0 commit comments

Comments
 (0)