From: Tim Düsterhus Date: Mon, 30 Aug 2021 10:33:04 +0000 (+0200) Subject: Satisfy eslint X-Git-Tag: 5.4.7-RC-1~7^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fa94387a03e6c939d3864354da57e999a8d22188;p=GitHub%2FWoltLab%2FWCF.git Satisfy eslint --- diff --git a/ts/WoltLabSuite/Core/Form/Builder/Field/Dependency/Container/Tab.ts b/ts/WoltLabSuite/Core/Form/Builder/Field/Dependency/Container/Tab.ts index a6dd045f53..f8935dd3c0 100644 --- a/ts/WoltLabSuite/Core/Form/Builder/Field/Dependency/Container/Tab.ts +++ b/ts/WoltLabSuite/Core/Form/Builder/Field/Dependency/Container/Tab.ts @@ -31,11 +31,11 @@ class Tab extends Abstract { if (containerIsVisible !== containerShouldBeVisible) { const tabMenuListItem = this._container.parentNode!.parentNode!.querySelector( "#" + - DomUtil.identify(this._container.parentNode! as HTMLElement) + + DomUtil.identify(this._container.parentNode as HTMLElement) + " > nav > ul > li[data-name=" + this._container.id + "]", - )! as HTMLElement; + ) as HTMLElement; if (tabMenuListItem === null) { throw new Error("Cannot find tab menu entry for tab '" + this._container.id + "'."); } diff --git a/ts/WoltLabSuite/Core/Ui/Message/Quote.ts b/ts/WoltLabSuite/Core/Ui/Message/Quote.ts index cf9f4a663c..63768264c0 100644 --- a/ts/WoltLabSuite/Core/Ui/Message/Quote.ts +++ b/ts/WoltLabSuite/Core/Ui/Message/Quote.ts @@ -313,7 +313,7 @@ export class UiMessageQuote implements AjaxCallbackObject { const container = this.containers.get(this.activeMessageId)!; const objectId = ~~container.dataset.objectId!; const content = this.messageBodySelector - ? (container.querySelector(this.messageBodySelector)! as HTMLElement) + ? (container.querySelector(this.messageBodySelector) as HTMLElement) : container; let anchorNode = selection.anchorNode; diff --git a/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts b/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts index 192ea85264..743ec5e7f7 100644 --- a/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts +++ b/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts @@ -378,7 +378,7 @@ class UiPollEditor { public getOptions(): string[] { const options: string[] = []; Array.from(this.optionList.children).forEach((listItem: HTMLLIElement) => { - const optionValue = (listItem.querySelector("input[type=text]")! as HTMLInputElement).value.trim(); + const optionValue = (listItem.querySelector("input[type=text]") as HTMLInputElement).value.trim(); if (optionValue !== "") { options.push(`${listItem.dataset.optionId!}_${optionValue}`); diff --git a/ts/WoltLabSuite/Core/Ui/Reaction/Handler.ts b/ts/WoltLabSuite/Core/Ui/Reaction/Handler.ts index 32ffd5c35d..6ee7982feb 100644 --- a/ts/WoltLabSuite/Core/Ui/Reaction/Handler.ts +++ b/ts/WoltLabSuite/Core/Ui/Reaction/Handler.ts @@ -200,11 +200,11 @@ class UiReactionHandler { protected _markReactionAsActive(): void { let reactionTypeID: number | null = null; - this._objects.get(this._popoverCurrentObjectId)!.forEach((element) => { + for (const element of this._objects.get(this._popoverCurrentObjectId)!) { if (element.reactButton !== null) { reactionTypeID = ~~element.reactButton.dataset.reactionTypeId!; } - }); + } if (reactionTypeID === null) { throw new Error("Unable to find react button for current popover."); @@ -220,7 +220,7 @@ class UiReactionHandler { const scrollableContainer = popover.querySelector(".reactionPopoverContent") as HTMLElement; if (reactionTypeID) { const reactionTypeButton = popover.querySelector( - `.reactionTypeButton[data-reaction-type-id="${reactionTypeID!}"]`, + `.reactionTypeButton[data-reaction-type-id="${reactionTypeID}"]`, ) as HTMLElement; reactionTypeButton.classList.add("active"); reactionTypeButton.setAttribute("aria-selected", "true"); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js index 19eab9274e..7f8b0f9676 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js @@ -129,11 +129,11 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Core", "../../Dom/Ch } _markReactionAsActive() { let reactionTypeID = null; - this._objects.get(this._popoverCurrentObjectId).forEach((element) => { + for (const element of this._objects.get(this._popoverCurrentObjectId)) { if (element.reactButton !== null) { reactionTypeID = ~~element.reactButton.dataset.reactionTypeId; } - }); + } if (reactionTypeID === null) { throw new Error("Unable to find react button for current popover."); }