Skip to content

Commit

Permalink
Suggests that tsconfig.json is incorrect only when SyntaxError is caught
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Jan 18, 2019
1 parent 803946f commit cec8f0d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,16 @@ function verifyTypeScriptSetup() {

parsedCompilerOptions = result.options;
} catch (e) {
console.error(
chalk.red.bold(
'Could not parse',
chalk.cyan('tsconfig.json') + '.',
'Please make sure it contains syntactically correct JSON.'
)
);
if (e && e.name === 'SyntaxError') {
console.error(
chalk.red.bold(
'Could not parse',
chalk.cyan('tsconfig.json') + '.',
'Please make sure it contains syntactically correct JSON.'
)
);
}

console.error(e && e.message ? `Details: ${e.message}` : '');
process.exit(1);
}
Expand Down

0 comments on commit cec8f0d

Please sign in to comment.