File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
lib/incremental-typescript-compiler Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ module.exports = class IncrementalTypescriptCompiler {
2929
3030 this . _ts = project . require ( 'typescript' ) ;
3131 this . _watchProgram = null ;
32+ this . _compilerOptions = null ;
3233 }
3334
3435 treeForHost ( ) {
@@ -115,6 +116,10 @@ module.exports = class IncrementalTypescriptCompiler {
115116 }
116117 }
117118 } ) ;
119+
120+ // Prefetch the compiler options, because fetching them while reporting a diagnostic
121+ // can result in a diagnostic-reporting loop in certain states
122+ this . _compilerOptions = this . getProgram ( ) . getCompilerOptions ( ) ;
118123 }
119124
120125 getProgram ( ) {
@@ -130,8 +135,7 @@ module.exports = class IncrementalTypescriptCompiler {
130135 }
131136
132137 _shouldFailOnTypeError ( ) {
133- let options = this . getProgram ( ) . getCompilerOptions ( ) ;
134- return ! ! options . noEmitOnError ;
138+ return ! ! this . _compilerOptions . noEmitOnError ;
135139 }
136140
137141 _mirageDirectory ( ) {
You can’t perform that action at this time.
0 commit comments