diff options
author | Luca Casonato <lucacasonato@yahoo.com> | 2020-09-08 15:28:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-08 15:28:42 +0200 |
commit | 6ff939553216125ce058a070d91b7eb430cc4665 (patch) | |
tree | 794d50667d09ce852646f33dcab5b8ad21f31a41 /cli/tsc | |
parent | 241d2281045b7edef93b069a739eee54bf9f1640 (diff) |
feat(unstable): enable isolatedModules by default (#7327)
Diffstat (limited to 'cli/tsc')
-rw-r--r-- | cli/tsc/99_main_compiler.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index dede279c1..a2e127508 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -878,6 +878,13 @@ delete Object.prototype.__proto__; 7016, ]; + const IGNORED_COMPILE_DIAGNOSTICS = [ + // TS1208: All files must be modules when the '--isolatedModules' flag is + // provided. We can ignore because we guarantuee that all files are + // modules. + 1208, + ]; + const stats = []; let statsStart = 0; @@ -1162,7 +1169,9 @@ delete Object.prototype.__proto__; ...program.getSemanticDiagnostics(), ]; diagnostics = diagnostics.filter( - ({ code }) => !IGNORED_DIAGNOSTICS.includes(code), + ({ code }) => + !IGNORED_DIAGNOSTICS.includes(code) && + !IGNORED_COMPILE_DIAGNOSTICS.includes(code), ); // We will only proceed with the emit if there are no diagnostics. @@ -1333,7 +1342,10 @@ delete Object.prototype.__proto__; const diagnostics = ts .getPreEmitDiagnostics(program) - .filter(({ code }) => !IGNORED_DIAGNOSTICS.includes(code)); + .filter(({ code }) => + !IGNORED_DIAGNOSTICS.includes(code) && + !IGNORED_COMPILE_DIAGNOSTICS.includes(code) + ); const emitResult = program.emit(); assert(emitResult.emitSkipped === false, "Unexpected skip of the emit."); |