summaryrefslogtreecommitdiff
path: root/packages/sw/src
diff options
context:
space:
mode:
authorKagami Sascha Rosylight <saschanaz@outlook.com>2022-12-12 22:20:35 +0900
committerGitHub <noreply@github.com>2022-12-12 22:20:35 +0900
commitcfd7cf0f1ec24adcef11eb7052e786ae882fe28c (patch)
tree0c4133d5406ccfbce8e76443838a02d10aeab86b /packages/sw/src
parentrefactor(client): Create root.vue and select the ui in it (#9312) (diff)
downloadsharkey-cfd7cf0f1ec24adcef11eb7052e786ae882fe28c.tar.gz
sharkey-cfd7cf0f1ec24adcef11eb7052e786ae882fe28c.tar.bz2
sharkey-cfd7cf0f1ec24adcef11eb7052e786ae882fe28c.zip
refactor(sw): Typecheck the service worker (#9314)
* Typecheck the service worker Currently the service worker build never typechecks, since esbuild and typescript-eslint don't do such job. esbuild: https://esbuild.github.io/content-types/#typescript >However, esbuild does not do any type checking so you will still need to run tsc -noEmit in parallel with esbuild to check types. This is not something esbuild does itself. typescript-eslint: https://typescript-eslint.io/linting/troubleshooting#why-dont-i-see-typescript-errors-in-my-eslint-output >TypeScript's compiler (or whatever your build chain may be) is specifically designed and built to validate the correctness of your codebase. Our tooling does not reproduce the errors that TypeScript provides, because doing so would slow down the lint run [1], and duplicate the errors that TypeScript already outputs for you. Adding this step adds tons of TS errors 😱 * Override lib-webworker with service worker
Diffstat (limited to 'packages/sw/src')
-rw-r--r--packages/sw/src/scripts/create-notification.ts5
-rw-r--r--packages/sw/src/scripts/operations.ts5
-rw-r--r--packages/sw/src/sw.ts4
3 files changed, 0 insertions, 14 deletions
diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts
index cbc86d1d7e..c27e8c709c 100644
--- a/packages/sw/src/scripts/create-notification.ts
+++ b/packages/sw/src/scripts/create-notification.ts
@@ -1,11 +1,6 @@
/*
* Notification manager for SW
*/
-
-// TODO: remove this declaration when https://github.com/microsoft/TypeScript/issues/11781 closes
-// eslint-disable-next-line no-var
-declare var self: ServiceWorkerGlobalScope;
-
import { swLang } from '@/scripts/lang';
import { cli } from '@/scripts/operations';
import { pushNotificationDataMap } from '@/types';
diff --git a/packages/sw/src/scripts/operations.ts b/packages/sw/src/scripts/operations.ts
index dc24315aea..fd27418073 100644
--- a/packages/sw/src/scripts/operations.ts
+++ b/packages/sw/src/scripts/operations.ts
@@ -2,11 +2,6 @@
* Operations
* 各種操作
*/
-
-// TODO: remove this declaration when https://github.com/microsoft/TypeScript/issues/11781 closes
-// eslint-disable-next-line no-var
-declare var self: ServiceWorkerGlobalScope;
-
import * as Misskey from 'misskey-js';
import { SwMessage, swMessageOrderType } from '@/types';
import { acct as getAcct } from '@/filters/user';
diff --git a/packages/sw/src/sw.ts b/packages/sw/src/sw.ts
index 3d2413ab2e..04372a0708 100644
--- a/packages/sw/src/sw.ts
+++ b/packages/sw/src/sw.ts
@@ -1,7 +1,3 @@
-// TODO: remove this declaration when https://github.com/microsoft/TypeScript/issues/11781 closes
-// eslint-disable-next-line no-var
-declare var self: ServiceWorkerGlobalScope;
-
import { createEmptyNotification, createNotification } from '@/scripts/create-notification';
import { swLang } from '@/scripts/lang';
import { swNotificationRead } from '@/scripts/notification-read';