Skip to content

Commit

Permalink
Handle tsconfig.json errors without using JSON.stringify (palantir#3908)
Browse files Browse the repository at this point in the history
JSON.stringify fails in some cases because its fails to convert circular structure to string
  • Loading branch information
mertdeg2 authored and suchanlee committed Jun 7, 2018
1 parent db5fa51 commit 175a586
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function runTest(testDirectory: string, rulesDirectory?: string | string[
if (hasConfig) {
const {config, error} = ts.readConfigFile(tsConfig, ts.sys.readFile);
if (error !== undefined) {
throw new Error(JSON.stringify(error));
throw new Error(ts.formatDiagnostics([error], ts.createCompilerHost({})));
}

const parseConfigHost = {
Expand Down

0 comments on commit 175a586

Please sign in to comment.