Skip to content

Commit 026a9c1

Browse files
MeAkibclydin
authored andcommitted
refactor(@schematics/angular): add trailing commas to generated directive, pipe, and guard files
Enforces consistent code formatting in generated artifacts by adding trailing commas to class metadata and other relevant object literals in directives, pipes, and guards. (cherry picked from commit 3b536d9)
1 parent bab5806 commit 026a9c1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/schematics/angular/directive/files/__name@dasherize__.__type@dasherize__.ts.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Directive } from '@angular/core';
22

33
@Directive({
4-
selector: '[<%= selector %>]'<% if(!standalone) {%>,
5-
standalone: false<%}%>
4+
selector: '[<%= selector %>]',<% if(!standalone) {%>
5+
standalone: false,<%}%>
66
})
77
export class <%= classifiedName %> {
88

packages/schematics/angular/guard/implements-files/__name@dasherize____typeSeparator__guard.ts.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
22
import { <%= routerImports %> } from '@angular/router';
33

44
@Injectable({
5-
providedIn: 'root'
5+
providedIn: 'root',
66
})
77
export class <%= classify(name) %>Guard implements <%= implementations %> {
88
<% if (implements.includes('CanActivate')) { %>canActivate(

packages/schematics/angular/pipe/files/__name@dasherize____typeSeparator__pipe.ts.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Pipe, PipeTransform } from '@angular/core';
22

33
@Pipe({
4-
name: '<%= camelize(name) %>'<% if(!standalone) {%>,
5-
standalone: false<%}%>
4+
name: '<%= camelize(name) %>',<% if(!standalone) {%>
5+
standalone: false,<%}%>
66
})
77
export class <%= classify(name) %>Pipe implements PipeTransform {
88

0 commit comments

Comments
 (0)