Skip to content

Commit e32f159

Browse files
committed
fix(cli): handle diagnostic code as string in output replacement
1 parent 42d3024 commit e32f159

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/cli/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,10 @@ class Project {
446446
getNewLine: () => ts.sys.newLine,
447447
});
448448
output = output.trimEnd();
449-
output = output.replace(`TS${diagnostic.code}`, String(diagnostic.code));
449+
450+
if (typeof diagnostic.code === 'string') {
451+
output = output.replace(`TS${diagnostic.code}`, diagnostic.code);
452+
}
450453

451454
if (diagnostic.category === ts.DiagnosticCategory.Error) {
452455
errors++;

0 commit comments

Comments
 (0)