File tree 2 files changed +8
-8
lines changed
packages/angular_devkit/build_angular
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,11 @@ export default class TslintBuilder implements Builder<TslintBuilderOptions> {
63
63
const targetSpecifier = this . context . targetSpecifier ;
64
64
const projectName = targetSpecifier && targetSpecifier . project || '' ;
65
65
66
- // Print formatter output directly for non human-readable formats.
67
- if ( ! [ 'prose' , 'verbose' , 'stylish' ] . includes ( options . format ) ) {
68
- options . silent = true ;
69
- }
66
+ // Print formatter output only for non human-readable formats.
67
+ const printInfo = [ 'prose' , 'verbose' , 'stylish' ] . includes ( options . format )
68
+ && ! options . silent ;
70
69
71
- if ( ! options . silent ) {
70
+ if ( printInfo ) {
72
71
this . context . logger . info ( `Linting ${ JSON . stringify ( projectName ) } ...` ) ;
73
72
}
74
73
@@ -127,15 +126,15 @@ export default class TslintBuilder implements Builder<TslintBuilderOptions> {
127
126
}
128
127
}
129
128
130
- if ( result . warningCount > 0 && ! options . silent ) {
129
+ if ( result . warningCount > 0 && printInfo ) {
131
130
this . context . logger . warn ( 'Lint warnings found in the listed files.' ) ;
132
131
}
133
132
134
- if ( result . errorCount > 0 && ! options . silent ) {
133
+ if ( result . errorCount > 0 && printInfo ) {
135
134
this . context . logger . error ( 'Lint errors found in the listed files.' ) ;
136
135
}
137
136
138
- if ( result . warningCount === 0 && result . errorCount === 0 && ! options . silent ) {
137
+ if ( result . warningCount === 0 && result . errorCount === 0 && printInfo ) {
139
138
this . context . logger . info ( 'All files pass linting.' ) ;
140
139
}
141
140
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ describe('Tslint Target', () => {
43
43
tap ( ( buildEvent ) => expect ( buildEvent . success ) . toBe ( true ) ) ,
44
44
tap ( ( ) => {
45
45
expect ( logger . includes ( 'Linting "app"...' ) ) . toBe ( false ) ;
46
+ expect ( logger . includes ( '<checkstyle' ) ) . toBe ( true ) ;
46
47
} ) ,
47
48
) . toPromise ( ) . then ( done , done . fail ) ;
48
49
} , 30000 ) ;
You can’t perform that action at this time.
0 commit comments