From 5f0fec3c03a1def1bd40fa34e87b5a9a63755076 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 30 Oct 2020 12:28:58 +0100 Subject: [PATCH] Make everything @typescript-eslint/no-empty-function clean --- .../install/files/js/WoltLabSuite/Core/Ui/Confirmation.js | 4 +++- .../install/files/js/WoltLabSuite/Core/Ui/Page/JumpTo.js | 8 +++++--- wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Screen.js | 4 +++- .../install/files/ts/WoltLabSuite/Core/Ui/Confirmation.ts | 4 +++- .../install/files/ts/WoltLabSuite/Core/Ui/Page/JumpTo.ts | 8 +++++--- wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Screen.ts | 4 +++- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Confirmation.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Confirmation.js index e5ffacd24b..1687354e59 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Confirmation.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Confirmation.js @@ -55,7 +55,9 @@ define(["require", "exports", "tslib", "../Core", "../Language", "./Dialog"], fu } else { if (typeof options.cancel !== "function") { - options.cancel = () => { }; + options.cancel = () => { + // Do nothing + }; } this.callbackCancel = options.cancel; this.callbackConfirm = options.confirm; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/JumpTo.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/JumpTo.js index caf1061cfd..2875cc4bec 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/JumpTo.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/JumpTo.js @@ -23,12 +23,14 @@ define(["require", "exports", "tslib", "../../Language", "../Dialog"], function if (!callback) { const redirectUrl = element.dataset.link; if (redirectUrl) { - callback = function (pageNo) { - window.location.href = redirectUrl.replace(/pageNo=%d/, "pageNo=" + pageNo); + callback = (pageNo) => { + window.location.href = redirectUrl.replace(/pageNo=%d/, `pageNo=${pageNo}`); }; } else { - callback = function () { }; + callback = () => { + // Do nothing. + }; } } else if (typeof callback !== "function") { diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Screen.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Screen.js index 00ac334de0..e1ebf600b8 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Screen.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Screen.js @@ -164,7 +164,9 @@ define(["require", "exports", "tslib", "../Core", "../Environment"], function (r /** * @deprecated 5.4 - This method is a noop. */ - function setDialogContainer(_container) { } + function setDialogContainer(_container) { + // Do nothing. + } exports.setDialogContainer = setDialogContainer; function _getQueryObject(query) { if (typeof query !== "string" || query.trim() === "") { diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Confirmation.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Confirmation.ts index 6db16091f4..6bb30e04a4 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Confirmation.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Confirmation.ts @@ -72,7 +72,9 @@ class UiConfirmation implements DialogCallbackObject { }; } else { if (typeof options.cancel !== "function") { - options.cancel = () => {}; + options.cancel = () => { + // Do nothing + }; } this.callbackCancel = options.cancel; diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/JumpTo.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/JumpTo.ts index 797a24d070..bb6d31a820 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/JumpTo.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/JumpTo.ts @@ -25,11 +25,13 @@ class UiPageJumpTo implements DialogCallbackObject { if (!callback) { const redirectUrl = element.dataset.link; if (redirectUrl) { - callback = function (pageNo) { - window.location.href = redirectUrl.replace(/pageNo=%d/, "pageNo=" + pageNo); + callback = (pageNo) => { + window.location.href = redirectUrl.replace(/pageNo=%d/, `pageNo=${pageNo}`); }; } else { - callback = function () {}; + callback = () => { + // Do nothing. + }; } } else if (typeof callback !== "function") { throw new TypeError("Expected a valid function for parameter 'callback'."); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Screen.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Screen.ts index ea076172b5..098815ece7 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Screen.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Screen.ts @@ -180,7 +180,9 @@ export function pageOverlayIsActive(): boolean { /** * @deprecated 5.4 - This method is a noop. */ -export function setDialogContainer(_container: Element): void {} +export function setDialogContainer(_container: Element): void { + // Do nothing. +} function _getQueryObject(query: string): MediaQueryData { if (typeof (query as any) !== "string" || query.trim() === "") { -- 2.20.1