1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-10 00:16:18 +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) { } else if (jsMode === JsModes.TS) {
try { 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) { } catch (e) {
showErrors('js', [ { lineNumber: e.lineNumber - 1, message: e.description } ]); showErrors('js', [ { lineNumber: e.lineNumber - 1, message: e.description } ]);
} finally { } finally {