File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export function formatResult(
66
66
const problems = [ ...errors , ...warnings ] . map ( ( problem ) => {
67
67
const sign = signs [ problem . level ] || '' ;
68
68
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 ;
70
70
const name = enabled
71
71
? chalk . grey ( `[${ problem . name } ]` )
72
72
: `[${ problem . name } ]` ;
@@ -76,7 +76,7 @@ export function formatResult(
76
76
const sign = selectSign ( result ) ;
77
77
const color = selectColor ( result ) ;
78
78
79
- const deco = enabled ? ( chalk [ color ] as any ) ( sign ) : sign ;
79
+ const deco = enabled ? chalk [ color ] ( sign ) : sign ;
80
80
const el = errors . length ;
81
81
const wl = warnings . length ;
82
82
const hasProblems = problems . length > 0 ;
@@ -109,7 +109,7 @@ function selectSign(result: FormattableResult): string {
109
109
return ( result . warnings || [ ] ) . length ? '⚠' : '✔' ;
110
110
}
111
111
112
- function selectColor ( result : FormattableResult ) : keyof typeof chalk {
112
+ function selectColor ( result : FormattableResult ) : ChalkColor {
113
113
if ( ( result . errors || [ ] ) . length > 0 ) {
114
114
return 'red' ;
115
115
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export interface FormattableReport {
26
26
results ?: ( FormattableResult & WithInput ) [ ] ;
27
27
}
28
28
29
- export type ChalkColor = keyof typeof chalk ;
29
+ export type ChalkColor = typeof chalk . Color | typeof chalk . Modifiers ;
30
30
31
31
export interface FormatOptions {
32
32
color ?: boolean ;
You can’t perform that action at this time.
0 commit comments