@@ -4,7 +4,7 @@ import fs from 'fs-extra';
4
4
import { Options , check , format , getFileInfo , resolveConfig } from 'prettier' ;
5
5
6
6
import { crawlDirectory } from '../../utils/dir' ;
7
- import { Logger } from '../../utils/logging' ;
7
+ import { Logger , pluralise } from '../../utils/logging' ;
8
8
import { getConsumerManifest } from '../../utils/manifest' ;
9
9
10
10
interface File {
@@ -108,7 +108,7 @@ export const runPrettier = async (
108
108
// and the headache of conflicting `.gitignore` and `.prettierignore` rules.
109
109
const filepaths = await crawlDirectory ( directory , '.prettierignore' ) ;
110
110
111
- logger . debug ( `Discovered ${ logger . pluralise ( filepaths . length , 'file' ) } .` ) ;
111
+ logger . debug ( `Discovered ${ pluralise ( filepaths . length , 'file' ) } .` ) ;
112
112
113
113
const result : Result = {
114
114
count : filepaths . length ,
@@ -144,23 +144,21 @@ export const runPrettier = async (
144
144
const end = process . hrtime . bigint ( ) ;
145
145
146
146
logger . plain (
147
- `Processed ${ logger . pluralise (
147
+ `Processed ${ pluralise (
148
148
result . count - result . unparsed . length ,
149
149
'file' ,
150
150
) } in ${ logger . timing ( start , end ) } .`,
151
151
) ;
152
152
153
153
if ( result . touched . length ) {
154
- logger . plain (
155
- `Formatted ${ logger . pluralise ( result . touched . length , 'file' ) } :` ,
156
- ) ;
154
+ logger . plain ( `Formatted ${ pluralise ( result . touched . length , 'file' ) } :` ) ;
157
155
for ( const filepath of result . touched ) {
158
156
logger . warn ( filepath ) ;
159
157
}
160
158
}
161
159
162
160
if ( result . errored . length ) {
163
- logger . plain ( `Flagged ${ logger . pluralise ( result . errored . length , 'file' ) } :` ) ;
161
+ logger . plain ( `Flagged ${ pluralise ( result . errored . length , 'file' ) } :` ) ;
164
162
for ( const { err, filepath } of result . errored ) {
165
163
logger . warn ( filepath , ...( err ? [ String ( err ) ] : [ ] ) ) ;
166
164
}
0 commit comments