Skip to content

Commit 14dc584

Browse files
chore: make human output more concise and readable (#2748)
* style(svelte-check): make human output more concise and readable * Update packages/svelte-check/src/writers.ts --------- Co-authored-by: Simon H <[email protected]>
1 parent 9b3f7f7 commit 14dc584

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

packages/svelte-check/src/writers.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ export class HumanFriendlyWriter implements Writer {
3838
}
3939

4040
if (this.isVerbose) {
41-
this.stream.write('\n');
42-
this.stream.write('====================================\n');
43-
this.stream.write(`Loading svelte-check in workspace: ${workspaceDir}`);
44-
this.stream.write('\n');
41+
this.stream.write(`Loading svelte-check in workspace: ${workspaceDir}\n`);
4542
this.stream.write('Getting Svelte diagnostics...\n');
4643
this.stream.write('\n');
4744
}
@@ -60,7 +57,7 @@ export class HumanFriendlyWriter implements Writer {
6057
let msg;
6158
if (this.isVerbose) {
6259
const code = this.formatRelatedCode(diagnostic, text);
63-
msg = `${diagnostic.message} ${source}\n${pc.cyan(code)}`;
60+
msg = `${diagnostic.message} ${source}\n${pc.cyan(code.trimEnd())}`;
6461
} else {
6562
msg = `${diagnostic.message} ${source}`;
6663
}
@@ -117,7 +114,9 @@ export class HumanFriendlyWriter implements Writer {
117114
warningCount: number,
118115
fileCountWithProblems: number
119116
) {
120-
this.stream.write('====================================\n');
117+
if (fileCountWithProblems) {
118+
this.stream.write('====================================\n');
119+
}
121120
const message = [
122121
'svelte-check found ',
123122
`${errorCount} ${errorCount === 1 ? 'error' : 'errors'} and `,

0 commit comments

Comments
 (0)