Skip to content

Commit 4c6fefd

Browse files
committed
feature: @putout/formattet-dump: 1 files -> 1 file
1 parent 00d6389 commit 4c6fefd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/formatter-dump/lib/dump.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ export default ({name, places, index, count, filesCount, errorsCount}) => {
4343
].join('\n'));
4444
}
4545

46-
const maybeS = errorsCount === 1 ? '' : 's';
46+
const maybeErrors = errorsCount === 1 ? 'error' : 'errors';
47+
const maybeFiles = filesCount === 1 ? 'file' : 'files';
4748

48-
output.push(bold(redBright(`✖ ${errorsCount} error${maybeS} in ${filesCount} file${maybeS}`)));
49+
output.push(bold(redBright(`✖ ${errorsCount} ${maybeErrors} in ${filesCount} ${maybeFiles}`)));
4950
output.push(bold(redBright(' fixable with the `--fix` option')));
5051

5152
return output.join('\n') + '\n';

packages/formatter-dump/test/fixture/errors-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
1:6 error 't' is defined but never used remove-unused-variables
33
2:6 error 'm' is defined but never used remove-unused-variables
44

5-
✖ 2 errors in 1 files
5+
✖ 2 errors in 1 file
66
 fixable with the `--fix` option

0 commit comments

Comments
 (0)