From: Tim Düsterhus Date: Mon, 2 Nov 2020 10:31:53 +0000 (+0100) Subject: Add .prettierrc X-Git-Tag: 5.4.0_Alpha_1~661 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5b6f5a5202366146f8c3351718aa00db3315f2c2;p=GitHub%2FWoltLab%2FWCF.git Add .prettierrc --- diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..d3baa6eea5 --- /dev/null +++ b/.prettierrc @@ -0,0 +1 @@ +trailingComma: all diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax.ts index 9fd70636f4..74ec86ada1 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax.ts @@ -21,7 +21,7 @@ export function api( callbackObject: AjaxCallbackObject, data?: RequestData, success?: CallbackSuccess, - failure?: CallbackFailure + failure?: CallbackFailure, ): AjaxRequest { if (typeof data !== "object") data = {}; diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Data.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Data.ts index 05e717b84f..2b07503b45 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Data.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Data.ts @@ -32,7 +32,7 @@ export type CallbackFailure = ( data: ResponseData, responseText: string, xhr: XMLHttpRequest, - requestData: RequestData + requestData: RequestData, ) => boolean; export type CallbackFinalize = (xhr: XMLHttpRequest) => void; export type CallbackProgress = (event: ProgressEvent) => void; @@ -40,7 +40,7 @@ export type CallbackSuccess = ( data: ResponseData | DatabaseObjectActionResponse, responseText: string, xhr: XMLHttpRequest, - requestData: RequestData + requestData: RequestData, ) => void; export type CallbackUploadProgress = (event: ProgressEvent) => void; export type CallbackSetup = () => RequestOptions; diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Jsonp.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Jsonp.ts index 7638edbae1..9bbf7ce4f9 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Jsonp.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Jsonp.ts @@ -17,7 +17,7 @@ export function send( url: string, success: (...args: unknown[]) => void, failure: () => void, - options?: JsonpOptions + options?: JsonpOptions, ): void { url = typeof (url as any) === "string" ? url.trim() : ""; if (url.length === 0) { @@ -33,7 +33,7 @@ export function send( parameterName: "callback", timeout: 10, }, - options || {} + options || {}, ) as JsonpOptions; const callbackName = "wcf_jsonp_" + Core.getUuid().replace(/-/g, "").substr(0, 8); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts index 5c800daa9c..2fb1cecdc4 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts @@ -72,7 +72,7 @@ class AjaxRequest { callbackObject: null, }, - options + options, ); if (typeof options.callbackObject === "object") { @@ -109,7 +109,7 @@ class AjaxRequest { } if (typeof this._options.callbackObject._ajaxUploadProgress === "function") { this._options.uploadProgress = this._options.callbackObject._ajaxUploadProgress.bind( - this._options.callbackObject + this._options.callbackObject, ); } } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Core.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Core.ts index f7d78d149b..6c76c960ef 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Core.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Core.ts @@ -137,7 +137,7 @@ export function inherit(constructor: new () => any, superConstructor: new () => writable: true, }, }), - propertiesObject || {} + propertiesObject || {}, ); } @@ -235,7 +235,7 @@ export function debounce( waitMilliseconds = 50, options: DebounceOptions = { isImmediate: false, - } + }, ): (this: ThisParameterType, ...args: Parameters) => void { let timeoutId: ReturnType | undefined; diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Picker.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Picker.ts index 35472cdade..9c5c304a9b 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Picker.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Picker.ts @@ -200,7 +200,7 @@ function initDateRange(element: HTMLInputElement, now: Date, isMinDate: boolean) if (document.getElementById(value) === null) { throw new Error( - "Reference date picker identified by '" + value + "' does not exists (element id: '" + element.id + "')." + "Reference date picker identified by '" + value + "' does not exists (element id: '" + element.id + "').", ); } } else if (/^\d{4}-\d{2}-\d{2}T/.test(value)) { @@ -413,7 +413,7 @@ function renderGrid(day?: number, month?: number, year?: number): void { // check if current selection exceeds min/max date let date = new Date( - year.toString() + "-" + ("0" + (month + 1).toString()).slice(-2) + "-" + ("0" + day.toString()).slice(-2) + year.toString() + "-" + ("0" + (month + 1).toString()).slice(-2) + "-" + ("0" + day.toString()).slice(-2), ); if (date < _minDate) { year = _minDate.getFullYear(); @@ -548,7 +548,7 @@ function formatValue(): void { +_dateGrid.dataset.month!, +_dateGrid.dataset.day!, +_dateHour.value, - +_dateMinute.value + +_dateMinute.value, ); } else { date = new Date(+_dateGrid.dataset.year!, +_dateGrid.dataset.month!, +_dateGrid.dataset.day!); @@ -637,7 +637,7 @@ const DatePicker = { const now = new Date(); document .querySelectorAll( - 'input[type="date"]:not(.inputDatePicker), input[type="datetime"]:not(.inputDatePicker)' + 'input[type="date"]:not(.inputDatePicker), input[type="datetime"]:not(.inputDatePicker)', ) .forEach((element) => { element.classList.add("inputDatePicker"); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Util.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Util.ts index fdde587243..950b946a48 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Util.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Util.ts @@ -211,8 +211,8 @@ export function gmdate(date: Date): number { date.getUTCDay(), date.getUTCHours(), date.getUTCMinutes(), - date.getUTCSeconds() - ) / 1000 + date.getUTCSeconds(), + ) / 1000, ); } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Devtools.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Devtools.ts index b001a7507b..5054807d60 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Devtools.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Devtools.ts @@ -46,7 +46,7 @@ const Devtools = { window.console.log( "%c\tEditor autosave " + (_settings.editorAutosave ? "enabled" : "disabled"), - "font-style: italic" + "font-style: italic", ); }, diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Dom/Util.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Dom/Util.ts index 0949f3b957..f7b61452ab 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Dom/Util.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Dom/Util.ts @@ -290,7 +290,7 @@ const DomUtil = { element: Element, prefix?: string, camelCaseName?: boolean, - idToUpperCase?: boolean + idToUpperCase?: boolean, ): DataAttributes { prefix = prefix || ""; if (prefix.indexOf("data-") !== 0) { @@ -434,7 +434,7 @@ const DomUtil = { errorMessage = ""; } else { throw new TypeError( - "The error message must be a string; `false`, `null` or `undefined` can be used as a substitute for an empty string." + "The error message must be a string; `false`, `null` or `undefined` can be used as a substitute for an empty string.", ); } } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/FileUtil.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/FileUtil.ts index 862bd504fd..10497437c5 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/FileUtil.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/FileUtil.ts @@ -65,7 +65,7 @@ const _fileExtensionIconMapping = new Map( doc: "word", docx: "word", odt: "word", - }) + }), ); const _mimeTypeExtensionMapping = new Map( @@ -126,7 +126,7 @@ const _mimeTypeExtensionMapping = new Map( "application/msword": "doc", "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx", "application/vnd.oasis.opendocument.text": "odt", - }) + }), ); /** diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Image/Resizer.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Image/Resizer.ts index 3c58f15294..e492ca3db3 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Image/Resizer.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Image/Resizer.ts @@ -79,7 +79,7 @@ class ImageResizer { data: CanvasPlusExif, fileName: string, fileType: string = this.fileType, - quality: number = this.quality + quality: number = this.quality, ): Promise { const basename = /(.+)(\..+?)$/.exec(fileName); @@ -143,7 +143,7 @@ class ImageResizer { maxHeight: number = this.maxHeight, quality: number = this.quality, force = false, - cancelPromise?: Promise + cancelPromise?: Promise, ): Promise { const canvas = document.createElement("canvas"); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Language.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Language.ts index 377b14715c..9b34920ef7 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Language.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Language.ts @@ -55,7 +55,9 @@ export function get(key: string, parameters?: object): string { } catch (e) { _languageItems.set( key, - new Template("{literal}" + value.replace(/{\/literal}/g, "{/literal}{ldelim}/literal}{literal}") + "{/literal}") + new Template( + "{literal}" + value.replace(/{\/literal}/g, "{/literal}{ldelim}/literal}{literal}") + "{/literal}", + ), ); } value = _languageItems.get(key); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/StringUtil.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/StringUtil.ts index 48fc2b2626..6a1fbf7cf6 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/StringUtil.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/StringUtil.ts @@ -25,7 +25,7 @@ export function addThousandsSeparator(number: number): string { return String(number).replace( /(^-?\d{1,3}|\d{3})(?=(?:\d{3})+(?:$|\.))/g, - "$1" + Language.get("wcf.global.thousandsSeparator") + "$1" + Language.get("wcf.global.thousandsSeparator"), ); } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Template.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Template.ts index 36d776a01a..e3988205a9 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Template.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Template.ts @@ -51,7 +51,7 @@ class Template { undefined, StringUtil, Language, - I18nPlural + I18nPlural, ); } catch (e) { console.debug(e.message); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Acl/Simple.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Acl/Simple.ts index ece28082bd..817cda8915 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Acl/Simple.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Acl/Simple.ts @@ -42,7 +42,7 @@ class UiAclSimple { includeUserGroups: true, excludedSearchValues: excludedSearchValues, preventSubmit: true, - } + }, ); this.aclListContainer = document.getElementById(this.prefix + "aclListContainer")!; diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Alignment.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Alignment.ts index c6a0a282ee..864f025799 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Alignment.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Alignment.ts @@ -55,7 +55,7 @@ function tryAlignmentVertical( refDimensions: ElementDimensions, refOffsets: ElementOffset, windowHeight: number, - verticalOffset: number + verticalOffset: number, ): VerticalResult { let bottom: Offset = "auto"; let top: Offset = "auto"; @@ -101,7 +101,7 @@ function tryAlignmentHorizontal( elDimensions: ElementDimensions, refDimensions: ElementDimensions, refOffsets: ElementOffset, - windowWidth: number + windowWidth: number, ): HorizontalResult { let left: Offset = "auto"; let right: Offset = "auto"; @@ -160,7 +160,7 @@ export function set(element: HTMLElement, referenceElement: HTMLElement, options // allow flipping over axis, possible values: both, horizontal, vertical and none allowFlip: "both", }, - options || {} + options || {}, ) as AlignmentOptions; if (!Array.isArray(options.pointerClassNames) || options.pointerClassNames.length !== (options.pointer ? 1 : 2)) { @@ -187,7 +187,7 @@ export function set(element: HTMLElement, referenceElement: HTMLElement, options const elDimensions = DomUtil.outerDimensions(element); const refDimensions = DomUtil.outerDimensions( - options.refDimensionsElement instanceof HTMLElement ? options.refDimensionsElement : referenceElement + options.refDimensionsElement instanceof HTMLElement ? options.refDimensionsElement : referenceElement, ); const refOffsets = DomUtil.offset(referenceElement); const windowHeight = window.innerHeight; @@ -221,7 +221,7 @@ export function set(element: HTMLElement, referenceElement: HTMLElement, options elDimensions, refDimensions, refOffsets, - windowWidth + windowWidth, ); // only use these results if it fits into the boundaries, otherwise both directions exceed and we honor the demanded direction if (horizontalFlipped.result) { @@ -240,7 +240,7 @@ export function set(element: HTMLElement, referenceElement: HTMLElement, options refDimensions, refOffsets, windowHeight, - options.verticalOffset! + options.verticalOffset!, ); if (!vertical.result && (options.allowFlip === "both" || options.allowFlip === "vertical")) { const verticalFlipped = tryAlignmentVertical( @@ -249,7 +249,7 @@ export function set(element: HTMLElement, referenceElement: HTMLElement, options refDimensions, refOffsets, windowHeight, - options.verticalOffset! + options.verticalOffset!, ); // only use these results if it fits into the boundaries, otherwise both directions exceed and we honor the demanded direction if (verticalFlipped.result) { diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Confirmation.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Confirmation.ts index 6bb30e04a4..34769e85cf 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Confirmation.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Confirmation.ts @@ -195,7 +195,7 @@ export function show(options: ConfirmationOptions): void { parameters: {}, template: "", }, - options + options, ) as ConfirmationOptions; options.message = typeof (options.message as any) === "string" ? options.message.trim() : ""; if (!options.message) { diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dialog.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dialog.ts index 8e48980a97..73bf017f35 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dialog.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dialog.ts @@ -72,7 +72,7 @@ const UiDialog = { event.preventDefault(); } }, - { passive: false } + { passive: false }, ); document.getElementById("content")!.appendChild(_container); @@ -168,7 +168,7 @@ const UiDialog = { throw new Error( "Element id '" + id + - "' is invalid and no source attribute was given. If you want to use the `html` argument instead, please add `source: null` to your dialog configuration." + "' is invalid and no source attribute was given. If you want to use the `html` argument instead, please add `source: null` to your dialog configuration.", ); } @@ -254,7 +254,7 @@ const UiDialog = { onClose: null, onShow: null, }, - options || {} + options || {}, ) as InternalDialogOptions; if (!options.closable) options.backdropCloseOnClick = false; @@ -325,7 +325,7 @@ const UiDialog = { if (typeof value !== "function" && value !== null) { throw new Error( - "Only functions or the 'null' value are acceptable callback values ('" + typeof value + "' given)." + "Only functions or the 'null' value are acceptable callback values ('" + typeof value + "' given).", ); } @@ -419,7 +419,7 @@ const UiDialog = { event.preventDefault(); } }, - { passive: false } + { passive: false }, ); let content: HTMLElement; @@ -668,7 +668,7 @@ const UiDialog = { const inputFields = data.content.querySelectorAll('input[data-dialog-submit-on-enter="true"]'); const submitButton = data.content.querySelector( - '.formSubmit > input[type="submit"], .formSubmit > button[data-type="submit"]' + '.formSubmit > input[type="submit"], .formSubmit > button[data-type="submit"]', ); if (submitButton === null) { // check if there is at least one input field with submit handling, diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts index ed1edaa741..52b6dd24e8 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts @@ -92,7 +92,7 @@ function toggle( event: KeyboardEvent | MouseEvent | null, targetId?: string, alternateElement?: HTMLElement, - disableAutoFocus?: boolean + disableAutoFocus?: boolean, ): boolean { if (event !== null) { event.preventDefault(); @@ -387,14 +387,14 @@ const UiDropdownSimple = { const dropdown = DomTraverse.parentByClass(button, "dropdown") as HTMLElement; if (dropdown === null) { throw new Error( - "Invalid dropdown passed, button '" + DomUtil.identify(button) + "' does not have a parent with .dropdown." + "Invalid dropdown passed, button '" + DomUtil.identify(button) + "' does not have a parent with .dropdown.", ); } const menu = DomTraverse.nextByClass(button, "dropdownMenu") as HTMLElement; if (menu === null) { throw new Error( - "Invalid dropdown passed, button '" + DomUtil.identify(button) + "' does not have a menu as next sibling." + "Invalid dropdown passed, button '" + DomUtil.identify(button) + "' does not have a menu as next sibling.", ); } @@ -434,7 +434,7 @@ const UiDropdownSimple = { event.preventDefault(); } }, - { passive: false } + { passive: false }, ); } } @@ -609,7 +609,7 @@ const UiDropdownSimple = { event: KeyboardEvent | MouseEvent | null, targetId?: string, alternateElement?: HTMLElement, - disableAutoFocus?: boolean + disableAutoFocus?: boolean, ): boolean { return toggle(event, targetId, alternateElement, disableAutoFocus); }, diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList.ts index c41e37423c..7de204a658 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList.ts @@ -379,7 +379,7 @@ export function init(elementId: string, values: ItemDataOrPlainValue[], options: // value may contain the placeholder `{$objectId}` submitFieldName: "", }, - options + options, ) as ItemListOptions; const form = DomTraverse.parentByTag(element, "FORM") as HTMLFormElement; @@ -387,7 +387,7 @@ export function init(elementId: string, values: ItemDataOrPlainValue[], options: if (!options.isCSV) { if (!options.submitFieldName.length && typeof options.callbackSubmit !== "function") { throw new Error( - "Expected a valid function for option 'callbackSubmit', a non-empty value for option 'submitFieldName' or enabling the option 'submitFieldCSV'." + "Expected a valid function for option 'callbackSubmit', a non-empty value for option 'submitFieldName' or enabling the option 'submitFieldCSV'.", ); } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Header/Menu.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Header/Menu.ts index de1907263b..e72e5bbc7f 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Header/Menu.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Header/Menu.ts @@ -190,7 +190,7 @@ function setupA11y(): void { link.setAttribute("aria-expanded", showMenu ? "true" : "false"); showMenuButton.setAttribute( "aria-label", - Language.get(showMenu ? "wcf.global.button.hideMenu" : "wcf.global.button.showMenu") + Language.get(showMenu ? "wcf.global.button.hideMenu" : "wcf.global.button.showMenu"), ); }); }); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Menu/Abstract.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Menu/Abstract.ts index efb0c620b1..2015d08e1b 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Menu/Abstract.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Menu/Abstract.ts @@ -276,7 +276,7 @@ abstract class UiPageMenuAbstract { () => { this.menu.classList.remove("androidMenuTouchEnd"); }, - { once: true } + { once: true }, ); // check whether the user moved the finger far enough diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Search/Handler.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Search/Handler.ts index 3e33ca0025..30237daf1f 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Search/Handler.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Search/Handler.ts @@ -67,7 +67,7 @@ class UiPageSearchHandler implements DialogCallbackObject { let image = item.image; if (/^fa-/.test(image)) { image = ``; } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Search/Input.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Search/Input.ts index baefcd8f53..db476e7979 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Search/Input.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Search/Input.ts @@ -33,7 +33,7 @@ class UiPageSearchInput extends UiSearchInput { className: "wcf\\data\\page\\PageAction", }, }, - options + options, ) as any; super(element, options); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Screen.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Screen.ts index 9ab15b8ab6..0adedde0bd 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Screen.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Screen.ts @@ -32,7 +32,7 @@ const _mqMap = new Map( "screen-lg-only": "(min-width: 1025px) and (max-width: 1280px)", "screen-lg-down": "(max-width: 1280px)", "screen-xl": "(min-width: 1281px)", - }) + }), ); // Microsoft Edge rewrites the media queries to whatever it diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Input.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Input.ts index 1ab9c20fce..9f9e416d3b 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Input.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Input.ts @@ -63,7 +63,7 @@ class UiSearchInput { noResultPlaceholder: "", preventSubmit: false, }, - options + options, ) as SearchInputOptions; this.ajaxPayload = options.ajax as DatabaseObjectActionPayload; diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Page.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Page.ts index 76b3e40f3f..ac90849511 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Page.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Page.ts @@ -53,7 +53,7 @@ function click(event: MouseEvent): void { // update label const inputContainer = document.getElementById("pageHeaderSearchInputContainer") as HTMLElement; const button = inputContainer.querySelector( - ".pageHeaderSearchType > .button > .pageHeaderSearchTypeLabel" + ".pageHeaderSearchType > .button > .pageHeaderSearchTypeLabel", ) as HTMLElement; button.textContent = target.textContent; } @@ -83,7 +83,7 @@ export function init(objectType: string): void { dropdownMenu.style.setProperty( "transform", `translateX(-${Math.ceil(offsetRight)}px) translateY(-${offsetTop}px)`, - "" + "", ); } }, diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Suggestion.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Suggestion.ts index 48b4d810e8..d552a3c9a1 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Suggestion.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Suggestion.ts @@ -57,7 +57,7 @@ class UiSuggestion implements AjaxCallbackObject { data: {}, }, }, - options.ajax + options.ajax, ) as DatabaseObjectActionPayload; if (typeof options.callbackSelect !== "function") { @@ -66,7 +66,7 @@ class UiSuggestion implements AjaxCallbackObject { this.callbackSelect = options.callbackSelect; this.excludedSearchValues = new Set( - Array.isArray(options.excludedSearchValues) ? options.excludedSearchValues : [] + Array.isArray(options.excludedSearchValues) ? options.excludedSearchValues : [], ); this.threshold = options.threshold === undefined ? 3 : options.threshold; diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu.ts index 266cee7b22..87dc742e24 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu.ts @@ -77,7 +77,7 @@ function init() { // slight delay to avoid calling this function too often timeout = window.setTimeout(callback, 10); }, - { passive: true } + { passive: true }, ); }); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts index 389abb169d..b31a37d88f 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts @@ -76,25 +76,25 @@ class TabMenuSimple { name + "'] (tab menu id: '" + containerId + - "') exists more than once." + "') exists more than once.", ); } const container = this.containers.get(name); if (container === undefined) { throw new Error( - "Expected content element for li[data-name='" + name + "'] (tab menu id: '" + containerId + "')." + "Expected content element for li[data-name='" + name + "'] (tab menu id: '" + containerId + "').", ); } else if (container.parentNode !== this.container) { throw new Error( - "Expected content element '" + name + "' (tab menu id: '" + containerId + "') to be a direct children." + "Expected content element '" + name + "' (tab menu id: '" + containerId + "') to be a direct children.", ); } // check if tab holds exactly one children which is an anchor element if (tab.childElementCount !== 1 || tab.children[0].nodeName !== "A") { throw new Error( - "Expected exactly one as children for li[data-name='" + name + "'] (tab menu id: '" + containerId + "')." + "Expected exactly one as children for li[data-name='" + name + "'] (tab menu id: '" + containerId + "').", ); } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Editor.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Editor.ts index ac354aae7c..5768348418 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Editor.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Editor.ts @@ -26,7 +26,7 @@ class UserEditor implements AjaxCallbackObject, DialogCallbackObject { ["ban", "disableAvatar", "disableCoverPhoto", "disableSignature", "enable"].forEach((action) => { const button = document.querySelector( - ".userProfileButtonMenu .jsButtonUser" + StringUtil.ucfirst(action) + ".userProfileButtonMenu .jsButtonUser" + StringUtil.ucfirst(action), ) as HTMLElement; // The button is missing if the current user lacks the permission. @@ -146,7 +146,7 @@ class UserEditor implements AjaxCallbackObject, DialogCallbackObject { this.header.dataset.disableAvatar = data.actionName === "disableAvatar" ? "true" : "false"; button = document.querySelector(".userProfileButtonMenu .jsButtonUserDisableAvatar") as HTMLElement; button.textContent = Language.get( - "wcf.user." + (data.actionName === "disableAvatar" ? "enable" : "disable") + "Avatar" + "wcf.user." + (data.actionName === "disableAvatar" ? "enable" : "disable") + "Avatar", ); break; @@ -155,7 +155,7 @@ class UserEditor implements AjaxCallbackObject, DialogCallbackObject { this.header.dataset.disableCoverPhoto = data.actionName === "disableCoverPhoto" ? "true" : "false"; button = document.querySelector(".userProfileButtonMenu .jsButtonUserDisableCoverPhoto") as HTMLElement; button.textContent = Language.get( - "wcf.user." + (data.actionName === "disableCoverPhoto" ? "enable" : "disable") + "CoverPhoto" + "wcf.user." + (data.actionName === "disableCoverPhoto" ? "enable" : "disable") + "CoverPhoto", ); break; @@ -164,7 +164,7 @@ class UserEditor implements AjaxCallbackObject, DialogCallbackObject { this.header.dataset.disableSignature = data.actionName === "disableSignature" ? "true" : "false"; button = document.querySelector(".userProfileButtonMenu .jsButtonUserDisableSignature") as HTMLElement; button.textContent = Language.get( - "wcf.user." + (data.actionName === "disableSignature" ? "enable" : "disable") + "Signature" + "wcf.user." + (data.actionName === "disableSignature" ? "enable" : "disable") + "Signature", ); break; @@ -238,7 +238,7 @@ class UserEditor implements AjaxCallbackObject, DialogCallbackObject {
diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/List.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/List.ts index a6c5b56416..1c449dafac 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/List.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/List.ts @@ -36,7 +36,7 @@ class UiUserList implements AjaxCallbackObject, DialogCallbackObject { dialogTitle: "", parameters: {}, }, - options + options, ) as AjaxRequestOptions; } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/PasswordStrength.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/PasswordStrength.ts index 7e867d6cce..6f9475a0d8 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/PasswordStrength.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/PasswordStrength.ts @@ -104,9 +104,9 @@ class PasswordStrength { const dictionary = flatMap( STATIC_DICTIONARY.concat( this.staticDictionary, - this.relatedInputs.map((input) => input.value.trim()) + this.relatedInputs.map((input) => input.value.trim()), ), - splitIntoWords + splitIntoWords, ).filter((value) => value.length > 0); const value = this.input.value.trim(); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Search/Input.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Search/Input.ts index 8385d1dbe4..971b1856d0 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Search/Input.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Search/Input.ts @@ -27,7 +27,7 @@ class UiUserSearchInput extends UiSearchInput { }, }, }, - options + options, ); super(element, options);