Skip to content

Commit 3a027ca

Browse files
committed
use RollupContext for type-only files
- i.e. bail out when `abortOnError: true`, which `ConsoleContext` can't do - `ConsoleContext` is basically meant for everywhere `RollupContext` can't be used - which is effectively only in the `options` hook, per the Rollup docs: https://rollupjs.org/guide/en/#options
1 parent c5bca6c commit 3a027ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
292292
});
293293
}
294294

295+
const contextWrapper = new RollupContext(pluginOptions.verbosity, pluginOptions.abortOnError, this, "rpt2: ");
296+
295297
// type-check missed files as well
296298
parsedConfig.fileNames.forEach((name) =>
297299
{
@@ -303,7 +305,7 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
303305

304306
const snapshot = servicesHost.getScriptSnapshot(key);
305307
if (snapshot)
306-
typecheckFile(key, snapshot, context);
308+
typecheckFile(key, snapshot, contextWrapper);
307309
});
308310

309311
buildDone();

0 commit comments

Comments
 (0)