Skip to content

Commit

Permalink
fix(builder): printInfo should not be taken into account for report (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Mar 16, 2021
1 parent de8ab5f commit d7c6aa4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/builder/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ async function run(
// Filter out the null values
.filter(Boolean) as ESLint.LintResult[];

const hasWarningsToPrint: boolean =
totalWarnings > 0 && printInfo && !reportOnlyErrors;
const hasErrorsToPrint: boolean = totalErrors > 0 && printInfo;
const hasWarningsToPrint: boolean = totalWarnings > 0 && !reportOnlyErrors;
const hasErrorsToPrint: boolean = totalErrors > 0;

/**
* It's important that we format all results together so that custom
Expand All @@ -101,11 +100,11 @@ async function run(
context.logger.info(formatter.format(finalLintResults));
}

if (hasWarningsToPrint) {
if (hasWarningsToPrint && printInfo) {
context.logger.warn('Lint warnings found in the listed files.\n');
}

if (hasErrorsToPrint) {
if (hasErrorsToPrint && printInfo) {
context.logger.error('Lint errors found in the listed files.\n');
}

Expand Down

0 comments on commit d7c6aa4

Please sign in to comment.