From e8bec1d09295049329e9c24c15101f2f893a134c Mon Sep 17 00:00:00 2001 From: Tal Rofe Date: Fri, 22 Apr 2022 21:20:35 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9E=20fix=20missing=20exit=20co?= =?UTF-8?q?de=20when=20having=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix missing exit code when having errors --- src/modules/app/functions/lint-files.ts | 4 ++++ src/modules/core/functions/lint.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/modules/app/functions/lint-files.ts b/src/modules/app/functions/lint-files.ts index 84191d34..0edac356 100644 --- a/src/modules/app/functions/lint-files.ts +++ b/src/modules/app/functions/lint-files.ts @@ -216,5 +216,9 @@ export const lintFiles = async ( await outputFile(configuration.outputFile, errors, warnings); } + if (errors.length > 0) { + return 1; + } + return 0; }; diff --git a/src/modules/core/functions/lint.ts b/src/modules/core/functions/lint.ts index c7f7c9ce..81b71d68 100644 --- a/src/modules/core/functions/lint.ts +++ b/src/modules/core/functions/lint.ts @@ -199,4 +199,8 @@ export const lint = async ( if (configuration.outputFile) { await outputFile(configuration.outputFile, errors, warnings); } + + if (errors.length > 0) { + process.exit(1); + } };