From ea5321ce0aae665d7f0a8868fbb1e965a5e07a98 Mon Sep 17 00:00:00 2001 From: Max Reichmann Date: Tue, 19 Mar 2024 12:33:54 +0100 Subject: [PATCH] refactor(ManifestLinter.ts): Fix ESLint --- src/linter/json/ManifestLinter.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/linter/json/ManifestLinter.ts b/src/linter/json/ManifestLinter.ts index 8d4f66aeb..b93104ff2 100644 --- a/src/linter/json/ManifestLinter.ts +++ b/src/linter/json/ManifestLinter.ts @@ -17,7 +17,7 @@ interface locType { pos: number; } -const deprecatedLibraries: Array = [ +const deprecatedLibraries: string[] = [ "sap.ca.scfld.md", "sap.ca.ui", "sap.dragonfly", @@ -35,13 +35,12 @@ const deprecatedLibraries: Array = [ "sap.zen.crosstab", ]; -const deprecatedComponents: Array = [ +const deprecatedComponents: string[] = [ "sap.zen.dsh.fioriwrapper", ]; export type jsonMapPointers = Record; - export interface jsonSourceMapType { data: SAPJSONSchemaForWebApplicationManifestFile; pointers: jsonMapPointers; @@ -75,9 +74,9 @@ export default class ManifestLinter { #analyzeManifest(manifest: SAPJSONSchemaForWebApplicationManifestFile) { const {resources, models, dependencies} = (manifest["sap.ui5"] ?? {} as JSONSchemaForSAPUI5Namespace); const {dataSources} = (manifest["sap.app"] ?? {} as JSONSchemaForSAPAPPNamespace); - + // Detect deprecated libraries: - const libKeys: string[] = (dependencies?.libs && Object.keys(dependencies.libs)) || []; + const libKeys: string[] = (dependencies?.libs && Object.keys(dependencies.libs)) ?? []; libKeys.forEach((libKey: string) => { if (deprecatedLibraries.includes(libKey)) { this.#reporter?.addMessage({ @@ -90,7 +89,7 @@ export default class ManifestLinter { }); // Detect deprecated components: - const componentKeys: string[] = (dependencies?.components && Object.keys(dependencies.components)) || []; + const componentKeys: string[] = (dependencies?.components && Object.keys(dependencies.components)) ?? []; componentKeys.forEach((componentKey: string) => { if (deprecatedComponents.includes(componentKey)) { this.#reporter?.addMessage({