File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
packages/angular_devkit/build_angular Expand file tree Collapse file tree 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> {
6363 const targetSpecifier = this . context . targetSpecifier ;
6464 const projectName = targetSpecifier && targetSpecifier . project || '' ;
6565
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 ;
7069
71- if ( ! options . silent ) {
70+ if ( printInfo ) {
7271 this . context . logger . info ( `Linting ${ JSON . stringify ( projectName ) } ...` ) ;
7372 }
7473
@@ -127,15 +126,15 @@ export default class TslintBuilder implements Builder<TslintBuilderOptions> {
127126 }
128127 }
129128
130- if ( result . warningCount > 0 && ! options . silent ) {
129+ if ( result . warningCount > 0 && printInfo ) {
131130 this . context . logger . warn ( 'Lint warnings found in the listed files.' ) ;
132131 }
133132
134- if ( result . errorCount > 0 && ! options . silent ) {
133+ if ( result . errorCount > 0 && printInfo ) {
135134 this . context . logger . error ( 'Lint errors found in the listed files.' ) ;
136135 }
137136
138- if ( result . warningCount === 0 && result . errorCount === 0 && ! options . silent ) {
137+ if ( result . warningCount === 0 && result . errorCount === 0 && printInfo ) {
139138 this . context . logger . info ( 'All files pass linting.' ) ;
140139 }
141140
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ describe('Tslint Target', () => {
4343 tap ( ( buildEvent ) => expect ( buildEvent . success ) . toBe ( true ) ) ,
4444 tap ( ( ) => {
4545 expect ( logger . includes ( 'Linting "app"...' ) ) . toBe ( false ) ;
46+ expect ( logger . includes ( '<checkstyle' ) ) . toBe ( true ) ;
4647 } ) ,
4748 ) . toPromise ( ) . then ( done , done . fail ) ;
4849 } , 30000 ) ;
You can’t perform that action at this time.
0 commit comments