Skip to content

Commit 30d1491

Browse files
authored
fix(jsii): Don't skip emit on TS errors when in "watch" mode (#236)
In watch mode, users expect to be able to be a little more drafty than when doing a plain compile cycle, as they may edit code as part of a troubleshooting loop, that may involve for example leaving out unused imports and the like. This change makes sure the `noEmitOnError` compiler option is set to false when operating in `watch` mode, so the `.js` files get updated unconditionally. Fixes #235
1 parent 91074f3 commit 30d1491

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: packages/jsii/lib/compiler.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class Compiler implements Emitter {
8383
const projectRoot = this.options.projectInfo.projectRoot;
8484
const host = ts.createWatchCompilerHost(
8585
await this._writeTypeScriptConfig(),
86-
COMPILER_OPTIONS,
86+
{ ...COMPILER_OPTIONS, noEmitOnError: false },
8787
{ ...ts.sys, getCurrentDirectory() { return projectRoot; } }
8888
);
8989
const orig = host.afterProgramCreate;

0 commit comments

Comments
 (0)