1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-05-28 21:19:16 +02:00

show typescript erros. still broken

This commit is contained in:
Kushagra Gour 2017-01-16 03:58:53 +05:30
parent 0030c02156
commit 79a9363829

View File

@ -521,7 +521,10 @@ settingsBtn, onboardModal, notificationsBtn */
}
} else if (jsMode === JsModes.TS) {
try {
code = ts.transpileModule(code, { compilerOptions: { module: ts.ModuleKind.CommonJS } });
code = ts.transpileModule(code, { reportDiagnostics:true, compilerOptions: { noEmitOnError: true, diagnostics:true, module: ts.ModuleKind.ES2015 } });
if (code.diagnostics.length) {
throw({ description: code.diagnostics[0].messageText, lineNumber: ts.getLineOfLocalPosition(code.diagnostics[0].file,code.diagnostics[0].start) });
}
} catch (e) {
showErrors('js', [ { lineNumber: e.lineNumber - 1, message: e.description } ]);
} finally {