From 97e909ebf4e150996b1aef02e9b4fc9e84c3f20a Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 2 Feb 2026 15:18:30 -0800 Subject: [PATCH] Chore: move to eslint (#6270) --- .eslintrc.json | 42 --------------- eslint.config.mjs | 69 +++++++++++++++++++++++++ next-i18next.config.js | 4 +- package.json | 5 +- pnpm-lock.yaml | 48 +++++++++++++++-- src/middleware.js | 1 - src/pages/api/ping.js | 4 +- src/utils/config/api-response.js | 2 - src/utils/config/config.js | 1 - src/utils/config/shvl.js | 2 - src/utils/layout/columns.js | 1 - src/utils/logger.js | 4 +- src/utils/proxy/cookie-jar.js | 1 - src/utils/proxy/handlers/jsonrpc.js | 1 - src/utils/proxy/handlers/synology.js | 3 +- src/utils/proxy/http.js | 2 - src/utils/proxy/validate-widget-data.js | 1 - src/widgets/beszel/proxy.js | 1 - src/widgets/deluge/proxy.js | 1 - src/widgets/dispatcharr/proxy.js | 1 - src/widgets/flood/proxy.js | 1 - src/widgets/homebridge/proxy.js | 2 +- src/widgets/jdownloader/proxy.js | 1 - src/widgets/npm/proxy.js | 1 - src/widgets/omada/proxy.js | 2 - src/widgets/plex/proxy.js | 1 - src/widgets/pyload/proxy.js | 2 - src/widgets/qbittorrent/proxy.js | 1 - src/widgets/xteve/proxy.js | 1 - 29 files changed, 121 insertions(+), 85 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.mjs diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index d29adc331..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "extends": [ - "next/core-web-vitals", - "prettier", - "plugin:react-hooks/recommended" - ], - "plugins": ["prettier"], - "rules": { - "import/no-cycle": [ - "error", - { - "maxDepth": 1 - } - ], - "import/order": [ - "error", - { - "newlines-between": "always" - } - ], - "no-else-return": [ - "error", - { - "allowElseIf": true - } - ] - }, - "settings": { - "import/resolver": { - "node": { - "paths": ["src"] - } - } - }, - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module", - "ecmaFeatures": { - "modules": true - } - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..4b8958ef0 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,69 @@ +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +import { fixupConfigRules } from "@eslint/compat"; +import { FlatCompat } from "@eslint/eslintrc"; +import js from "@eslint/js"; +import prettier from "eslint-plugin-prettier"; +import { defineConfig, globalIgnores } from "eslint/config"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}); + +export default defineConfig([ + { + extends: fixupConfigRules(compat.extends("next/core-web-vitals", "prettier", "plugin:react-hooks/recommended")), + + plugins: { + prettier, + }, + + languageOptions: { + ecmaVersion: 6, + sourceType: "module", + + parserOptions: { + ecmaFeatures: { + modules: true, + }, + }, + }, + + settings: { + "import/resolver": { + node: { + paths: ["src"], + }, + }, + }, + + rules: { + "import/no-cycle": [ + "error", + { + maxDepth: 1, + }, + ], + + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + + "no-else-return": [ + "error", + { + allowElseIf: true, + }, + ], + }, + }, + globalIgnores(["./config/", "./.venv/", "./.next/", "./site/"]), +]); diff --git a/next-i18next.config.js b/next-i18next.config.js index f6968dc35..cef9e3988 100644 --- a/next-i18next.config.js +++ b/next-i18next.config.js @@ -1,6 +1,5 @@ // prettyBytes taken from https://github.com/sindresorhus/pretty-bytes -/* eslint-disable no-param-reassign */ const BYTE_UNITS = ["B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; const BIBYTE_UNITS = ["B", "kiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]; @@ -37,7 +36,6 @@ function prettyBytes(number, options) { ...options, }; - // eslint-disable-next-line no-nested-ternary const UNITS = options.bits ? (options.binary ? BIBIT_UNITS : BIT_UNITS) : options.binary ? BIBYTE_UNITS : BYTE_UNITS; if (options.signed && number === 0) { @@ -45,7 +43,7 @@ function prettyBytes(number, options) { } const isNegative = number < 0; - // eslint-disable-next-line no-nested-ternary + const prefix = isNegative ? "-" : options.signed ? "+" : ""; if (isNegative) { diff --git a/package.json b/package.json index 526c5ab59..2b10428dc 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint", + "lint": "eslint .", "telemetry": "next telemetry disable" }, "dependencies": { @@ -44,6 +44,9 @@ "xml-js": "^1.6.11" }, "devDependencies": { + "@eslint/compat": "^2.0.2", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@tailwindcss/forms": "^0.5.10", "@tailwindcss/postcss": "^4.1.18", "eslint": "^9.25.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 846274977..b3b3820c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -102,6 +102,15 @@ importers: specifier: ^1.6.11 version: 1.6.11 devDependencies: + '@eslint/compat': + specifier: ^2.0.2 + version: 2.0.2(eslint@9.25.1(jiti@2.6.1)) + '@eslint/eslintrc': + specifier: ^3.3.3 + version: 3.3.3 + '@eslint/js': + specifier: ^9.39.2 + version: 9.39.2 '@tailwindcss/forms': specifier: ^0.5.10 version: 0.5.10(tailwindcss@4.1.18) @@ -202,6 +211,15 @@ packages: resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + '@eslint/compat@2.0.2': + resolution: {integrity: sha512-pR1DoD0h3HfF675QZx0xsyrsU8q70Z/plx7880NOhS02NuWLgBCOMDL787nUeQ7EWLkxv3bPQJaarjcPQb2Dwg==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: ^8.40 || 9 || 10 + peerDependenciesMeta: + eslint: + optional: true + '@eslint/config-array@0.20.0': resolution: {integrity: sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -214,14 +232,22 @@ packages: resolution: {integrity: sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/eslintrc@3.3.1': - resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} + '@eslint/core@1.1.0': + resolution: {integrity: sha512-/nr9K9wkr3P1EzFTdFdMoLuo1PmIxjmwvPozwoSodjNBdefGujXQUF93u1DDZpEaTuDvMsIQddsd35BwtrW9Xw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/eslintrc@3.3.3': + resolution: {integrity: sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/js@9.25.1': resolution: {integrity: sha512-dEIwmjntEx8u3Uvv+kr3PDeeArL8Hw07H9kyYxCjnM9pBjfEhk6uLXSchxxzgiwtRhhzVzqmUSDFBOi1TuZ7qg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@9.39.2': + resolution: {integrity: sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/object-schema@2.1.6': resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -3099,6 +3125,12 @@ snapshots: '@eslint-community/regexpp@4.12.1': {} + '@eslint/compat@2.0.2(eslint@9.25.1(jiti@2.6.1))': + dependencies: + '@eslint/core': 1.1.0 + optionalDependencies: + eslint: 9.25.1(jiti@2.6.1) + '@eslint/config-array@0.20.0': dependencies: '@eslint/object-schema': 2.1.6 @@ -3113,10 +3145,14 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 - '@eslint/eslintrc@3.3.1': + '@eslint/core@1.1.0': + dependencies: + '@types/json-schema': 7.0.15 + + '@eslint/eslintrc@3.3.3': dependencies: ajv: 6.12.6 - debug: 4.4.0 + debug: 4.4.1 espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 @@ -3129,6 +3165,8 @@ snapshots: '@eslint/js@9.25.1': {} + '@eslint/js@9.39.2': {} + '@eslint/object-schema@2.1.6': {} '@eslint/plugin-kit@0.2.8': @@ -4559,7 +4597,7 @@ snapshots: '@eslint/config-array': 0.20.0 '@eslint/config-helpers': 0.2.2 '@eslint/core': 0.13.0 - '@eslint/eslintrc': 3.3.1 + '@eslint/eslintrc': 3.3.3 '@eslint/js': 9.25.1 '@eslint/plugin-kit': 0.2.8 '@humanfs/node': 0.16.6 diff --git a/src/middleware.js b/src/middleware.js index f16b51745..39452f6cc 100644 --- a/src/middleware.js +++ b/src/middleware.js @@ -10,7 +10,6 @@ export function middleware(req) { allowedHosts = allowedHosts.concat(process.env.HOMEPAGE_ALLOWED_HOSTS.split(",")); } if (!allowAll && (!host || !allowedHosts.includes(host))) { - // eslint-disable-next-line no-console console.error( `Host validation failed for: ${host}. Hint: Set the HOMEPAGE_ALLOWED_HOSTS environment variable to allow requests from this host / port.`, ); diff --git a/src/pages/api/ping.js b/src/pages/api/ping.js index 8ef64ffc9..07a40346e 100644 --- a/src/pages/api/ping.js +++ b/src/pages/api/ping.js @@ -28,9 +28,7 @@ export default async function handler(req, res) { try { // maintain backwards compatibility with old ping where may be http://... hostname = new URL(pingHostOrURL).hostname; - } catch (e) { - // eslint-disable-line no-empty - } + } catch (e) {} try { const response = await ping.probe(hostname); diff --git a/src/utils/config/api-response.js b/src/utils/config/api-response.js index b7b670cd0..cbc382f24 100644 --- a/src/utils/config/api-response.js +++ b/src/utils/config/api-response.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { promises as fs } from "fs"; import path from "path"; @@ -100,7 +99,6 @@ function convertLayoutGroupToGroup(name, layoutGroup) { function mergeSubgroups(configuredGroups, mergedGroup) { configuredGroups.forEach((group) => { if (group.name === mergedGroup.name) { - // eslint-disable-next-line no-param-reassign group.services = mergedGroup.services; } else if (group.groups) { mergeSubgroups(group.groups, mergedGroup); diff --git a/src/utils/config/config.js b/src/utils/config/config.js index 60ac087aa..22f0e2c73 100644 --- a/src/utils/config/config.js +++ b/src/utils/config/config.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { copyFileSync, existsSync, mkdirSync, readFileSync } from "fs"; import { join } from "path"; diff --git a/src/utils/config/shvl.js b/src/utils/config/shvl.js index 6ece8c2b9..284b48a2f 100644 --- a/src/utils/config/shvl.js +++ b/src/utils/config/shvl.js @@ -1,5 +1,3 @@ -/* eslint-disable */ - /* Code primarely based on shvl repository: https://github.com/robinvdvleuten/shvl diff --git a/src/utils/layout/columns.js b/src/utils/layout/columns.js index 2de4eb8b9..7b0dd8c67 100644 --- a/src/utils/layout/columns.js +++ b/src/utils/layout/columns.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line import/prefer-default-export export const columnMap = [ "grid-cols-1 md:grid-cols-1 lg:grid-cols-1", "grid-cols-1 md:grid-cols-1 lg:grid-cols-1", diff --git a/src/utils/logger.js b/src/utils/logger.js index a3a6ee870..74dfaf9bc 100644 --- a/src/utils/logger.js +++ b/src/utils/logger.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { format as utilFormat } from "node:util"; import winston from "winston"; @@ -9,10 +8,9 @@ let winstonLogger; function combineMessageAndSplat() { return { - // eslint-disable-next-line no-unused-vars transform: (info, opts) => { // combine message and args if any - // eslint-disable-next-line no-param-reassign + info.message = utilFormat(info.message, ...(info[Symbol.for("splat")] || [])); return info; }, diff --git a/src/utils/proxy/cookie-jar.js b/src/utils/proxy/cookie-jar.js index baea21d5b..3161d1d2f 100644 --- a/src/utils/proxy/cookie-jar.js +++ b/src/utils/proxy/cookie-jar.js @@ -1,4 +1,3 @@ -/* eslint-disable no-param-reassign */ import { Cookie, CookieJar } from "tough-cookie"; const cookieJar = new CookieJar(); diff --git a/src/utils/proxy/handlers/jsonrpc.js b/src/utils/proxy/handlers/jsonrpc.js index bdb10e022..27c2b324f 100644 --- a/src/utils/proxy/handlers/jsonrpc.js +++ b/src/utils/proxy/handlers/jsonrpc.js @@ -30,7 +30,6 @@ export async function sendJsonRpcRequest(url, method, params, widget) { body, }; - // eslint-disable-next-line no-unused-vars const [status, contentType, data] = await httpProxy(url, httpRequestParams); if (status === 200) { const json = JSON.parse(data.toString()); diff --git a/src/utils/proxy/handlers/synology.js b/src/utils/proxy/handlers/synology.js index 6fe98dce9..4941ba11f 100644 --- a/src/utils/proxy/handlers/synology.js +++ b/src/utils/proxy/handlers/synology.js @@ -48,7 +48,7 @@ async function getApiInfo(serviceWidget, apiName, serviceName) { } const infoUrl = formatApiCall(INFO_ENDPOINT, serviceWidget); - // eslint-disable-next-line no-unused-vars + const [status, contentType, data] = await httpProxy(infoUrl); if (status === 200) { @@ -74,7 +74,6 @@ async function getApiInfo(serviceWidget, apiName, serviceName) { async function handleUnsuccessfulResponse(serviceWidget, url, serviceName) { logger.debug(`Attempting login to ${serviceWidget.type}`); - // eslint-disable-next-line no-unused-vars const [apiPath, maxVersion] = await getApiInfo(serviceWidget, AUTH_API_NAME, serviceName); const authArgs = { path: apiPath ?? "entry.cgi", maxVersion: maxVersion ?? 7, ...serviceWidget }; diff --git a/src/utils/proxy/http.js b/src/utils/proxy/http.js index 5db97c60a..d61cc5c7f 100644 --- a/src/utils/proxy/http.js +++ b/src/utils/proxy/http.js @@ -1,5 +1,3 @@ -/* eslint-disable prefer-promise-reject-errors */ -/* eslint-disable no-param-reassign */ import { createUnzip, constants as zlibConstants } from "node:zlib"; import { http, https } from "follow-redirects"; diff --git a/src/utils/proxy/validate-widget-data.js b/src/utils/proxy/validate-widget-data.js index de2a3c4ed..b38ef4f79 100644 --- a/src/utils/proxy/validate-widget-data.js +++ b/src/utils/proxy/validate-widget-data.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import createLogger from "utils/logger"; import widgets from "widgets/widgets"; diff --git a/src/widgets/beszel/proxy.js b/src/widgets/beszel/proxy.js index 93a2385c6..8521062cc 100644 --- a/src/widgets/beszel/proxy.js +++ b/src/widgets/beszel/proxy.js @@ -97,7 +97,6 @@ export default async function beszelProxyHandler(req, res) { return res.status(status).send(data); } - // eslint-disable-next-line no-unused-vars [status, , data] = await httpProxy(url, { method: "GET", headers: { diff --git a/src/widgets/deluge/proxy.js b/src/widgets/deluge/proxy.js index ef255160a..cd21cddfa 100644 --- a/src/widgets/deluge/proxy.js +++ b/src/widgets/deluge/proxy.js @@ -65,7 +65,6 @@ export default async function delugeProxyHandler(req, res) { return res.status(status).end(data); } - // eslint-disable-next-line no-unused-vars [status, contentType, data] = await sendRpc(url, dataMethod, dataParams); } diff --git a/src/widgets/dispatcharr/proxy.js b/src/widgets/dispatcharr/proxy.js index 45175983a..a0e73eb3f 100644 --- a/src/widgets/dispatcharr/proxy.js +++ b/src/widgets/dispatcharr/proxy.js @@ -97,7 +97,6 @@ export default async function dispatcharrProxyHandler(req, res) { return res.status(status).send(data); } - // eslint-disable-next-line no-unused-vars [status, , data] = await httpProxy(url, { method: "GET", headers: { diff --git a/src/widgets/flood/proxy.js b/src/widgets/flood/proxy.js index 5e5335ae1..730ca5ed6 100644 --- a/src/widgets/flood/proxy.js +++ b/src/widgets/flood/proxy.js @@ -22,7 +22,6 @@ async function login(widget) { }); } - // eslint-disable-next-line no-unused-vars const [status, contentType, data] = await httpProxy(loginUrl, loginParams); return [status, data]; } diff --git a/src/widgets/homebridge/proxy.js b/src/widgets/homebridge/proxy.js index 675e2976c..02fcd7837 100644 --- a/src/widgets/homebridge/proxy.js +++ b/src/widgets/homebridge/proxy.js @@ -16,7 +16,7 @@ async function login(widget, service) { const loginUrl = new URL(formatApiCall(api, { endpoint, ...widget })); const loginBody = { username: widget.username.toString(), password: widget.password.toString() }; const headers = { "Content-Type": "application/json" }; - // eslint-disable-next-line no-unused-vars + const [status, contentType, data, responseHeaders] = await httpProxy(loginUrl, { method: "POST", body: JSON.stringify(loginBody), diff --git a/src/widgets/jdownloader/proxy.js b/src/widgets/jdownloader/proxy.js index d5d5ac3d7..d16ac7d3b 100644 --- a/src/widgets/jdownloader/proxy.js +++ b/src/widgets/jdownloader/proxy.js @@ -1,4 +1,3 @@ -/* eslint-disable no-underscore-dangle */ import crypto from "crypto"; import querystring from "querystring"; diff --git a/src/widgets/npm/proxy.js b/src/widgets/npm/proxy.js index 793077829..5b7c5a8b4 100644 --- a/src/widgets/npm/proxy.js +++ b/src/widgets/npm/proxy.js @@ -79,7 +79,6 @@ export default async function npmProxyHandler(req, res) { return res.status(status).send(data); } - // eslint-disable-next-line no-unused-vars [status, , data] = await httpProxy(url, { method: "GET", headers: { diff --git a/src/widgets/omada/proxy.js b/src/widgets/omada/proxy.js index f8a586705..1151826da 100644 --- a/src/widgets/omada/proxy.js +++ b/src/widgets/omada/proxy.js @@ -20,7 +20,6 @@ async function login(loginUrl, username, password, controllerVersionMajor) { }; } - // eslint-disable-next-line no-unused-vars const [status, contentType, data] = await httpProxy(loginUrl, { method: "POST", body: JSON.stringify(params), @@ -234,7 +233,6 @@ export default async function omadaProxyHandler(req, res) { ? `${url}/api/v2/sites/${siteName}/alerts/num?token=${token}¤tPage=1¤tPageSize=1000` : `${url}/${cId}/api/v2/sites/${siteName}/alerts/num?token=${token}¤tPage=1¤tPageSize=1000`; - // eslint-disable-next-line no-unused-vars [status, contentType, data] = await httpProxy(alertUrl, { headers: { "Csrf-Token": token, diff --git a/src/widgets/plex/proxy.js b/src/widgets/plex/proxy.js index f21d07d03..a7580ea37 100644 --- a/src/widgets/plex/proxy.js +++ b/src/widgets/plex/proxy.js @@ -1,4 +1,3 @@ -/* eslint-disable no-underscore-dangle */ import cache from "memory-cache"; import { xml2json } from "xml-js"; diff --git a/src/widgets/pyload/proxy.js b/src/widgets/pyload/proxy.js index 7bfbd46cb..57bd68fd7 100644 --- a/src/widgets/pyload/proxy.js +++ b/src/widgets/pyload/proxy.js @@ -40,7 +40,6 @@ async function fetchFromPyloadAPI(url, sessionId, params, service) { options.headers.Cookie = cache.get(`${sessionCacheKey}.${service}`); } - // eslint-disable-next-line no-unused-vars const [status, contentType, data, responseHeaders] = await httpProxy(url, options); const returnData = parsePyloadResponse(url, data); return [status, returnData, responseHeaders]; @@ -66,7 +65,6 @@ async function fetchFromPyloadAPIBasic(url, params, username, password) { options.body = JSON.stringify(params); } - // eslint-disable-next-line no-unused-vars const [status, contentType, data, responseHeaders] = await httpProxy(parsedUrl, options); const returnData = parsePyloadResponse(parsedUrl, data); return [status, returnData, responseHeaders]; diff --git a/src/widgets/qbittorrent/proxy.js b/src/widgets/qbittorrent/proxy.js index 8f1874bf5..4bb883023 100644 --- a/src/widgets/qbittorrent/proxy.js +++ b/src/widgets/qbittorrent/proxy.js @@ -15,7 +15,6 @@ async function login(widget) { body: loginBody, }; - // eslint-disable-next-line no-unused-vars const [status, contentType, data] = await httpProxy(loginUrl, loginParams); return [status, data]; } diff --git a/src/widgets/xteve/proxy.js b/src/widgets/xteve/proxy.js index 53d82bc4a..cbd731297 100644 --- a/src/widgets/xteve/proxy.js +++ b/src/widgets/xteve/proxy.js @@ -24,7 +24,6 @@ export default async function xteveProxyHandler(req, res) { const payload = { cmd: "status" }; if (widget.username && widget.password) { - // eslint-disable-next-line no-unused-vars const [status, contentType, data] = await httpProxy(url, { method, body: JSON.stringify({