WebUI: migrate away from outdated config in ESLint
Some checks failed
CI - File health / Check (push) Has been cancelled
CI - macOS / Build (push) Has been cancelled
CI - Python / Check (push) Has been cancelled
CI - Ubuntu / Build (push) Has been cancelled
CI - WebUI / Check (push) Has been cancelled
CI - Windows / Build (push) Has been cancelled

The following message appears when using the outdated value:
>[@stylistic/eslint-plugin]: You are using deprecated value(boolean) for "allowTemplateLiterals"
>in "quotes", please use "always"/"never" instead.

Also prefer using double quotes over backticks for strings.

PR #23038.
This commit is contained in:
Chocobo1 2025-07-28 04:33:50 +08:00 committed by GitHub
commit 2c6c61cc79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 13 deletions

View file

@ -57,7 +57,7 @@ export default [
"double",
{
avoidEscape: true,
allowTemplateLiterals: true
allowTemplateLiterals: "avoidEscape"
}
],
"Stylistic/quote-props": ["error", "consistent-as-needed"],

View file

@ -1008,7 +1008,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
document.getElementById("UpInfos").textContent = transfer_info;
document.title = (speedInTitle
? (`QBT_TR([D: %1, U: %2])QBT_TR[CONTEXT=MainWindow] `
? ("QBT_TR([D: %1, U: %2])QBT_TR[CONTEXT=MainWindow] "
.replace("%1", window.qBittorrent.Misc.friendlyUnit(serverState.dl_info_speed, true))
.replace("%2", window.qBittorrent.Misc.friendlyUnit(serverState.up_info_speed, true)))
: "")

View file

@ -73,9 +73,9 @@ window.qBittorrent.DynamicTable ??= (() => {
this.dynamicTableDiv = document.getElementById(dynamicTableDivId);
this.useVirtualList = useVirtualList && (LocalPreferences.get("use_virtual_list", "false") === "true");
this.fixedTableHeader = document.querySelector(`#${dynamicTableFixedHeaderDivId} thead tr`);
this.hiddenTableHeader = this.dynamicTableDiv.querySelector(`thead tr`);
this.table = this.dynamicTableDiv.querySelector(`table`);
this.tableBody = this.dynamicTableDiv.querySelector(`tbody`);
this.hiddenTableHeader = this.dynamicTableDiv.querySelector("thead tr");
this.table = this.dynamicTableDiv.querySelector("table");
this.tableBody = this.dynamicTableDiv.querySelector("tbody");
this.rowHeight = 26;
this.rows = new Map();
this.cachedElements = [];

View file

@ -98,8 +98,8 @@
document.getElementById("limitUpdateLabel").textContent =
isUpload
? `QBT_TR(Upload limit:)QBT_TR[CONTEXT=SpeedLimit]`
: `QBT_TR(Download limit:)QBT_TR[CONTEXT=SpeedLimit]`;
? "QBT_TR(Upload limit:)QBT_TR[CONTEXT=SpeedLimit]"
: "QBT_TR(Download limit:)QBT_TR[CONTEXT=SpeedLimit]";
fetch(`api/v2/transfer/${getLimitMethod}`, {
method: "GET",

View file

@ -1856,15 +1856,15 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
const pos = document.getElementById("watched_folders_tab").getChildren("tbody")[0].getChildren("tr").length;
const myinput = `<input id='text_watch_${pos}' type='text' value='${folder}'>`;
const disableInput = (sel !== "other");
const mycb = `<div class='select-watched-folder-editable'>`
const mycb = "<div class='select-watched-folder-editable'>"
+ `<select id ='cb_watch_${pos}' onchange='qBittorrent.Preferences.changeWatchFolderSelect(this);'>`
+ `<option value='watch_folder'>QBT_TR(Monitored folder)QBT_TR[CONTEXT=ScanFoldersModel]</option>`
+ `<option value='default_folder'>QBT_TR(Default save location)QBT_TR[CONTEXT=ScanFoldersModel]</option>`
+ `<option value='other'>QBT_TR(Other...)QBT_TR[CONTEXT=ScanFoldersModel]</option>`
+ `</select>`
+ "<option value='watch_folder'>QBT_TR(Monitored folder)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
+ "<option value='default_folder'>QBT_TR(Default save location)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
+ "<option value='other'>QBT_TR(Other...)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
+ "</select>"
+ `<input id='cb_watch_txt_${pos}' type='text' ${disableInput ? "hidden " : ""}/>`
+ `<img src='images/list-add.svg' id='addFolderImg_${pos}' alt='Add' style='padding-left:170px;width:16px;cursor:pointer;' onclick='qBittorrent.Preferences.addWatchFolder();'>`
+ `</div>`;
+ "</div>";
watchedFoldersTable.push([myinput, mycb]);
document.getElementById(`cb_watch_${pos}`).value = sel;