From eb44feb431ab580093bb1d75e414a05656736314 Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Fri, 10 Jan 2025 16:07:34 +0200 Subject: [PATCH] chore: add lint rule for conditional jsx rendering strict boolean checks (#10516) chore: add lint rule for contional jsx rendring strict bolean checks --- packages/fiori/src/DynamicPageTitle.ts | 4 +- packages/fiori/src/UserMenuTemplate.tsx | 4 +- packages/main/src/DialogTemplate.tsx | 2 +- packages/main/src/SliderBaseTemplate.tsx | 4 +- packages/main/src/SuggestionListItem.ts | 2 +- packages/main/src/TreeItemTemplate.tsx | 2 +- packages/tools/components-package/eslint.js | 2 + packages/tools/package.json | 1 + yarn.lock | 92 ++++++++++++++++++++- 9 files changed, 102 insertions(+), 11 deletions(-) diff --git a/packages/fiori/src/DynamicPageTitle.ts b/packages/fiori/src/DynamicPageTitle.ts index 2952905d3860..400d738a13ef 100644 --- a/packages/fiori/src/DynamicPageTitle.ts +++ b/packages/fiori/src/DynamicPageTitle.ts @@ -274,8 +274,8 @@ class DynamicPageTitle extends UI5Element { } } - get _needsSeparator() { - return (this.navigationBar.length && this.actionsBar.length); + get _needsSeparator(): boolean { + return (this.navigationBar.length > 0 && this.actionsBar.length > 0); } prepareLayoutActions() { diff --git a/packages/fiori/src/UserMenuTemplate.tsx b/packages/fiori/src/UserMenuTemplate.tsx index 895a0aedec19..ff87347b8ad1 100644 --- a/packages/fiori/src/UserMenuTemplate.tsx +++ b/packages/fiori/src/UserMenuTemplate.tsx @@ -77,7 +77,7 @@ export default function UserMenuTemplate(this: UserMenu) {