Skip to content

Commit 9b0e972

Browse files
committed
fix (checker) if option error is object #43
1 parent a7fe4fe commit 9b0e972

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/checker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,15 @@ export class Checker {
215215
let optionErrorsText = Object.entries(program.getOptionsDiagnostics())
216216
.map(([no, err]) => {
217217
let text = no + ':';
218+
let messageText = (<any>err).messageText;
219+
if ((typeof messageText === 'object') && (messageText !== null)) {
220+
messageText = JSON.stringify(messageText);
221+
}
218222
text = chalk[options.yellowOnOptions ? 'yellow' : 'red']
219223
(`└── tsConfig: `);
220224
text += chalk.white(`(${(<any>err).category}:`);
221225
text += chalk.white(`${(<any>err).code})`);
222-
text += chalk.white(` ${(<any>err).messageText}`);
226+
text += chalk.white(` ${messageText}`);
223227
return text;
224228
});
225229
print(optionErrorsText.join(END_LINE));

0 commit comments

Comments
 (0)