Skip to content

Commit 55540fc

Browse files
committed
Fail faster.
1 parent 2b4d35b commit 55540fc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/util/helper.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,13 @@ function getKomaciReport(ruleFilename, fileName, sourceFile) {
9090
}
9191
);
9292

93-
eslintReports = eslintReports.filter((diagnostic) => {
94-
if (!diagnosticMessage) {
95-
return false;
96-
}
93+
if (!diagnosticMessage) {
94+
// No matching diagnostic message was found. Return an empty array to indicate that
95+
// there is no lint warning/error to report back to the caller.
96+
return [];
97+
}
9798

99+
eslintReports = eslintReports.filter((diagnostic) => {
98100
return diagnostic.code.value === diagnosticMessage[1].code;
99101
});
100102

0 commit comments

Comments
 (0)