@@ -158,9 +158,6 @@ const createDisplayPathResolver = (
158158 return ( filePath ) => toPosixPath ( resolveRelativePath ( filePath ) ) ;
159159} ;
160160
161- const prettyTime = ( milliseconds : number ) : string =>
162- color . bold ( formatDuration ( milliseconds ) ) ;
163-
164161const formatCount = ( count : number ) : string => color . bold ( count ) ;
165162const formatFileCount = ( count : number , isError = false ) : string => {
166163 const formattedCount = formatCount ( count ) ;
@@ -204,13 +201,18 @@ const logFmtResult = (
204201 }
205202 }
206203
204+ if ( mode === 'list-different' ) {
205+ return ;
206+ }
207+
208+ const time = color . bold ( formatDuration ( durationMilliseconds ) ) ;
209+
207210 if ( mode === 'write' ) {
208211 if ( writtenCount === 0 && result . exitCode !== 0 ) {
209212 return ;
210213 }
211214
212215 const processedFiles = formatFileCount ( processedFileCount ) ;
213- const time = prettyTime ( durationMilliseconds ) ;
214216 const message =
215217 writtenCount > 0
216218 ? `Formatted ${ formatCount ( writtenCount ) } of ${ processedFiles } in ${ time } .`
@@ -219,23 +221,17 @@ const logFmtResult = (
219221 return ;
220222 }
221223
222- if ( mode !== 'check' ) {
223- return ;
224- }
225-
226224 if ( differentCount > 0 ) {
227225 const differentFiles = formatFileCount ( differentCount , true ) ;
228226 const processedFiles = formatFileCount ( processedFileCount ) ;
229227 const fixHint = fixCommand
230228 ? `Run ${ color . cyan ( fixCommand ) } to fix.`
231229 : `Rerun this command without ${ color . cyan ( '--check' ) } to fix.` ;
232230 logger . error ( `Formatting issues found in ${ differentFiles } . ${ fixHint } ` ) ;
233- logger . info (
234- `Checked ${ processedFiles } in ${ prettyTime ( durationMilliseconds ) } .` ,
235- ) ;
231+ logger . info ( `Checked ${ processedFiles } in ${ time } .` ) ;
236232 } else if ( result . exitCode === 0 ) {
237233 logger . success (
238- `Checked ${ formatFileCount ( processedFileCount ) } in ${ prettyTime ( durationMilliseconds ) } . No issues found.` ,
234+ `Checked ${ formatFileCount ( processedFileCount ) } in ${ time } . No issues found.` ,
239235 ) ;
240236 }
241237} ;
0 commit comments