File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export function emitDts(
50
50
51
51
for ( const diagnostic of allDiagnostics ) {
52
52
const fileLoc = getFileLoc ( diagnostic ) ;
53
- const message = `${ fileLoc } error TS${ diagnostic . code } : ${ ts . flattenDiagnosticMessageText (
53
+ const message = `${ fileLoc } - ${ color . red ( ' error' ) } ${ color . gray ( ` TS${ diagnostic . code } :` ) } ${ ts . flattenDiagnosticMessageText (
54
54
diagnostic . messageText ,
55
55
host . getNewLine ( ) ,
56
56
) } `;
@@ -84,7 +84,7 @@ export function emitDts(
84
84
const fileLoc = getFileLoc ( diagnostic ) ;
85
85
86
86
logger . error (
87
- `${ fileLoc } error TS${ diagnostic . code } :` ,
87
+ `${ fileLoc } - ${ color . red ( ' error' ) } ${ color . gray ( ` TS${ diagnostic . code } :` ) } ` ,
88
88
ts . flattenDiagnosticMessageText (
89
89
diagnostic . messageText ,
90
90
formatHost . getNewLine ( ) ,
Original file line number Diff line number Diff line change 1
1
import fs , { writeFileSync } from 'node:fs' ;
2
2
import path from 'node:path' ;
3
+ import color from 'picocolors' ;
3
4
import * as ts from 'typescript' ;
4
5
5
6
export function loadTsconfig ( tsconfigPath : string ) : ts . ParsedCommandLine {
@@ -37,7 +38,7 @@ export function getFileLoc(diagnostic: ts.Diagnostic): string {
37
38
diagnostic . file ,
38
39
diagnostic . start ! ,
39
40
) ;
40
- return `${ diagnostic . file . fileName } :${ line + 1 } :${ character + 1 } - ` ;
41
+ return `${ color . cyan ( diagnostic . file . fileName ) } :${ color . yellow ( line + 1 ) } :${ color . yellow ( character + 1 ) } ` ;
41
42
}
42
43
43
44
return '' ;
You can’t perform that action at this time.
0 commit comments