(
issues: readonly VariableValidationIssue[],
options: { strict: boolean; quiet?: boolean },
)
| 205 | * warning block (the errorBox in strict mode still prints). |
| 206 | */ |
| 207 | export function reportVariableIssues( |
| 208 | issues: readonly VariableValidationIssue[], |
| 209 | options: { strict: boolean; quiet?: boolean }, |
| 210 | ): void { |
| 211 | if (issues.length === 0) return; |
| 212 | const { strict, quiet } = options; |
| 213 | if (!quiet) { |
| 214 | console.log(""); |
| 215 | console.log( |
| 216 | c.warn( |
| 217 | `Variable ${issues.length === 1 ? "issue" : "issues"} (${issues.length}) — values may not render as expected:`, |
| 218 | ), |
| 219 | ); |
| 220 | for (const issue of issues) { |
| 221 | console.log(" " + c.dim(formatVariableValidationIssue(issue))); |
| 222 | } |
| 223 | console.log(""); |
| 224 | } |
| 225 | if (strict) { |
| 226 | errorBox( |
| 227 | "Variable validation failed", |
| 228 | "Aborting render due to variable issues (--strict-variables mode).", |
| 229 | ); |
| 230 | process.exit(1); |
| 231 | } |
| 232 | } |
no test coverage detected