Skip to content

Commit

Permalink
fix: set noErrors to false when there are compilerOptions errors
Browse files Browse the repository at this point in the history
- previously, while errors would be printed, the flag for `noErrors` was
  not set to `false`, and so there would be no yellow warning about
  errors
  - this is mostly just fixing asymmetric UX, but personally, I actually
    have missed this error before myself, so maybe this will help
    alleviate that
  • Loading branch information
agilgur5 committed Jun 4, 2022
1 parent 4411604 commit 66f4b5c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
if (!pluginOptions.typescript) {
pluginOptions.typescript = require("typescript");
}

setTypescriptModule(pluginOptions.typescript);

const self: Plugin & { _ongenerate: () => void, _onwrite: (this: PluginContext, _output: OutputOptions) => void } = {
Expand Down Expand Up @@ -122,8 +121,12 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
servicesHost.setLanguageService(service);

// printing compiler option errors
if (pluginOptions.check)
printDiagnostics(context, convertDiagnostic("options", service.getCompilerOptionsDiagnostics()), parsedConfig.options.pretty === true);
if (pluginOptions.check) {
const diagnostics = convertDiagnostic("options", service.getCompilerOptionsDiagnostics())
printDiagnostics(context, diagnostics, parsedConfig.options.pretty === true);
if (diagnostics.length > 0)
noErrors = false;
}

if (pluginOptions.clean)
cache().clean();
Expand Down

0 comments on commit 66f4b5c

Please sign in to comment.