cli
cli copied to clipboard
Allow empty issues in `AuditOutputs`
At the moment I can't add empty issues to a AuditOutput
/AuditReport
.
This leads to code like this:
let auditOutput: AuditOutput = {
slug: 'slug',
score: 1,
value: data.length,
displayValue,
};
const issues = rawData.filter(ofInterest).map(mapToIssue);
// add details if issues given
if (issues.length) {
auditOutput = {
...auditOutput,
details: {
issues,
},
};
}
return auditOutput;
instead of this:
let auditOutput: AuditOutput = {
slug: 'slug',
score: 1,
value: data.length,
displayValue,
details: {
issues: rawData.filter(ofInterest).map(mapToIssue)
}
};
return auditOutput;
Changing the typing to allow empty issues would improve DX for plugin authors