File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ describe('createLogger', () => {
2626 start : { line : 1 , column : 2 } ,
2727 length : 3 ,
2828 } ,
29+ { text : 'text4' , category : 'warning' } ,
2930 ] ;
3031 logger . logDiagnostics ( diagnostics ) ;
3132 expect ( stripVTControlCharacters ( stderrWriteSpy . mock . lastCall ! [ 0 ] as string ) ) . toMatchInlineSnapshot ( `
@@ -35,6 +36,8 @@ describe('createLogger', () => {
3536
3637 a.module.css(1,2): error: text3
3738
39+ warning: text4
40+
3841 "
3942 ` ) ;
4043 } ) ;
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ function convertErrorCategory(category: DiagnosticCategory): ts.DiagnosticCatego
1111 switch ( category ) {
1212 case 'error' :
1313 return ts . DiagnosticCategory . Error ;
14+ case 'warning' :
15+ return ts . DiagnosticCategory . Warning ;
1416 default :
1517 throw new Error ( `Unknown category: ${ String ( category ) } ` ) ;
1618 }
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ export interface ExportBuilder {
151151 clearCache ( ) : void ;
152152}
153153
154- export type DiagnosticCategory = 'error' ;
154+ export type DiagnosticCategory = 'error' | 'warning' ;
155155
156156export interface DiagnosticSourceFile {
157157 fileName : string ;
You can’t perform that action at this time.
0 commit comments