Update linters

This commit is contained in:
Adam Stachowicz
2022-04-26 01:26:57 +02:00
parent 5fbfacf5ce
commit 1e595eaa76
13 changed files with 72 additions and 84 deletions

View File

@@ -58,7 +58,7 @@ class Database {
"patch-monitor-expiry-notification.sql": true,
"patch-status-page-footer-css.sql": true,
"patch-added-mqtt-monitor.sql": true,
}
};
/**
* The final version should be 10 after merged tag feature

View File

@@ -33,7 +33,7 @@ const monitorStatus = new PrometheusClient.Gauge({
});
class Prometheus {
monitorLabelValues = {}
monitorLabelValues = {};
constructor(monitor) {
this.monitorLabelValues = {

View File

@@ -7,7 +7,7 @@ const { UptimeKumaServer } = require("./uptime-kuma-server");
class Proxy {
static SUPPORTED_PROXY_PROTOCOLS = [ "http", "https", "socks", "socks5", "socks4" ]
static SUPPORTED_PROXY_PROTOCOLS = [ "http", "https", "socks", "socks5", "socks4" ];
/**
* Saves and updates given proxy entity

View File

@@ -136,13 +136,6 @@ app.use(function (req, res, next) {
next();
});
/**
* Total WebSocket client connected to server currently, no actual use
*
* @type {number}
*/
let totalClient = 0;
/**
* Use for decode the auth object
* @type {null}
@@ -248,17 +241,11 @@ try {
sendInfo(socket);
totalClient++;
if (needSetup) {
log.info("server", "Redirect to setup page");
socket.emit("setup");
}
socket.on("disconnect", () => {
totalClient--;
});
// ***************************
// Public Socket API
// ***************************
@@ -1228,7 +1215,7 @@ try {
for (let i = 0; i < monitorListData.length; i++) {
// Only starts importing the monitor if the import option is "overwrite", "keep" or "skip" but the notification doesn't exists
if ((importHandle == "skip" && monitorNameListString.includes(monitorListData[i].name) == false) || importHandle == "keep" || importHandle == "overwrite") {
if ((importHandle === "skip" && monitorNameListString.includes(monitorListData[i].name) === false) || importHandle === "keep" || importHandle === "overwrite") {
// Define in here every new variable for monitors which where implemented after the first version of the Import/Export function (1.6.0)
// --- Start ---
@@ -1325,7 +1312,7 @@ try {
await updateMonitorNotification(bean.id, notificationIDList);
// If monitor was active start it immediately, otherwise pause it
if (monitorListData[i].active == 1) {
if (monitorListData[i].active === 1) {
await startMonitor(socket.userID, bean.id);
} else {
await pauseMonitor(socket.userID, bean.id);

View File

@@ -132,7 +132,7 @@ exports.mqttAsync = function (hostname, topic, okMessage, options = {}) {
});
client.on("message", (messageTopic, message) => {
if (messageTopic == topic) {
if (messageTopic === topic) {
client.end();
clearTimeout(timeoutID);
if (okMessage != null && okMessage !== "" && message.toString() !== okMessage) {