diff --git a/src/webui/www/eslint.config.mjs b/src/webui/www/eslint.config.mjs index 6aafb8d64..ed4f3ab22 100644 --- a/src/webui/www/eslint.config.mjs +++ b/src/webui/www/eslint.config.mjs @@ -34,12 +34,15 @@ export default [ "no-undef": "off", "no-unused-vars": "off", "no-var": "error", + "object-shorthand": ["error", "consistent"], "operator-assignment": "error", "prefer-arrow-callback": "error", "prefer-const": "error", "prefer-template": "error", "radix": "error", + "require-await": "error", "PreferArrowFunctions/prefer-arrow-functions": "error", + "Stylistic/no-extra-semi": "error", "Stylistic/no-mixed-operators": [ "error", { diff --git a/src/webui/www/private/downloadlimit.html b/src/webui/www/private/downloadlimit.html index 3cc02ebfa..4b313ed83 100644 --- a/src/webui/www/private/downloadlimit.html +++ b/src/webui/www/private/downloadlimit.html @@ -56,7 +56,7 @@ limit: limit }) }) - .then(async (response) => { + .then((response) => { if (!response.ok) return; @@ -72,7 +72,7 @@ limit: limit }) }) - .then(async (response) => { + .then((response) => { if (!response.ok) return; diff --git a/src/webui/www/private/newtag.html b/src/webui/www/private/newtag.html index cab3b26cf..fedf1afd0 100644 --- a/src/webui/www/private/newtag.html +++ b/src/webui/www/private/newtag.html @@ -64,7 +64,7 @@ tags: tagName }) }) - .then(async (response) => { + .then((response) => { if (!response.ok) return; @@ -83,7 +83,7 @@ tags: tagName }) }) - .then(async (response) => { + .then((response) => { if (!response.ok) return; diff --git a/src/webui/www/private/scripts/cache.js b/src/webui/www/private/scripts/cache.js index 3b93c8757..999a5db2d 100644 --- a/src/webui/www/private/scripts/cache.js +++ b/src/webui/www/private/scripts/cache.js @@ -53,7 +53,7 @@ window.qBittorrent.Cache ??= (() => { class BuildInfoCache { #m_store = {}; - async init() { + init() { return fetch("api/v2/app/buildInfo", { method: "GET", cache: "no-store" @@ -80,7 +80,7 @@ window.qBittorrent.Cache ??= (() => { // onFailure: () => {}, // onSuccess: () => {} // } - async init(obj = {}) { + init(obj = {}) { return fetch("api/v2/app/preferences", { method: "GET", cache: "no-store" @@ -153,7 +153,7 @@ window.qBittorrent.Cache ??= (() => { class QbtVersionCache { #m_store = ""; - async init() { + init() { return fetch("api/v2/app/version", { method: "GET", cache: "no-store" diff --git a/src/webui/www/private/scripts/client.js b/src/webui/www/private/scripts/client.js index 382b09a26..6ca444d79 100644 --- a/src/webui/www/private/scripts/client.js +++ b/src/webui/www/private/scripts/client.js @@ -1818,5 +1818,5 @@ window.addEventListener("load", async () => { console.error(`Unexpected 'selected_window_tab' value: ${previouslyUsedTab}`); document.getElementById("transfersTabLink").click(); break; - }; + } }); diff --git a/src/webui/www/private/scripts/contextmenu.js b/src/webui/www/private/scripts/contextmenu.js index c56f1712f..39516aca7 100644 --- a/src/webui/www/private/scripts/contextmenu.js +++ b/src/webui/www/private/scripts/contextmenu.js @@ -292,7 +292,7 @@ window.qBittorrent.ContextMenu ??= (() => { this.options.actions[action](element, this, action); return this; } - }; + } class FilterListContextMenu extends ContextMenu { constructor(options) { @@ -316,7 +316,7 @@ window.qBittorrent.ContextMenu ??= (() => { .setEnabled("stopTorrents", torrentsVisible) .setEnabled("deleteTorrents", torrentsVisible); } - }; + } class TorrentsTableContextMenu extends ContextMenu { updateMenuItems() { @@ -577,13 +577,13 @@ window.qBittorrent.ContextMenu ??= (() => { contextTagList.appendChild(setTagItem); } } - }; + } class StatusesFilterContextMenu extends FilterListContextMenu { updateMenuItems() { this.updateTorrentActions(); } - }; + } class CategoriesFilterContextMenu extends FilterListContextMenu { updateMenuItems() { @@ -604,7 +604,7 @@ window.qBittorrent.ContextMenu ??= (() => { this.updateTorrentActions(); } - }; + } class TagsFilterContextMenu extends FilterListContextMenu { updateMenuItems() { @@ -616,7 +616,7 @@ window.qBittorrent.ContextMenu ??= (() => { this.updateTorrentActions(); } - }; + } class TrackersFilterContextMenu extends FilterListContextMenu { updateMenuItems() { @@ -628,7 +628,7 @@ window.qBittorrent.ContextMenu ??= (() => { this.updateTorrentActions(); } - }; + } class SearchPluginsTableContextMenu extends ContextMenu { updateMenuItems() { @@ -642,7 +642,7 @@ window.qBittorrent.ContextMenu ??= (() => { this.showItem("Uninstall"); } - }; + } class RssFeedContextMenu extends ContextMenu { updateMenuItems() { @@ -715,9 +715,9 @@ window.qBittorrent.ContextMenu ??= (() => { break; } } - }; + } - class RssArticleContextMenu extends ContextMenu {}; + class RssArticleContextMenu extends ContextMenu {} class RssDownloaderRuleContextMenu extends ContextMenu { adjustMenuPosition(e) { @@ -765,7 +765,7 @@ window.qBittorrent.ContextMenu ??= (() => { break; } } - }; + } return exports(); })(); diff --git a/src/webui/www/private/scripts/dynamicTable.js b/src/webui/www/private/scripts/dynamicTable.js index ea9d46d41..59a52e5c5 100644 --- a/src/webui/www/private/scripts/dynamicTable.js +++ b/src/webui/www/private/scripts/dynamicTable.js @@ -2858,7 +2858,6 @@ window.qBittorrent.DynamicTable ??= (() => { // progress this.columns["progress"].updateTd = function(td, row) { - const id = row.rowId; const value = Number(this.getRowValue(row)); const progressBar = td.firstElementChild; @@ -3128,7 +3127,7 @@ window.qBittorrent.DynamicTable ??= (() => { img.height = "22"; td.append(img); } - }; + } }, newColumn: function(name, style, caption, defaultWidth, defaultVisible) { const column = {}; diff --git a/src/webui/www/private/scripts/localpreferences.js b/src/webui/www/private/scripts/localpreferences.js index deb0c159f..73f341127 100644 --- a/src/webui/www/private/scripts/localpreferences.js +++ b/src/webui/www/private/scripts/localpreferences.js @@ -61,7 +61,7 @@ window.qBittorrent.LocalPreferences ??= (() => { console.error(err); } } - }; + } return exports(); })(); diff --git a/src/webui/www/private/scripts/pathAutofill.js b/src/webui/www/private/scripts/pathAutofill.js index 2e260f145..3568b8f71 100644 --- a/src/webui/www/private/scripts/pathAutofill.js +++ b/src/webui/www/private/scripts/pathAutofill.js @@ -85,7 +85,7 @@ window.qBittorrent.pathAutofill ??= (() => { input.addEventListener("input", function() { showPathSuggestions(this, "all"); }); input.classList.add("pathAutoFillInitialized"); } - }; + } return exports(); })(); diff --git a/src/webui/www/private/scripts/rename-files.js b/src/webui/www/private/scripts/rename-files.js index 5087f793e..a320c83df 100644 --- a/src/webui/www/private/scripts/rename-files.js +++ b/src/webui/www/private/scripts/rename-files.js @@ -22,7 +22,7 @@ window.qBittorrent.MultiRename ??= (() => { // Search Options _inner_search: "", - setSearch(val) { + setSearch: function(val) { this._inner_search = val; this._inner_update(); this.onChanged(this.matchedFiles); @@ -33,7 +33,7 @@ window.qBittorrent.MultiRename ??= (() => { // Replacement Options _inner_replacement: "", - setReplacement(val) { + setReplacement: function(val) { this._inner_replacement = val; this._inner_update(); this.onChanged(this.matchedFiles); diff --git a/src/webui/www/private/scripts/search.js b/src/webui/www/private/scripts/search.js index 5d9d8c946..8bae496b4 100644 --- a/src/webui/www/private/scripts/search.js +++ b/src/webui/www/private/scripts/search.js @@ -603,7 +603,7 @@ window.qBittorrent.Search ??= (() => { option.value = category.id; option.textContent = category.name; categoryOptions.push(option); - }; + } // first category is "All Categories" if (categoryOptions.length > 1) { diff --git a/src/webui/www/private/shareratio.html b/src/webui/www/private/shareratio.html index cf2993675..9205b7f76 100644 --- a/src/webui/www/private/shareratio.html +++ b/src/webui/www/private/shareratio.html @@ -108,7 +108,7 @@ inactiveSeedingTimeLimit: inactiveSeedingTimeLimitValue }) }) - .then(async (response) => { + .then((response) => { if (!response.ok) return; diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html index 60903e70c..ec27db3a3 100644 --- a/src/webui/www/private/views/preferences.html +++ b/src/webui/www/private/views/preferences.html @@ -1891,7 +1891,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD case "other": other = document.getElementById(`cb_watch_txt_${i}`).value.trim(); break; - }; + } folders[fpath] = other; } diff --git a/src/webui/www/private/views/rss.html b/src/webui/www/private/views/rss.html index 76c0fdbdd..66b1b7ff7 100644 --- a/src/webui/www/private/views/rss.html +++ b/src/webui/www/private/views/rss.html @@ -232,7 +232,7 @@ if ((row.full_data.dataPath.slice(0, selectedPath.length) === selectedPath) && (row.full_data.dataUid !== "")) feedsToUpdate.add(row); } - }; + } feedsToUpdate.forEach((feed) => refreshFeed(feed.full_data.dataUid)); }, markRead: markSelectedAsRead,