Skip to content

Commit

Permalink
chore(plugin-eslint): change eslint displayValue from 0 to passed
Browse files Browse the repository at this point in the history
Closes #305

#305
  • Loading branch information
MishaSeredenkoPushBased committed Dec 26, 2023
1 parent da005fb commit db8f60e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/plugin-eslint/src/lib/runner/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ function toAudit(slug: string, issues: LintIssue[]): AuditOutput {
const severityCounts = countOccurrences(
auditIssues.map(({ severity }) => severity),
);
const summaryText = objectToEntries(severityCounts)
.sort((a, b) => -compareIssueSeverity(a[0], b[0]))
.map(([severity, count = 0]) => pluralizeToken(severity, count))
.join(', ');
const severities = objectToEntries(severityCounts);
const summaryText = severities.length
? severities
.sort((a, b) => -compareIssueSeverity(a[0], b[0]))
.map(([severity, count = 0]) => pluralizeToken(severity, count))
.join(', ')
: 'passed';

return {
slug,
score: Number(auditIssues.length === 0),
Expand Down

0 comments on commit db8f60e

Please sign in to comment.