From f72109c380ac31b3bd200d78d8fae2b253c4d071 Mon Sep 17 00:00:00 2001 From: Yavor Ivanov Date: Tue, 10 Sep 2024 10:19:48 +0300 Subject: [PATCH] fix: Eslint findings --- src/cli/base.ts | 2 +- src/formatter/text.ts | 2 +- .../ui5Types/amdTranspiler/moduleDeclarationToDefinition.ts | 2 +- .../amdTranspiler/requireExpressionToTransformation.ts | 2 +- src/linter/ui5Types/asyncComponentFlags.ts | 3 ++- src/linter/xmlTemplate/Parser.ts | 4 ++-- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/cli/base.ts b/src/cli/base.ts index 67a36a54..9d46690f 100644 --- a/src/cli/base.ts +++ b/src/cli/base.ts @@ -191,7 +191,7 @@ export default function base(cli: Argv) { } else { process.stderr.write("\n"); process.stderr.write(chalk.dim(`For details, execute the same command again with an` + - ` additional '--verbose' parameter`) + "\n"); + ` additional '--verbose' parameter`) + "\n"); } } } else { diff --git a/src/formatter/text.ts b/src/formatter/text.ts index 71e44b84..1642b9b1 100644 --- a/src/formatter/text.ts +++ b/src/formatter/text.ts @@ -105,7 +105,7 @@ export class Text { if (!showDetails && (totalErrorCount + totalWarningCount + totalFatalErrorCount) > 0) { this.#writeln(""); this.#writeln(chalk.dim.bold("Note: ") + - chalk.dim(`Use "ui5lint --details" to show more information about the findings`)); + chalk.dim(`Use "ui5lint --details" to show more information about the findings`)); } return this.#buffer; diff --git a/src/linter/ui5Types/amdTranspiler/moduleDeclarationToDefinition.ts b/src/linter/ui5Types/amdTranspiler/moduleDeclarationToDefinition.ts index 41f969dd..4c2191b2 100644 --- a/src/linter/ui5Types/amdTranspiler/moduleDeclarationToDefinition.ts +++ b/src/linter/ui5Types/amdTranspiler/moduleDeclarationToDefinition.ts @@ -76,7 +76,7 @@ function collectImports( let moduleSpecifier: ts.StringLiteral; if (!ts.isStringLiteralLike(dep)) { log.verbose(`Skipping non-string dependency entry of type ${ts.SyntaxKind[dep.kind]} at ` + - toPosStr(dep)); + toPosStr(dep)); return; } if (ts.isNoSubstitutionTemplateLiteral(dep)) { diff --git a/src/linter/ui5Types/amdTranspiler/requireExpressionToTransformation.ts b/src/linter/ui5Types/amdTranspiler/requireExpressionToTransformation.ts index 066888ce..fdcb4a64 100644 --- a/src/linter/ui5Types/amdTranspiler/requireExpressionToTransformation.ts +++ b/src/linter/ui5Types/amdTranspiler/requireExpressionToTransformation.ts @@ -49,7 +49,7 @@ export function transformAsyncRequireCall( let moduleSpecifier: ts.StringLiteral; if (!ts.isStringLiteralLike(dep)) { log.verbose(`Skipping non-string dependency entry of type ${ts.SyntaxKind[dep.kind]} at ` + - toPosStr(dep)); + toPosStr(dep)); return; } if (ts.isNoSubstitutionTemplateLiteral(dep)) { diff --git a/src/linter/ui5Types/asyncComponentFlags.ts b/src/linter/ui5Types/asyncComponentFlags.ts index 9bdfd323..7af2c5ee 100644 --- a/src/linter/ui5Types/asyncComponentFlags.ts +++ b/src/linter/ui5Types/asyncComponentFlags.ts @@ -371,7 +371,8 @@ function reportResults({ severity: LintMessageSeverity.Warning, ruleId: "ui5-linter-async-component-flags", message: `Component implements the sap.ui.core.IAsyncContentCreation interface. ` + - `The redundant "async" flag at "${pointerKey}" should be removed from the component manifest`, + `The redundant "async" flag at "${pointerKey}" should be removed ` + ` + from the component manifest`, messageDetails: `{@link sap.ui.core.IAsyncContentCreation sap.ui.core.IAsyncContentCreation}`, ...posInfo, }); diff --git a/src/linter/xmlTemplate/Parser.ts b/src/linter/xmlTemplate/Parser.ts index fefb34d1..85a772a6 100644 --- a/src/linter/xmlTemplate/Parser.ts +++ b/src/linter/xmlTemplate/Parser.ts @@ -221,7 +221,7 @@ export default class Parser { if (!aggregationName) { log.verbose(`Failed to determine default aggregation for control ${owner.name} used in ` + - `resource ${this.#resourceName}. Falling back to 'dependents'`); + `resource ${this.#resourceName}. Falling back to 'dependents'`); // In case the default aggregation is unknown (e.g. in case of custom controls), // fallback to use the generic "dependents" aggregation // This is not correct at runtime, but it's the best we can do for linting purposes @@ -460,7 +460,7 @@ export default class Parser { this.#generator.writeControl(customData); } else { log.verbose(`Ignoring unknown namespaced attribute ${attr.localNamespace}:${attr.name} ` + - `for ${moduleName} in resource ${this.#resourceName}`); + `for ${moduleName} in resource ${this.#resourceName}`); } } else { controlProperties.add(attr);