From c990edc87ddd2060383442fa02ebae8e05e05fda Mon Sep 17 00:00:00 2001 From: LouisLam Date: Sun, 8 Aug 2021 02:34:51 +0800 Subject: [PATCH] allowElseIf for else return, since its auto fix removes "else" but without newline --- .eslintrc.js | 3 --- server/notification.js | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 41ad54b81..dcd4215c5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -62,9 +62,6 @@ module.exports = { exceptAfterSingleLine: true, }], "no-unneeded-ternary": "error", - "no-else-return": ["error", { - "allowElseIf": false, - }], "array-bracket-newline": ["error", "consistent"], "eol-last": ["error", "always"], //'prefer-template': 'error', diff --git a/server/notification.js b/server/notification.js index c43983d7a..38cb80d90 100644 --- a/server/notification.js +++ b/server/notification.js @@ -124,7 +124,7 @@ class Notification { await axios.post(notification.discordWebhookUrl, discorddowndata) return okMsg; - } if (heartbeatJSON["status"] == 1) { + } else if (heartbeatJSON["status"] == 1) { let discordupdata = { username: notification.discordUsername || "Uptime Kuma", embeds: [{