(advice: {
severity: "ERROR" | "WARNING";
message: string;
source?: string;
})
| 134 | }; |
| 135 | |
| 136 | export const buildAdviceHoverMessage = (advice: { |
| 137 | severity: "ERROR" | "WARNING"; |
| 138 | message: string; |
| 139 | source?: string; |
| 140 | }) => { |
| 141 | const colors = { |
| 142 | WARNING: callCssVariable("--color-warning"), |
| 143 | ERROR: callCssVariable("--color-error"), |
| 144 | }; |
| 145 | const parts: string[] = []; |
| 146 | parts.push( |
| 147 | `<span style="color:${colors[advice.severity]};">[${advice.severity}]</span>` |
| 148 | ); |
| 149 | if (advice.source) { |
| 150 | parts.push(` ${escapeMarkdown(advice.source)}`); |
| 151 | } |
| 152 | parts.push(`\n${escapeMarkdown(advice.message)}`); |
| 153 | return parts.join(""); |
| 154 | }; |
no test coverage detected