chore(deps): replace dependency eslint-config-standard-with-typescript with eslint-config-love 43.1.0 (#1228)

* chore(deps): replace dependency eslint-config-standard-with-typescript with eslint-config-love 43.1.0

* actually apply the rules lol

* rebuild

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
This commit is contained in:
renovate[bot]
2024-04-23 00:40:51 +02:00
committed by GitHub
parent 8aacc312cf
commit faa89850d0
53 changed files with 217 additions and 194 deletions
+18 -10
View File
@@ -9,22 +9,28 @@ import type { Options } from "./index";
let permissionSettable = false;
let permissionValue = "default";
function isPermissionGranted() {
async function isPermissionGranted(): Promise<boolean> {
if (window.Notification.permission !== "default") {
return Promise.resolve(window.Notification.permission === "granted");
return await Promise.resolve(
window.Notification.permission === "granted",
);
}
return invoke("plugin:notification|is_permission_granted");
return await invoke("plugin:notification|is_permission_granted");
}
function setNotificationPermission(value: "granted" | "denied" | "default") {
function setNotificationPermission(
value: "granted" | "denied" | "default",
): void {
permissionSettable = true;
// @ts-expect-error we can actually set this value on the webview
window.Notification.permission = value;
permissionSettable = false;
}
function requestPermission() {
return invoke<"prompt" | "default" | "granted" | "denied">(
async function requestPermission(): Promise<
"default" | "denied" | "granted" | "prompt"
> {
return await invoke<"prompt" | "default" | "granted" | "denied">(
"plugin:notification|request_permission",
).then((permission) => {
setNotificationPermission(
@@ -34,12 +40,12 @@ import type { Options } from "./index";
});
}
function sendNotification(options: string | Options) {
async function sendNotification(options: string | Options): Promise<void> {
if (typeof options === "object") {
Object.freeze(options);
}
return invoke("plugin:notification|notify", {
await invoke("plugin:notification|notify", {
options:
typeof options === "string"
? {
@@ -51,8 +57,10 @@ import type { Options } from "./index";
// @ts-expect-error unfortunately we can't implement the whole type, so we overwrite it with our own version
window.Notification = function (title, options) {
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
const opts = options || {};
sendNotification(
void sendNotification(
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
Object.assign(opts, {
title,
}),
@@ -73,7 +81,7 @@ import type { Options } from "./index";
},
});
isPermissionGranted().then(function (response) {
void isPermissionGranted().then(function (response) {
if (response === null) {
setNotificationPermission("default");
} else {