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'
22import path from 'node:path'
33import { fileURLToPath } from 'node:url'
44import { parentPort } from 'node:worker_threads'
5+ import chalk from 'chalk'
56import invariant from 'tiny-invariant'
67import ts from 'typescript'
78
@@ -107,13 +108,16 @@ const createDiagnostic: CreateDiagnostic<'typescript'> = (pluginConfig) => {
107108 }
108109
109110 if ( terminal ) {
111+ const color = errorCount && errorCount > 0 ? 'red' : 'green'
110112 consoleLog (
111- logChunk +
113+ chalk [ color ] (
114+ logChunk +
112115 os . EOL +
113116 wrapCheckerSummary (
114117 'TypeScript' ,
115118 diagnostic . messageText . toString ( ) ,
116- ) ,
119+ )
120+ ) ,
117121 )
118122 }
119123 } )
You can’t perform that action at this time.
0 commit comments