diff --git a/org.lflang/src/org/lflang/generator/ts/TSGenerator.kt b/org.lflang/src/org/lflang/generator/ts/TSGenerator.kt index 42f31e4d14..4e66b4d9f4 100644 --- a/org.lflang/src/org/lflang/generator/ts/TSGenerator.kt +++ b/org.lflang/src/org/lflang/generator/ts/TSGenerator.kt @@ -159,6 +159,10 @@ class TSGenerator( "Code generation complete. Collecting dependencies...", IntegratedBuilder.GENERATED_PERCENT_PROGRESS ) if (shouldCollectDependencies(context)) collectDependencies(resource, context) + if (errorsOccurred()) { + context.unsuccessfulFinish(); + return; + } if (targetConfig.protoFiles.size != 0) { protoc() } else { diff --git a/org.lflang/src/org/lflang/generator/ts/TSValidator.kt b/org.lflang/src/org/lflang/generator/ts/TSValidator.kt index 423e5ef7dc..333cfcbba3 100644 --- a/org.lflang/src/org/lflang/generator/ts/TSValidator.kt +++ b/org.lflang/src/org/lflang/generator/ts/TSValidator.kt @@ -104,7 +104,7 @@ class TSValidator( codeMap.lfSourcePaths().forEach { val lfStart = codeMap.adjusted(it, message.start) val lfEnd = codeMap.adjusted(it, message.end) - if (!lfStart.equals(Position.ORIGIN)) { + if (!lfStart.equals(Position.ORIGIN)) { // Ignore linting errors in non-user-supplied code. errorReporter.report( message.severity, DiagnosticReporting.messageOf(message.message, genPath, message.start),