diff --git a/packages/client/src/components/MkCwButton.vue b/packages/client/src/components/MkCwButton.vue index dd906f9bf34c430c5511ff1c4f818e9ad78ff8f2..a473d682a9c1815edb1a2ad6de2d42065057e4c1 100644 --- a/packages/client/src/components/MkCwButton.vue +++ b/packages/client/src/components/MkCwButton.vue @@ -24,7 +24,7 @@ const emit = defineEmits<{ const label = computed(() => { return concat([ props.note.text ? [i18n.t('_cw.chars', { count: length(props.note.text) })] : [], - props.note.files && props.note.files.length !== 0 ? [i18n.t('_cw.files', { count: props.note.files.length }) ] : [], + props.note.files && props.note.files.length !== 0 ? [i18n.t('_cw.files', { count: props.note.files.length })] : [], props.note.poll != null ? [i18n.ts.poll] : [] ] as string[][]).join(' / '); }); diff --git a/packages/client/src/nirax.ts b/packages/client/src/nirax.ts index 0ee39bf47328c3de4f950a2b5e8c5db753021fbe..53e73a8d481e7202f33aaa282c0aeec1f28972fd 100644 --- a/packages/client/src/nirax.ts +++ b/packages/client/src/nirax.ts @@ -105,7 +105,7 @@ export class Router extends EventEmitter<{ function check(routes: RouteDef[], _parts: string[]): Resolved | null { forEachRouteLoop: for (const route of routes) { - let parts = [ ..._parts ]; + let parts = [..._parts]; const props = new Map<string, string>(); pathMatchLoop: diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index 73407ff5fb3b2ace7be82b178268a8d81b66641a..c38e1394f05e6f293eab173b6098ac7dbed3ce4e 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -27,7 +27,7 @@ import { i18n } from '@/i18n'; import MkInfo from '@/components/MkInfo.vue'; import MkSuperMenu from '@/components/MkSuperMenu.vue'; import { scroll } from '@/scripts/scroll'; -import { signout , $i } from '@/account'; +import { signout, $i } from '@/account'; import { unisonReload } from '@/scripts/unison-reload'; import { instance } from '@/instance'; import { useRouter } from '@/router'; diff --git a/packages/client/src/pages/settings/theme.manage.vue b/packages/client/src/pages/settings/theme.manage.vue index 792bb15e5dd6f58cba9cb096095d19791c30db97..25f92e6ed11254547f63c751c42acf6f7262f378 100644 --- a/packages/client/src/pages/settings/theme.manage.vue +++ b/packages/client/src/pages/settings/theme.manage.vue @@ -43,7 +43,7 @@ const installedThemes = ref(getThemes()); const builtinThemes = getBuiltinThemesRef(); const selectedThemeId = ref(null); -const themes = computed(() => [ ...installedThemes.value, ...builtinThemes.value ]); +const themes = computed(() => [...installedThemes.value, ...builtinThemes.value]); const selectedTheme = computed(() => { if (selectedThemeId.value == null) return null; diff --git a/packages/client/src/pages/settings/theme.vue b/packages/client/src/pages/settings/theme.vue index 6571a881a9c31ec858c6129957862b1bed0858fe..42a91bcb594e7478c05e4a702efedeec2a96578d 100644 --- a/packages/client/src/pages/settings/theme.vue +++ b/packages/client/src/pages/settings/theme.vue @@ -76,7 +76,7 @@ import FormButton from '@/components/MkButton.vue'; import { getBuiltinThemesRef } from '@/scripts/theme'; import { selectFile } from '@/scripts/select-file'; import { isDeviceDarkmode } from '@/scripts/is-device-darkmode'; -import { ColdDeviceStorage , defaultStore } from '@/store'; +import { ColdDeviceStorage, defaultStore } from '@/store'; import { i18n } from '@/i18n'; import { instance } from '@/instance'; import { uniqueBy } from '@/scripts/array'; @@ -92,7 +92,7 @@ const builtinDarkThemes = computed(() => builtinThemes.value.filter(t => t.base const instanceLightTheme = computed(() => instance.defaultLightTheme ? JSON5.parse(instance.defaultLightTheme) : null); const installedLightThemes = computed(() => installedThemes.value.filter(t => t.base === 'light' || t.kind === 'light')); const builtinLightThemes = computed(() => builtinThemes.value.filter(t => t.base === 'light' || t.kind === 'light')); -const themes = computed(() => uniqueBy([ instanceDarkTheme.value, instanceLightTheme.value, ...builtinThemes.value, ...installedThemes.value ].filter(x => x != null), theme => theme.id)); +const themes = computed(() => uniqueBy([instanceDarkTheme.value, instanceLightTheme.value, ...builtinThemes.value, ...installedThemes.value].filter(x => x != null), theme => theme.id)); const darkTheme = ColdDeviceStorage.ref('darkTheme'); const darkThemeId = computed({ diff --git a/packages/client/src/pages/user/index.activity.vue b/packages/client/src/pages/user/index.activity.vue index 43c2ed8b04405c14b8f3184b2f76bc4034ea6d57..630a2cea7db7b5d9ff851e5d2d8e853ed884f53e 100644 --- a/packages/client/src/pages/user/index.activity.vue +++ b/packages/client/src/pages/user/index.activity.vue @@ -37,7 +37,7 @@ function showMenu(ev: MouseEvent) { action: () => { chartSrc = 'per-user-notes'; }, - },/*, { + }, /*, { text: i18n.ts.following, action: () => { chartSrc = 'per-user-following'; diff --git a/packages/client/src/scripts/theme-editor.ts b/packages/client/src/scripts/theme-editor.ts index 2c917e280d788dfa1fede91c368b656f981fed01..6d88d6856cc5fac4b51795032d39f33f56530957 100644 --- a/packages/client/src/scripts/theme-editor.ts +++ b/packages/client/src/scripts/theme-editor.ts @@ -54,7 +54,7 @@ export const toThemeString = (value: Color | Func | RefProp | RefConst | Css) => export const convertToMisskeyTheme = (vm: ThemeViewModel, name: string, desc: string, author: string, base: 'dark' | 'light'): Theme => { const props = { } as { [key: string]: string }; - for (const [ key, value ] of vm) { + for (const [key, value] of vm) { if (value === null) continue; props[key] = toThemeString(value); } @@ -68,13 +68,13 @@ export const convertToMisskeyTheme = (vm: ThemeViewModel, name: string, desc: st export const convertToViewModel = (theme: Theme): ThemeViewModel => { const vm: ThemeViewModel = []; // プãƒãƒ‘ティã®ç™»éŒ² - vm.push(...themeProps.map(key => [ key, fromThemeString(theme.props[key])] as [ string, ThemeValue ])); + vm.push(...themeProps.map(key => [key, fromThemeString(theme.props[key])] as [ string, ThemeValue ])); // 定数ã®ç™»éŒ² const consts = Object .keys(theme.props) .filter(k => k.startsWith('$')) - .map(k => [ k, fromThemeString(theme.props[k]) ] as [ string, ThemeValue ]); + .map(k => [k, fromThemeString(theme.props[k])] as [ string, ThemeValue ]); vm.push(...consts); return vm; diff --git a/packages/client/src/ui/deck/column.vue b/packages/client/src/ui/deck/column.vue index 7b30ffad457bc7a759a1b8f9d4ae3810f7ab2d52..d16c23d100701e9b006867da45090b51596829ee 100644 --- a/packages/client/src/ui/deck/column.vue +++ b/packages/client/src/ui/deck/column.vue @@ -33,7 +33,7 @@ <script lang="ts" setup> import { onBeforeUnmount, onMounted, provide, Ref, watch } from 'vue'; -import { updateColumn, swapLeftColumn, swapRightColumn, swapUpColumn, swapDownColumn, stackLeftColumn, popRightColumn, removeColumn, swapColumn, Column , deckStore } from './deck-store'; +import { updateColumn, swapLeftColumn, swapRightColumn, swapUpColumn, swapDownColumn, stackLeftColumn, popRightColumn, removeColumn, swapColumn, Column, deckStore } from './deck-store'; import * as os from '@/os'; import { i18n } from '@/i18n'; import { MenuItem } from '@/types/menu'; diff --git a/packages/client/src/ui/deck/notifications-column.vue b/packages/client/src/ui/deck/notifications-column.vue index b02118ee569b066b9dfb0845b9663d269012a91a..e77b849ef4f8c8e35605eba2fe116750d95691ed 100644 --- a/packages/client/src/ui/deck/notifications-column.vue +++ b/packages/client/src/ui/deck/notifications-column.vue @@ -9,7 +9,7 @@ <script lang="ts" setup> import { defineAsyncComponent } from 'vue'; import XColumn from './column.vue'; -import { updateColumn , Column } from './deck-store'; +import { updateColumn, Column } from './deck-store'; import XNotifications from '@/components/MkNotifications.vue'; import * as os from '@/os'; import { i18n } from '@/i18n'; diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts index 7c95e8e41f0421c0fef239675c793183a5752a57..cbc86d1d7e03bff22d9f9848c564d87e6e6ec4d4 100644 --- a/packages/sw/src/scripts/create-notification.ts +++ b/packages/sw/src/scripts/create-notification.ts @@ -1,6 +1,9 @@ /* * 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'; @@ -40,7 +43,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data */ case 'notification': switch (data.body.type) { - case 'follow': + case 'follow': { // users/showã®åž‹å®šç¾©ã‚’swos.apiã¸å½“ã¦ã¯ã‚ã‚‹ã®ãŒå›°é›£ãªã®ã§apiFetch.requestを直接使用 const account = await getAccountFromId(data.userId); if (!account) return null; @@ -57,6 +60,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data } ], }]; + } case 'mention': return [t('_notification.youGotMention', { name: getUserName(data.body.user) }), { @@ -120,7 +124,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data ], }]; - case 'reaction': + case 'reaction': { let reaction = data.body.reaction; let badge: string | undefined; @@ -150,7 +154,6 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data badge = `/twemoji-badge/${char2fileName(reaction)}.png`; } - if (badge ? await fetch(badge).then(res => res.status !== 200).catch(() => true) : true) { badge = iconUrl('plus'); } @@ -167,6 +170,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data } ], }]; + } case 'pollVote': return [t('_notification.youGotPoll', { name: getUserName(data.body.user) }), { diff --git a/packages/sw/src/scripts/lang.ts b/packages/sw/src/scripts/lang.ts index 2d05404ef91d168d3f7bde38fbeba918fbfb6385..39bd333abaf4bef2acb4b18ed0d66aadc083f169 100644 --- a/packages/sw/src/scripts/lang.ts +++ b/packages/sw/src/scripts/lang.ts @@ -1,8 +1,6 @@ /* * Language manager for SW */ -declare var self: ServiceWorkerGlobalScope; - import { get, set } from 'idb-keyval'; import { I18n } from '@/scripts/i18n'; diff --git a/packages/sw/src/scripts/notification-read.ts b/packages/sw/src/scripts/notification-read.ts index 5c1de89088839cdc5b6a56a923e19445fede572c..5ad748b849e93f24a69c21a65c10173dcc6852b2 100644 --- a/packages/sw/src/scripts/notification-read.ts +++ b/packages/sw/src/scripts/notification-read.ts @@ -1,5 +1,3 @@ -declare var self: ServiceWorkerGlobalScope; - import { get } from 'idb-keyval'; import { pushNotificationDataMap } from '@/types'; import { api } from '@/scripts/operations'; diff --git a/packages/sw/src/scripts/operations.ts b/packages/sw/src/scripts/operations.ts index 02cf0d96cf05efe72d7c74d88598b8be61750633..dc24315aea7c9c1e7713cbb424ef65d8d5842b05 100644 --- a/packages/sw/src/scripts/operations.ts +++ b/packages/sw/src/scripts/operations.ts @@ -2,6 +2,9 @@ * 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'; diff --git a/packages/sw/src/scripts/url.ts b/packages/sw/src/scripts/url.ts index c7f2b7c1e745df394478689727a198a7ae093516..1266bfedfd3c2a4e4a8ff12298719e49d061e241 100644 --- a/packages/sw/src/scripts/url.ts +++ b/packages/sw/src/scripts/url.ts @@ -1,4 +1,4 @@ -export function query(obj: {}): string { +export function query(obj: object): string { const params = Object.entries(obj) .filter(([, v]) => Array.isArray(v) ? v.length : v !== undefined) .reduce((a, [k, v]) => (a[k] = v, a), {} as Record<string, any>); diff --git a/packages/sw/src/sw.ts b/packages/sw/src/sw.ts index 92391f1fb8dd8a793b88d973c9b5b62a15313252..3d2413ab2e33f4ff8aa05f656707e85ada3dcd19 100644 --- a/packages/sw/src/sw.ts +++ b/packages/sw/src/sw.ts @@ -1,3 +1,5 @@ +// 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'; @@ -176,7 +178,6 @@ self.addEventListener('notificationclick', <K extends keyof pushNotificationData } notification.close(); - })()); });