File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export function formatResult(
6666 const problems = [ ...errors , ...warnings ] . map ( ( problem ) => {
6767 const sign = signs [ problem . level ] || '' ;
6868 const color : ChalkColor = colors [ problem . level ] || ( 'white' as const ) ;
69- const decoration = enabled ? ( ( chalk as any ) [ color ] as any ) ( sign ) : sign ;
69+ const decoration = enabled ? chalk [ color ] ( sign ) : sign ;
7070 const name = enabled
7171 ? chalk . grey ( `[${ problem . name } ]` )
7272 : `[${ problem . name } ]` ;
@@ -76,7 +76,7 @@ export function formatResult(
7676 const sign = selectSign ( result ) ;
7777 const color = selectColor ( result ) ;
7878
79- const deco = enabled ? ( chalk [ color ] as any ) ( sign ) : sign ;
79+ const deco = enabled ? chalk [ color ] ( sign ) : sign ;
8080 const el = errors . length ;
8181 const wl = warnings . length ;
8282 const hasProblems = problems . length > 0 ;
@@ -109,7 +109,7 @@ function selectSign(result: FormattableResult): string {
109109 return ( result . warnings || [ ] ) . length ? '⚠' : '✔' ;
110110}
111111
112- function selectColor ( result : FormattableResult ) : keyof typeof chalk {
112+ function selectColor ( result : FormattableResult ) : ChalkColor {
113113 if ( ( result . errors || [ ] ) . length > 0 ) {
114114 return 'red' ;
115115 }
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export interface FormattableReport {
2626 results ?: ( FormattableResult & WithInput ) [ ] ;
2727}
2828
29- export type ChalkColor = keyof typeof chalk ;
29+ export type ChalkColor = typeof chalk . Color | typeof chalk . Modifiers ;
3030
3131export interface FormatOptions {
3232 color ?: boolean ;
You can’t perform that action at this time.
0 commit comments