From 8e56d4541b0f298a7b20cfeadd7c6aaf94cf9059 Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Mon, 18 Mar 2024 14:40:02 +0100 Subject: [PATCH] revert: Remove workaround for deprecation text This reverts commit c8de9c40e98b09bf660aa5b80d158a602acb943f. Not all libraries have been updated yet as new SAPUI5 patch releases do not include new versions of every library. See #29 --- src/detectors/typeChecker/FileLinter.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/detectors/typeChecker/FileLinter.ts b/src/detectors/typeChecker/FileLinter.ts index 93817a55b..ae99e406b 100644 --- a/src/detectors/typeChecker/FileLinter.ts +++ b/src/detectors/typeChecker/FileLinter.ts @@ -125,7 +125,11 @@ export default class FileLinter { } getDeprecationText(deprecatedTag: ts.JSDocTagInfo): string { - return deprecatedTag.text?.reduce((acc, text) => acc + text.text, "") ?? ""; + // (Workaround) There's an issue in some UI5 TS definition versions and where the + // deprecation text gets merged with the description. Splitting on double + // new line could be considered as a clear separation between them. + // https://github.com/SAP/ui5-typescript/issues/429 + return deprecatedTag.text?.reduce((acc, text) => acc + text.text, "").split("\n\n")[0] ?? ""; } getDeprecationInfo(symbol: ts.Symbol | undefined): DeprecationInfo | null {