WebUI: disallow async functions which have no await expression

This commit is contained in:
Chocobo1 2025-04-17 19:37:03 +08:00
parent 1077cbba2b
commit e9fee414df
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
5 changed files with 9 additions and 8 deletions

View File

@ -40,6 +40,7 @@ export default [
"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": [

View File

@ -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;

View File

@ -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;

View File

@ -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"

View File

@ -108,7 +108,7 @@
inactiveSeedingTimeLimit: inactiveSeedingTimeLimitValue
})
})
.then(async (response) => {
.then((response) => {
if (!response.ok)
return;