mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-12-10 00:30:23 -06:00
Enforce no-throw-literal rule in ESLint (#6418)
This commit is contained in:
parent
5c83b17992
commit
892bd42dae
@ -78,6 +78,7 @@ module.exports = {
|
|||||||
"keyword-spacing": "warn",
|
"keyword-spacing": "warn",
|
||||||
"space-infix-ops": "error",
|
"space-infix-ops": "error",
|
||||||
"arrow-spacing": "warn",
|
"arrow-spacing": "warn",
|
||||||
|
"no-throw-literal": "error",
|
||||||
"no-trailing-spaces": "error",
|
"no-trailing-spaces": "error",
|
||||||
"no-constant-condition": [ "error", {
|
"no-constant-condition": [ "error", {
|
||||||
"checkLoops": false,
|
"checkLoops": false,
|
||||||
|
|||||||
@ -51,7 +51,7 @@ class Webhook extends NotificationProvider {
|
|||||||
...JSON.parse(notification.webhookAdditionalHeaders)
|
...JSON.parse(notification.webhookAdditionalHeaders)
|
||||||
};
|
};
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw "Additional Headers is not a valid JSON";
|
throw new Error("Additional Headers is not a valid JSON");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user