fix: set noErrors to false when there are compilerOptions errors (#342)

- 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
This commit is contained in:
Anton Gilgur 2022-06-06 20:07:43 -04:00 committed by GitHub
parent d8a8e42dc2
commit b1e3b44df1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 } = {
@ -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();