File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/vite-plugin-checker/src/checkers/typescript Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import os from 'node:os'
2
2
import path from 'node:path'
3
3
import { fileURLToPath } from 'node:url'
4
4
import { parentPort } from 'node:worker_threads'
5
+ import chalk from 'chalk'
5
6
import invariant from 'tiny-invariant'
6
7
import ts from 'typescript'
7
8
@@ -107,13 +108,16 @@ const createDiagnostic: CreateDiagnostic<'typescript'> = (pluginConfig) => {
107
108
}
108
109
109
110
if ( terminal ) {
111
+ const color = errorCount && errorCount > 0 ? 'red' : 'green'
110
112
consoleLog (
111
- logChunk +
113
+ chalk [ color ] (
114
+ logChunk +
112
115
os . EOL +
113
116
wrapCheckerSummary (
114
117
'TypeScript' ,
115
118
diagnostic . messageText . toString ( ) ,
116
- ) ,
119
+ )
120
+ ) ,
117
121
)
118
122
}
119
123
} )
You can’t perform that action at this time.
0 commit comments