Skip to content

Commit c9307dd

Browse files
werwolf2303RandomByte
authored andcommitted
feat: Improve UX in case no UI5 linter findings are reported
1 parent cd1680b commit c9307dd

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/formatter/text.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ export class Text {
4646

4747
format(lintResults: LintResult[], showDetails: boolean, autofix: boolean, quiet = false) {
4848
this.#writeln(`UI5 linter report:`);
49-
this.#writeln("");
49+
if (lintResults.length !== 0) {
50+
this.#writeln("");
51+
}
5052
let totalErrorCount = 0;
5153
let totalWarningCount = 0;
5254
let totalFatalErrorCount = 0;
@@ -110,9 +112,13 @@ export class Text {
110112
const totalCount = quiet ? totalErrorCount : totalErrorCount + totalWarningCount;
111113
const problemsText = `${totalCount} ${totalCount === 1 ? "problem" : "problems"}`;
112114

113-
this.#writeln(
114-
summaryColor(`${problemsText} (${errorsText}${warningsText})`)
115-
);
115+
if (totalCount === 0) {
116+
this.#writeln(summaryColor("Success! No findings detected."));
117+
} else {
118+
this.#writeln(
119+
summaryColor(`${problemsText} (${errorsText}${warningsText})`)
120+
);
121+
}
116122

117123
if (!autofix && (totalErrorCount + totalWarningCount > 0)) {
118124
this.#writeln(" Run \"ui5lint --fix\" to resolve all auto-fixable problems\n");

0 commit comments

Comments
 (0)