Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/incremental-typescript-compiler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports = class IncrementalTypescriptCompiler {

this._ts = project.require('typescript');
this._watchProgram = null;
this._compilerOptions = null;
}

treeForHost() {
Expand Down Expand Up @@ -115,6 +116,10 @@ module.exports = class IncrementalTypescriptCompiler {
}
}
});

// Prefetch the compiler options, because fetching them while reporting a diagnostic
// can result in a diagnostic-reporting loop in certain states
this._compilerOptions = this.getProgram().getCompilerOptions();
}

getProgram() {
Expand All @@ -130,8 +135,7 @@ module.exports = class IncrementalTypescriptCompiler {
}

_shouldFailOnTypeError() {
let options = this.getProgram().getCompilerOptions();
return !!options.noEmitOnError;
return !!this._compilerOptions.noEmitOnError;
}

_mirageDirectory() {
Expand Down