diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index 4fd201fa49..8883536235 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -1,11 +1,11 @@ -import type { entities } from "firefish-js"; -import { defineAsyncComponent } from "vue"; -import { i18n } from "./i18n"; import { apiUrl } from "@/config"; import { me } from "@/me"; import { alert, api, popup, popupMenu, waiting } from "@/os"; import { del, get, set } from "@/scripts/idb-proxy"; import { reloadChannel, unisonReload } from "@/scripts/unison-reload"; +import type { entities } from "firefish-js"; +import { defineAsyncComponent } from "vue"; +import { i18n } from "./i18n"; // TODO: 他のタブと永続化されたstateを同期 diff --git a/packages/client/src/components/MkActiveUsersHeatmap.vue b/packages/client/src/components/MkActiveUsersHeatmap.vue index 12cb6b9ba0..58eb42f5a6 100644 --- a/packages/client/src/components/MkActiveUsersHeatmap.vue +++ b/packages/client/src/components/MkActiveUsersHeatmap.vue @@ -179,8 +179,7 @@ async function renderActiveUsersChart() { enabled: false, callbacks: { title(context) { - const v = - context[0].dataset.data[context[0].dataIndex]; + const v = context[0].dataset.data[context[0].dataIndex]; return v.d; }, label(context) { diff --git a/packages/client/src/components/MkDrive.file.vue b/packages/client/src/components/MkDrive.file.vue index 53847bfd40..b8f02d1769 100644 --- a/packages/client/src/components/MkDrive.file.vue +++ b/packages/client/src/components/MkDrive.file.vue @@ -83,9 +83,7 @@ function getMenu() { text: props.file.isSensitive ? i18n.ts.unmarkAsSensitive : i18n.ts.markAsSensitive, - icon: props.file.isSensitive - ? "ph-eye ph-lg" - : "ph-eye-slash ph-lg", + icon: props.file.isSensitive ? "ph-eye ph-lg" : "ph-eye-slash ph-lg", action: toggleSensitive, }, { @@ -129,9 +127,7 @@ function onClick(ev: MouseEvent) { } else { os.popupMenu( getMenu(), - (ev.currentTarget ?? ev.target ?? undefined) as - | HTMLElement - | undefined, + (ev.currentTarget ?? ev.target ?? undefined) as HTMLElement | undefined, ); } } diff --git a/packages/client/src/components/MkDrive.vue b/packages/client/src/components/MkDrive.vue index be8e0aade5..0273e0b40e 100644 --- a/packages/client/src/components/MkDrive.vue +++ b/packages/client/src/components/MkDrive.vue @@ -451,9 +451,7 @@ function chooseFile(file: entities.DriveFile) { const isAlreadySelected = selectedFiles.value.some((f) => f.id === file.id); if (props.multiple) { if (isAlreadySelected) { - selectedFiles.value = selectedFiles.value.filter( - (f) => f.id !== file.id, - ); + selectedFiles.value = selectedFiles.value.filter((f) => f.id !== file.id); } else { selectedFiles.value.push(file); } diff --git a/packages/client/src/components/MkEmojiPicker.vue b/packages/client/src/components/MkEmojiPicker.vue index 4ee83a2871..36aeb83d52 100644 --- a/packages/client/src/components/MkEmojiPicker.vue +++ b/packages/client/src/components/MkEmojiPicker.vue @@ -284,9 +284,7 @@ watch(q, () => { keywords.every( (keyword) => emoji.name.includes(keyword) || - emoji.aliases.some((alias) => - alias.includes(keyword), - ), + emoji.aliases.some((alias) => alias.includes(keyword)), ) ) { matches.add(emoji); @@ -356,9 +354,7 @@ watch(q, () => { keywords.every( (keyword) => emoji.slug.includes(keyword) || - emoji.keywords?.some((alias) => - alias.includes(keyword), - ), + emoji.keywords?.some((alias) => alias.includes(keyword)), ) ) { matches.add(emoji); @@ -375,9 +371,7 @@ watch(q, () => { if (matches.size >= max) return matches; for (const emoji of emojis) { - if ( - emoji.keywords?.some((keyword) => keyword.startsWith(newQ)) - ) { + if (emoji.keywords?.some((keyword) => keyword.startsWith(newQ))) { matches.add(emoji); if (matches.size >= max) break; } @@ -428,8 +422,7 @@ function getKey( function chosen(emoji: any, ev?: MouseEvent) { const el = - ev && - ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined); + ev && ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined); if (el) { const rect = el.getBoundingClientRect(); const x = rect.left + el.offsetWidth / 2; diff --git a/packages/client/src/components/MkFolder.vue b/packages/client/src/components/MkFolder.vue index b87df0d8da..8f545406d1 100644 --- a/packages/client/src/components/MkFolder.vue +++ b/packages/client/src/components/MkFolder.vue @@ -58,9 +58,7 @@ export default defineComponent({ showBody: this.persistKey && localStorage.getItem(localStoragePrefix + this.persistKey) - ? localStorage.getItem( - localStoragePrefix + this.persistKey, - ) === "t" + ? localStorage.getItem(localStoragePrefix + this.persistKey) === "t" : this.expanded, animation: defaultStore.state.animation, }; diff --git a/packages/client/src/components/MkFollowButton.vue b/packages/client/src/components/MkFollowButton.vue index e71463bbe1..da621518ab 100644 --- a/packages/client/src/components/MkFollowButton.vue +++ b/packages/client/src/components/MkFollowButton.vue @@ -112,8 +112,7 @@ if (props.user.isFollowing == null) { function onFollowChange(user: entities.UserDetailed) { if (user.id === props.user.id) { isFollowing.value = user.isFollowing; - hasPendingFollowRequestFromYou.value = - user.hasPendingFollowRequestFromYou; + hasPendingFollowRequestFromYou.value = user.hasPendingFollowRequestFromYou; } } @@ -172,10 +171,7 @@ async function onClick() { } function menu(ev) { - os.popupMenu( - getUserMenu(props.user, router), - ev.currentTarget ?? ev.target, - ); + os.popupMenu(getUserMenu(props.user, router), ev.currentTarget ?? ev.target); } onMounted(() => { diff --git a/packages/client/src/components/MkInstanceTicker.vue b/packages/client/src/components/MkInstanceTicker.vue index da46185218..46da872c2c 100644 --- a/packages/client/src/components/MkInstanceTicker.vue +++ b/packages/client/src/components/MkInstanceTicker.vue @@ -38,9 +38,7 @@ const instance = props.instance ?? { faviconUrl: Instance.faviconUrl || Instance.iconUrl || "/favicon.ico", name: instanceName, themeColor: ( - document.querySelector( - 'meta[name="theme-color-orig"]', - ) as HTMLMetaElement + document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement )?.content, softwareName: Instance.softwareName ?? "Firefish", softwareVersion: version, diff --git a/packages/client/src/components/MkLink.vue b/packages/client/src/components/MkLink.vue index b49bac86bf..4add7c32da 100644 --- a/packages/client/src/components/MkLink.vue +++ b/packages/client/src/components/MkLink.vue @@ -40,9 +40,7 @@ const el = ref(); useTooltip(el, (showing) => { os.popup( - defineAsyncComponent( - () => import("@/components/MkUrlPreviewPopup.vue"), - ), + defineAsyncComponent(() => import("@/components/MkUrlPreviewPopup.vue")), { showing, url: props.url, diff --git a/packages/client/src/components/MkMarquee.vue b/packages/client/src/components/MkMarquee.vue index 415e84dc33..18db75f610 100644 --- a/packages/client/src/components/MkMarquee.vue +++ b/packages/client/src/components/MkMarquee.vue @@ -58,9 +58,7 @@ export default { { class: $style.text, style: { - animationDirection: reverse - ? "reverse" - : undefined, + animationDirection: reverse ? "reverse" : undefined, }, }, $slots.default(), diff --git a/packages/client/src/components/MkMedia.vue b/packages/client/src/components/MkMedia.vue index 0eaa7609ed..ef8912f138 100644 --- a/packages/client/src/components/MkMedia.vue +++ b/packages/client/src/components/MkMedia.vue @@ -113,7 +113,7 @@ const url = props.raw || defaultStore.state.loadRawImages ? props.media.url : defaultStore.state.disableShowingAnimatedImages && - props.media.type.startsWith("image") + props.media.type.startsWith("image") ? getStaticImageUrl(props.media.thumbnailUrl) : props.media.thumbnailUrl; @@ -150,8 +150,7 @@ watch( hide.value = defaultStore.state.nsfw === "force" ? true - : props.media.isSensitive && - defaultStore.state.nsfw !== "ignore"; + : props.media.isSensitive && defaultStore.state.nsfw !== "ignore"; }, { deep: true, diff --git a/packages/client/src/components/MkMediaBanner.vue b/packages/client/src/components/MkMediaBanner.vue index 2a6af0ba0c..d703fde470 100644 --- a/packages/client/src/components/MkMediaBanner.vue +++ b/packages/client/src/components/MkMediaBanner.vue @@ -75,8 +75,7 @@ const audioEl = ref(); const hide = ref(true); function volumechange() { - if (audioEl.value) - ColdDeviceStorage.set("mediaVolume", audioEl.value.volume); + if (audioEl.value) ColdDeviceStorage.set("mediaVolume", audioEl.value.volume); } onMounted(() => { diff --git a/packages/client/src/components/MkMediaCaption.vue b/packages/client/src/components/MkMediaCaption.vue index b44fa0d520..88bf24631b 100644 --- a/packages/client/src/components/MkMediaCaption.vue +++ b/packages/client/src/components/MkMediaCaption.vue @@ -183,12 +183,8 @@ export default defineComponent({ }, caption() { - const img = document.getElementById( - "imgtocaption", - ) as HTMLImageElement; - const ta = document.getElementById( - "captioninput", - ) as HTMLTextAreaElement; + const img = document.getElementById("imgtocaption") as HTMLImageElement; + const ta = document.getElementById("captioninput") as HTMLTextAreaElement; os.api("drive/files/caption-image", { url: img.src, }).then((text) => { diff --git a/packages/client/src/components/MkModPlayer.vue b/packages/client/src/components/MkModPlayer.vue index a744c37797..74c598ba94 100644 --- a/packages/client/src/components/MkModPlayer.vue +++ b/packages/client/src/components/MkModPlayer.vue @@ -311,11 +311,7 @@ function getRow(pattern: number, rowOffset: number) { const ops: string[] = []; for (let channel = 0; channel < nbChannels.value; channel++) { - const part = player.value.getPatternRowChannel( - pattern, - rowOffset, - channel, - ); + const part = player.value.getPatternRowChannel(pattern, rowOffset, channel); notes.push(part.substring(0, 3)); insts.push(part.substring(4, 6)); diff --git a/packages/client/src/components/MkModal.vue b/packages/client/src/components/MkModal.vue index 8fa9b8f2c9..91b998e31b 100644 --- a/packages/client/src/components/MkModal.vue +++ b/packages/client/src/components/MkModal.vue @@ -286,8 +286,7 @@ const align = () => { left = window.innerWidth - width + window.scrollX - 1; } - const underSpace = - window.innerHeight - MARGIN - (top - window.pageYOffset); + const underSpace = window.innerHeight - MARGIN - (top - window.pageYOffset); const upperSpace = srcRect.top - MARGIN; // 画面から縦にはみ出る場合 @@ -300,12 +299,7 @@ const align = () => { top = window.scrollY + (upperSpace + MARGIN - height); } } else { - top = - window.innerHeight - - MARGIN - - height + - window.pageYOffset - - 1; + top = window.innerHeight - MARGIN - height + window.pageYOffset - 1; } } else { maxHeight.value = underSpace; diff --git a/packages/client/src/components/MkNote.vue b/packages/client/src/components/MkNote.vue index c06069a60b..bcb978b0b7 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -403,8 +403,7 @@ async function translate() { lang != null && translateLang !== lang && (!translation.value || - translation.value.sourceLang.toLowerCase() === - translateLang.slice(0, 2)) + translation.value.sourceLang.toLowerCase() === translateLang.slice(0, 2)) ) translation.value = await translate_(appearNote.value.id, lang); translating.value = false; @@ -504,10 +503,7 @@ function onContextmenu(ev: MouseEvent): void { icon: `${icon("ph-arrows-out-simple")}`, text: i18n.ts.showInPage, action: () => { - router.push( - notePage(appearNote.value), - "forcePage", - ); + router.push(notePage(appearNote.value), "forcePage"); }, } : undefined, @@ -531,10 +527,7 @@ function onContextmenu(ev: MouseEvent): void { type: "a", icon: `${icon("ph-arrow-square-up-right")}`, text: i18n.ts.showOnRemote, - href: - appearNote.value.url ?? - appearNote.value.uri ?? - "", + href: appearNote.value.url ?? appearNote.value.uri ?? "", target: "_blank", } : undefined, diff --git a/packages/client/src/components/MkNoteHeader.vue b/packages/client/src/components/MkNoteHeader.vue index 7ada54a0e2..80ee12d9e6 100644 --- a/packages/client/src/components/MkNoteHeader.vue +++ b/packages/client/src/components/MkNoteHeader.vue @@ -70,8 +70,7 @@ const note = ref(props.note); const showTicker = defaultStore.state.instanceTicker === "always" || - (defaultStore.state.instanceTicker === "remote" && - note.value.user.instance); + (defaultStore.state.instanceTicker === "remote" && note.value.user.instance); function openServerInfo() { if (!props.canOpenServerInfo || !defaultStore.state.openServerInfo) return; diff --git a/packages/client/src/components/MkNoteSub.vue b/packages/client/src/components/MkNoteSub.vue index 07192497d3..ba91221b87 100644 --- a/packages/client/src/components/MkNoteSub.vue +++ b/packages/client/src/components/MkNoteSub.vue @@ -280,8 +280,7 @@ const replies: entities.Note[] = props.conversation ?.filter( (item) => - item.replyId === props.note.id || - item.renoteId === props.note.id, + item.replyId === props.note.id || item.renoteId === props.note.id, ) .reverse() ?? []; const enableEmojiReactions = defaultStore.state.enableEmojiReactions; @@ -319,8 +318,7 @@ async function translate() { lang != null && translateLang !== lang && (!translation.value || - translation.value.sourceLang.toLowerCase() === - translateLang.slice(0, 2)) + translation.value.sourceLang.toLowerCase() === translateLang.slice(0, 2)) ) translation.value = await translate_(appearNote.value.id, lang); translating.value = false; @@ -421,10 +419,7 @@ function onContextmenu(ev: MouseEvent): void { icon: `${icon("ph-arrows-out-simple")}`, text: i18n.ts.showInPage, action: () => { - router.push( - notePage(appearNote.value), - "forcePage", - ); + router.push(notePage(appearNote.value), "forcePage"); }, } : undefined, diff --git a/packages/client/src/components/MkNotificationSettingWindow.vue b/packages/client/src/components/MkNotificationSettingWindow.vue index df5d162466..fac382f68c 100644 --- a/packages/client/src/components/MkNotificationSettingWindow.vue +++ b/packages/client/src/components/MkNotificationSettingWindow.vue @@ -84,9 +84,7 @@ function ok() { } else { emit("done", { includingTypes: ( - Object.keys( - typesMap.value, - ) as (typeof notificationTypes)[number][] + Object.keys(typesMap.value) as (typeof notificationTypes)[number][] ).filter((type) => typesMap.value[type]), }); } diff --git a/packages/client/src/components/MkNotifications.vue b/packages/client/src/components/MkNotifications.vue index 5fff078fb1..abb28d91b8 100644 --- a/packages/client/src/components/MkNotifications.vue +++ b/packages/client/src/components/MkNotifications.vue @@ -71,9 +71,7 @@ const pagination: Paging = { limit: 10, params: computed(() => ({ includeTypes: props.includeTypes ?? undefined, - excludeTypes: props.includeTypes - ? undefined - : me.mutingNotificationTypes, + excludeTypes: props.includeTypes ? undefined : me.mutingNotificationTypes, unreadOnly: props.unreadOnly, })), }; @@ -114,20 +112,12 @@ onMounted(() => { connection.on("readNotifications", (notificationIds) => { if (pagingComponent.value) { for (let i = 0; i < pagingComponent.value.queue.length; i++) { - if ( - notificationIds.includes(pagingComponent.value.queue[i].id) - ) { + if (notificationIds.includes(pagingComponent.value.queue[i].id)) { pagingComponent.value.queue[i].isRead = true; } } - for ( - let i = 0; - i < (pagingComponent.value.items || []).length; - i++ - ) { - if ( - notificationIds.includes(pagingComponent.value.items[i].id) - ) { + for (let i = 0; i < (pagingComponent.value.items || []).length; i++) { + if (notificationIds.includes(pagingComponent.value.items[i].id)) { pagingComponent.value.items[i].isRead = true; } } diff --git a/packages/client/src/components/MkPagination.vue b/packages/client/src/components/MkPagination.vue index 6f116d0fa5..7bd93dc801 100644 --- a/packages/client/src/components/MkPagination.vue +++ b/packages/client/src/components/MkPagination.vue @@ -165,14 +165,10 @@ const init = async (): Promise => { res.length > (props.pagination.limit || 10) ) { res.pop(); - items.value = props.pagination.reversed - ? [...res].reverse() - : res; + items.value = props.pagination.reversed ? [...res].reverse() : res; more.value = true; } else { - items.value = props.pagination.reversed - ? [...res].reverse() - : res; + items.value = props.pagination.reversed ? [...res].reverse() : res; more.value = false; } offset.value = res.length; @@ -382,8 +378,7 @@ const prepend = (item: Item): void => { const isTop = isBackTop.value || - (document.body.contains(rootEl.value) && - isTopVisible(rootEl.value)); + (document.body.contains(rootEl.value) && isTopVisible(rootEl.value)); if (isTop) { // Prepend the item diff --git a/packages/client/src/components/MkPoll.vue b/packages/client/src/components/MkPoll.vue index 4a3b79f471..ddf2a2d4b1 100644 --- a/packages/client/src/components/MkPoll.vue +++ b/packages/client/src/components/MkPoll.vue @@ -74,8 +74,7 @@ const closed = computed(() => remaining.value === 0); const isLocal = computed(() => !props.note.uri); const isVoted = computed( () => - !props.note.poll.multiple && - props.note.poll.choices.some((c) => c.isVoted), + !props.note.poll.multiple && props.note.poll.choices.some((c) => c.isVoted), ); const timer = computed(() => i18n.t( @@ -101,10 +100,8 @@ const showResult = ref(props.readOnly || isVoted.value); if (props.note.poll.expiresAt) { const tick = () => { remaining.value = Math.floor( - Math.max( - new Date(props.note.poll.expiresAt).getTime() - Date.now(), - 0, - ) / 1000, + Math.max(new Date(props.note.poll.expiresAt).getTime() - Date.now(), 0) / + 1000, ); if (remaining.value === 0) { showResult.value = true; diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index 2f19ec2606..5286e50ad7 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -527,9 +527,7 @@ if ( (props.reply.user.host != null && props.reply.user.host !== host)) ) { text.value = `@${props.reply.user.username}${ - props.reply.user.host != null - ? "@" + toASCII(props.reply.user.host) - : "" + props.reply.user.host != null ? "@" + toASCII(props.reply.user.host) : "" } `; } @@ -589,11 +587,9 @@ if ( } if (props.reply.userId !== me.id) { - os.api("users/show", { userId: props.reply.userId }).then( - (user) => { - pushVisibleUser(user); - }, - ); + os.api("users/show", { userId: props.reply.userId }).then((user) => { + pushVisibleUser(user); + }); } } } @@ -732,9 +728,7 @@ function setVisibility() { } os.popup( - defineAsyncComponent( - () => import("@/components/MkVisibilityPicker.vue"), - ), + defineAsyncComponent(() => import("@/components/MkVisibilityPicker.vue")), { currentVisibility: visibility.value, currentLocalOnly: localOnly.value, @@ -834,8 +828,7 @@ function setLanguage() { for (const lang of langs) { if (lang === language.value) continue; - if (defaultStore.state.recentlyUsedPostLanguages.includes(lang)) - continue; + if (defaultStore.state.recentlyUsedPostLanguages.includes(lang)) continue; actions.push({ text: langmap[lang].nativeName, danger: false, @@ -1072,8 +1065,7 @@ async function post() { let postData = { editId: props.editId ? props.editId : undefined, text: processedText === "" ? undefined : processedText, - fileIds: - files.value.length > 0 ? files.value.map((f) => f.id) : undefined, + fileIds: files.value.length > 0 ? files.value.map((f) => f.id) : undefined, replyId: props.reply ? props.reply.id : undefined, renoteId: props.renote ? props.renote.id @@ -1085,8 +1077,7 @@ async function post() { cw: useCw.value ? cw.value || "" : undefined, lang: language.value ? language.value : undefined, localOnly: localOnly.value, - visibility: - visibility.value === "private" ? "specified" : visibility.value, + visibility: visibility.value === "private" ? "specified" : visibility.value, visibleUserIds: visibility.value === "private" ? [] @@ -1101,9 +1092,7 @@ async function post() { .split(" ") .map((x) => (x.startsWith("#") ? x : "#" + x)) .join(" "); - postData.text = postData.text - ? `${postData.text} ${hashtags_}` - : hashtags_; + postData.text = postData.text ? `${postData.text} ${hashtags_}` : hashtags_; } // plugin @@ -1117,9 +1106,7 @@ async function post() { if (postAccount.value) { const storedAccounts = await getAccounts(); - token = storedAccounts.find( - (x) => x.id === postAccount.value.id, - )?.token; + token = storedAccounts.find((x) => x.id === postAccount.value.id)?.token; } posting.value = true; @@ -1165,14 +1152,9 @@ async function post() { "recentlyUsedPostLanguages", [language.value] .concat( - defaultStore.state.recentlyUsedPostLanguages.filter( - (lang) => { - return ( - lang !== language.value && - languages.includes(lang) - ); - }, - ), + defaultStore.state.recentlyUsedPostLanguages.filter((lang) => { + return lang !== language.value && languages.includes(lang); + }), ) .slice(0, maxLength), ); @@ -1268,9 +1250,7 @@ onMounted(() => { visibility.value = draft.data.visibility; localOnly.value = draft.data.localOnly; language.value = draft.data.lang; - files.value = (draft.data.files || []).filter( - (draftFile) => draftFile, - ); + files.value = (draft.data.files || []).filter((draftFile) => draftFile); if (draft.data.poll) { poll.value = draft.data.poll; } diff --git a/packages/client/src/components/MkPostFormAttaches.vue b/packages/client/src/components/MkPostFormAttaches.vue index d7910e75bd..52b0d552f7 100644 --- a/packages/client/src/components/MkPostFormAttaches.vue +++ b/packages/client/src/components/MkPostFormAttaches.vue @@ -107,8 +107,7 @@ async function describe(file) { { done: (result) => { if (!result || result.canceled) return; - const comment = - result.result.length === 0 ? null : result.result; + const comment = result.result.length === 0 ? null : result.result; os.api("drive/files/update", { fileId: file.id, comment, diff --git a/packages/client/src/components/MkPullToRefresh.vue b/packages/client/src/components/MkPullToRefresh.vue index c7b09a91f1..b12ecdd9ec 100644 --- a/packages/client/src/components/MkPullToRefresh.vue +++ b/packages/client/src/components/MkPullToRefresh.vue @@ -102,8 +102,7 @@ function moveBySystem(to: number): Promise { return; } const nextHeight = - initialHeight - - (overHeight / RELEASE_TRANSITION_DURATION) * time; + initialHeight - (overHeight / RELEASE_TRANSITION_DURATION) * time; if (pullDistance.value < nextHeight) return; pullDistance.value = nextHeight; }, 1); diff --git a/packages/client/src/components/MkPushNotificationAllowButton.vue b/packages/client/src/components/MkPushNotificationAllowButton.vue index 85232bac7e..788c9a3264 100644 --- a/packages/client/src/components/MkPushNotificationAllowButton.vue +++ b/packages/client/src/components/MkPushNotificationAllowButton.vue @@ -94,17 +94,14 @@ const pushRegistrationInServer = ref< >(); function subscribe() { - if (!registration.value || !supported.value || !instance.swPublickey) - return; + if (!registration.value || !supported.value || !instance.swPublickey) return; // SEE: https://developer.mozilla.org/en-US/docs/Web/API/PushManager/subscribe#Parameters return promiseDialog( registration.value.pushManager .subscribe({ userVisibleOnly: true, - applicationServerKey: urlBase64ToUint8Array( - instance.swPublickey, - ), + applicationServerKey: urlBase64ToUint8Array(instance.swPublickey), }) .then( async (subscription) => { @@ -121,9 +118,7 @@ function subscribe() { // When subscribe failed // 通知が許可されていなかったとき if (err?.name === "NotAllowedError") { - console.info( - "User denied the notification permission request.", - ); + console.info("User denied the notification permission request."); return; } @@ -171,9 +166,7 @@ function encode(buffer: ArrayBuffer | null) { */ function urlBase64ToUint8Array(base64String: string): Uint8Array { const padding = "=".repeat((4 - (base64String.length % 4)) % 4); - const base64 = (base64String + padding) - .replace(/-/g, "+") - .replace(/_/g, "/"); + const base64 = (base64String + padding).replace(/-/g, "+").replace(/_/g, "/"); const rawData = window.atob(base64); const outputArray = new Uint8Array(rawData.length); diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index 8efe5bbaed..72a0559a0e 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -102,10 +102,7 @@ const renote = (viaKeyboard = false, ev?: MouseEvent) => { hasRenotedBefore.value = true; const el = ev && - ((ev.currentTarget ?? ev.target) as - | HTMLElement - | null - | undefined); + ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined); if (el) { const rect = el.getBoundingClientRect(); const x = rect.left + el.offsetWidth / 2; @@ -129,10 +126,7 @@ const renote = (viaKeyboard = false, ev?: MouseEvent) => { hasRenotedBefore.value = true; const el = ev && - ((ev.currentTarget ?? ev.target) as - | HTMLElement - | null - | undefined); + ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined); if (el) { const rect = el.getBoundingClientRect(); const x = rect.left + el.offsetWidth / 2; @@ -157,10 +151,7 @@ const renote = (viaKeyboard = false, ev?: MouseEvent) => { hasRenotedBefore.value = true; const el = ev && - ((ev.currentTarget ?? ev.target) as - | HTMLElement - | null - | undefined); + ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined); if (el) { const rect = el.getBoundingClientRect(); const x = rect.left + el.offsetWidth / 2; @@ -182,10 +173,7 @@ const renote = (viaKeyboard = false, ev?: MouseEvent) => { hasRenotedBefore.value = true; const el = ev && - ((ev.currentTarget ?? ev.target) as - | HTMLElement - | null - | undefined); + ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined); if (el) { const rect = el.getBoundingClientRect(); const x = rect.left + el.offsetWidth / 2; @@ -221,10 +209,7 @@ const renote = (viaKeyboard = false, ev?: MouseEvent) => { hasRenotedBefore.value = true; const el = ev && - ((ev.currentTarget ?? ev.target) as - | HTMLElement - | null - | undefined); + ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined); if (el) { const rect = el.getBoundingClientRect(); const x = rect.left + el.offsetWidth / 2; diff --git a/packages/client/src/components/MkSearchBox.vue b/packages/client/src/components/MkSearchBox.vue index bf5a914b70..7c732ca2c6 100644 --- a/packages/client/src/components/MkSearchBox.vue +++ b/packages/client/src/components/MkSearchBox.vue @@ -198,9 +198,7 @@ function openDescription(kind: "words" | "users" | "range"): void { }; popup( - defineAsyncComponent( - () => import("@/components/MkSimpleTextWindow.vue"), - ), + defineAsyncComponent(() => import("@/components/MkSimpleTextWindow.vue")), { title: i18n.ts.help, description: descriptions[kind], diff --git a/packages/client/src/components/MkSignin.vue b/packages/client/src/components/MkSignin.vue index 53a593fb13..f5c5f0ee4d 100644 --- a/packages/client/src/components/MkSignin.vue +++ b/packages/client/src/components/MkSignin.vue @@ -205,13 +205,11 @@ function queryKey() { .get({ publicKey: { challenge: byteify(challengeData.value.challenge, "base64"), - allowCredentials: challengeData.value.securityKeys.map( - (key) => ({ - id: byteify(key.id, "hex"), - type: "public-key", - transports: ["usb", "nfc", "ble", "internal"], - }), - ), + allowCredentials: challengeData.value.securityKeys.map((key) => ({ + id: byteify(key.id, "hex"), + type: "public-key", + transports: ["usb", "nfc", "ble", "internal"], + })), timeout: 60 * 1000, }, }) @@ -226,9 +224,7 @@ function queryKey() { username: username.value, password: password.value, signature: hexify(credential.response.signature), - authenticatorData: hexify( - credential.response.authenticatorData, - ), + authenticatorData: hexify(credential.response.authenticatorData), clientDataJSON: hexify(credential.response.clientDataJSON), credentialId: credential.id, challengeId: challengeData.value.challengeId, @@ -277,9 +273,7 @@ function onSubmit() { "hcaptcha-response": hCaptchaResponse.value, "g-recaptcha-response": reCaptchaResponse.value, token: - user.value && user.value.twoFactorEnabled - ? token.value - : undefined, + user.value && user.value.twoFactorEnabled ? token.value : undefined, }) .then((res) => { emit("login", res); diff --git a/packages/client/src/components/MkSparkle.vue b/packages/client/src/components/MkSparkle.vue index f97a9d686d..bb3ec49bc4 100644 --- a/packages/client/src/components/MkSparkle.vue +++ b/packages/client/src/components/MkSparkle.vue @@ -104,9 +104,7 @@ onMounted(() => { }; particles.value.push(particle); window.setTimeout(() => { - particles.value = particles.value.filter( - (x) => x.id !== particle.id, - ); + particles.value = particles.value.filter((x) => x.id !== particle.id); }, particle.dur - 100); window.setTimeout( diff --git a/packages/client/src/components/MkStarButton.vue b/packages/client/src/components/MkStarButton.vue index f32587a237..2ee4514482 100644 --- a/packages/client/src/components/MkStarButton.vue +++ b/packages/client/src/components/MkStarButton.vue @@ -60,13 +60,10 @@ function star(ev?: MouseEvent): void { os.api("notes/reactions/create", { noteId: props.note.id, reaction: - defaultStore.state.woozyMode === true - ? "🥴" - : instance.defaultReaction, + defaultStore.state.woozyMode === true ? "🥴" : instance.defaultReaction, }); const el = - ev && - ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined); + ev && ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined); if (el) { const rect = el.getBoundingClientRect(); const x = rect.left + el.offsetWidth / 2; diff --git a/packages/client/src/components/MkStarButtonNoEmoji.vue b/packages/client/src/components/MkStarButtonNoEmoji.vue index 2abadc9a98..dc441db3f2 100644 --- a/packages/client/src/components/MkStarButtonNoEmoji.vue +++ b/packages/client/src/components/MkStarButtonNoEmoji.vue @@ -66,8 +66,7 @@ function toggleStar(ev?: MouseEvent): void { reaction: instance.defaultReaction, }); const el = - ev && - ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined); + ev && ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined); if (el) { const rect = el.getBoundingClientRect(); const x = rect.left + el.offsetWidth / 2; diff --git a/packages/client/src/components/MkTab.vue b/packages/client/src/components/MkTab.vue index 8e3108ecb1..9f2cdde2b2 100644 --- a/packages/client/src/components/MkTab.vue +++ b/packages/client/src/components/MkTab.vue @@ -32,14 +32,9 @@ export default defineComponent({ role: "tab", key: option.key, "aria-selected": - this.modelValue === option.props?.value - ? "true" - : "false", + this.modelValue === option.props?.value ? "true" : "false", onClick: () => { - this.$emit( - "update:modelValue", - option.props?.value, - ); + this.$emit("update:modelValue", option.props?.value); }, }, option.children, diff --git a/packages/client/src/components/MkTagCloud.vue b/packages/client/src/components/MkTagCloud.vue index 3a40fbde6b..40dee3c576 100644 --- a/packages/client/src/components/MkTagCloud.vue +++ b/packages/client/src/components/MkTagCloud.vue @@ -25,18 +25,12 @@ const SAFE_FOR_HTML_ID = "abcdefghijklmnopqrstuvwxyz"; const computedStyle = getComputedStyle(document.documentElement); const idForCanvas = Array.from(Array(16)) .map( - () => - SAFE_FOR_HTML_ID[ - Math.floor(Math.random() * SAFE_FOR_HTML_ID.length) - ], + () => SAFE_FOR_HTML_ID[Math.floor(Math.random() * SAFE_FOR_HTML_ID.length)], ) .join(""); const idForTags = Array.from(Array(16)) .map( - () => - SAFE_FOR_HTML_ID[ - Math.floor(Math.random() * SAFE_FOR_HTML_ID.length) - ], + () => SAFE_FOR_HTML_ID[Math.floor(Math.random() * SAFE_FOR_HTML_ID.length)], ) .join(""); const available = ref(false); diff --git a/packages/client/src/components/MkWindow.vue b/packages/client/src/components/MkWindow.vue index 102ff24476..b28cc4b62b 100644 --- a/packages/client/src/components/MkWindow.vue +++ b/packages/client/src/components/MkWindow.vue @@ -203,9 +203,7 @@ function onContextmenu(ev: MouseEvent) { // 最前面へ移動 function top() { if (rootEl.value) { - rootEl.value.style.zIndex = os.claimZIndex( - props.front ? "middle" : "low", - ); + rootEl.value.style.zIndex = os.claimZIndex(props.front ? "middle" : "low"); } } @@ -310,13 +308,9 @@ function onHeaderMousedown(evt: MouseEvent) { // 動かした時 dragListen((me) => { const x = - me.touches && me.touches.length > 0 - ? me.touches[0].clientX - : me.clientX; + me.touches && me.touches.length > 0 ? me.touches[0].clientX : me.clientX; const y = - me.touches && me.touches.length > 0 - ? me.touches[0].clientY - : me.clientY; + me.touches && me.touches.length > 0 ? me.touches[0].clientY : me.clientY; move(x, y); }); diff --git a/packages/client/src/components/form/input.vue b/packages/client/src/components/form/input.vue index e54302ed92..80f972a184 100644 --- a/packages/client/src/components/form/input.vue +++ b/packages/client/src/components/form/input.vue @@ -146,14 +146,12 @@ useInterval( () => { if (prefixEl.value) { if (prefixEl.value.offsetWidth) { - inputEl.value.style.paddingLeft = - prefixEl.value.offsetWidth + "px"; + inputEl.value.style.paddingLeft = prefixEl.value.offsetWidth + "px"; } } if (suffixEl.value) { if (suffixEl.value.offsetWidth) { - inputEl.value.style.paddingRight = - suffixEl.value.offsetWidth + "px"; + inputEl.value.style.paddingRight = suffixEl.value.offsetWidth + "px"; } } }, diff --git a/packages/client/src/components/form/radios.vue b/packages/client/src/components/form/radios.vue index a46fecf136..bec632c861 100644 --- a/packages/client/src/components/form/radios.vue +++ b/packages/client/src/components/form/radios.vue @@ -60,8 +60,7 @@ export default defineComponent({ value: option.props?.value, disabled: option.props?.disabled, modelValue: this.value, - "onUpdate:modelValue": (value) => - (this.value = value), + "onUpdate:modelValue": (value) => (this.value = value), }, option.children, ), diff --git a/packages/client/src/components/form/select.vue b/packages/client/src/components/form/select.vue index 6ad9967bc1..3c7170d15d 100644 --- a/packages/client/src/components/form/select.vue +++ b/packages/client/src/components/form/select.vue @@ -120,14 +120,12 @@ useInterval( () => { if (prefixEl.value) { if (prefixEl.value.offsetWidth) { - inputEl.value.style.paddingLeft = - prefixEl.value.offsetWidth + "px"; + inputEl.value.style.paddingLeft = prefixEl.value.offsetWidth + "px"; } } if (suffixEl.value) { if (suffixEl.value.offsetWidth) { - inputEl.value.style.paddingRight = - suffixEl.value.offsetWidth + "px"; + inputEl.value.style.paddingRight = suffixEl.value.offsetWidth + "px"; } } }, diff --git a/packages/client/src/components/global/MkAd.vue b/packages/client/src/components/global/MkAd.vue index 1acd9eef51..cf139b616b 100644 --- a/packages/client/src/components/global/MkAd.vue +++ b/packages/client/src/components/global/MkAd.vue @@ -88,9 +88,7 @@ const choseAd = (): Ad | null => { return widgetAds; } else if (ads.length === 0) { if (lowPriorityAds.length !== 0) { - return lowPriorityAds[ - Math.floor(Math.random() * lowPriorityAds.length) - ]; + return lowPriorityAds[Math.floor(Math.random() * lowPriorityAds.length)]; } else { return null; } diff --git a/packages/client/src/components/global/MkUrl.vue b/packages/client/src/components/global/MkUrl.vue index 5a8c624534..4326837836 100644 --- a/packages/client/src/components/global/MkUrl.vue +++ b/packages/client/src/components/global/MkUrl.vue @@ -51,9 +51,7 @@ const el = ref(); useTooltip(el, (showing) => { os.popup( - defineAsyncComponent( - () => import("@/components/MkUrlPreviewPopup.vue"), - ), + defineAsyncComponent(() => import("@/components/MkUrlPreviewPopup.vue")), { showing, url: props.url, diff --git a/packages/client/src/components/page/page.note.vue b/packages/client/src/components/page/page.note.vue index f28e0b465f..19a4eafa68 100644 --- a/packages/client/src/components/page/page.note.vue +++ b/packages/client/src/components/page/page.note.vue @@ -36,11 +36,9 @@ export default defineComponent({ const note: Ref | null> = ref(null); onMounted(() => { - os.api("notes/show", { noteId: props.block.note }).then( - (result) => { - note.value = result; - }, - ); + os.api("notes/show", { noteId: props.block.note }).then((result) => { + note.value = result; + }); }); return { diff --git a/packages/client/src/components/page/page.post.vue b/packages/client/src/components/page/page.post.vue index f9806fa3b2..cab4b54837 100644 --- a/packages/client/src/components/page/page.post.vue +++ b/packages/client/src/components/page/page.post.vue @@ -63,10 +63,7 @@ export default defineComponent({ const formData = new FormData(); formData.append("file", blob); if (this.defaultStore.state.uploadFolder) { - formData.append( - "folderId", - this.defaultStore.state.uploadFolder, - ); + formData.append("folderId", this.defaultStore.state.uploadFolder); } fetch(apiUrl + "/drive/files/create", { @@ -87,9 +84,7 @@ export default defineComponent({ }, async post() { this.posting = true; - const file = this.block.attachCanvasImage - ? await this.upload() - : null; + const file = this.block.attachCanvasImage ? await this.upload() : null; os.apiWithDialog("notes/create", { text: this.text === "" ? null : this.text, fileIds: file ? [file.id] : undefined, diff --git a/packages/client/src/i18n.ts b/packages/client/src/i18n.ts index 6d352ba03e..5e92817c3f 100644 --- a/packages/client/src/i18n.ts +++ b/packages/client/src/i18n.ts @@ -1,5 +1,5 @@ -import { markRaw } from "vue"; import { locale } from "@/config"; +import { markRaw } from "vue"; class I18n> { public ts: T; diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index 17b44bb9f8..5b986d8647 100644 --- a/packages/client/src/init.ts +++ b/packages/client/src/init.ts @@ -22,6 +22,7 @@ if (accounts) { } // #endregion +import { set } from "@/scripts/idb-proxy"; import { computed, createApp, @@ -30,7 +31,6 @@ import { version as vueVersion, watch, } from "vue"; -import { set } from "@/scripts/idb-proxy"; import { refreshAccount, signIn, signOut, updateAccount } from "@/account"; import components from "@/components"; diff --git a/packages/client/src/me.ts b/packages/client/src/me.ts index 0add04975b..7a8dc52cb3 100644 --- a/packages/client/src/me.ts +++ b/packages/client/src/me.ts @@ -1,5 +1,5 @@ -import { reactive } from "vue"; import type { Account } from "@/account"; +import { reactive } from "vue"; const accountData = localStorage.getItem("account"); diff --git a/packages/client/src/navbar.ts b/packages/client/src/navbar.ts index d06c8cf18e..0d25014de2 100644 --- a/packages/client/src/navbar.ts +++ b/packages/client/src/navbar.ts @@ -1,4 +1,3 @@ -import { computed, reactive } from "vue"; import { ui } from "@/config"; import { i18n } from "@/i18n"; import { isSignedIn, me } from "@/me"; @@ -6,6 +5,7 @@ import * as os from "@/os"; import icon from "@/scripts/icon"; import { search } from "@/scripts/search"; import { unisonReload } from "@/scripts/unison-reload"; +import { computed, reactive } from "vue"; export const navbarItemDef = reactive({ notifications: { diff --git a/packages/client/src/nirax.ts b/packages/client/src/nirax.ts index 800d47042c..ed1a57bbf4 100644 --- a/packages/client/src/nirax.ts +++ b/packages/client/src/nirax.ts @@ -1,10 +1,10 @@ // NIRAX --- A lightweight router +import { pleaseLogin } from "@/scripts/please-login"; +import { safeURIDecode } from "@/scripts/safe-uri-decode"; import { EventEmitter } from "eventemitter3"; import type { Component, ShallowRef } from "vue"; import { shallowRef } from "vue"; -import { safeURIDecode } from "@/scripts/safe-uri-decode"; -import { pleaseLogin } from "@/scripts/please-login"; interface RouteDef { path: string; diff --git a/packages/client/src/os.ts b/packages/client/src/os.ts index 0ba8528e34..4517056ce9 100644 --- a/packages/client/src/os.ts +++ b/packages/client/src/os.ts @@ -1,18 +1,18 @@ // TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する +import MkDialog from "@/components/MkDialog.vue"; +import MkPostFormDialog from "@/components/MkPostFormDialog.vue"; +import MkToast from "@/components/MkToast.vue"; +import MkWaitingDialog from "@/components/MkWaitingDialog.vue"; +import { url, apiUrl } from "@/config"; +import { me } from "@/me"; +import type { MenuItem } from "@/types/menu"; import { EventEmitter } from "eventemitter3"; import { type entities, api as firefishApi } from "firefish-js"; import insertTextAtCursor from "insert-text-at-cursor"; import type { Component, Ref } from "vue"; import { defineAsyncComponent, markRaw, ref } from "vue"; import { i18n } from "./i18n"; -import MkDialog from "@/components/MkDialog.vue"; -import MkPostFormDialog from "@/components/MkPostFormDialog.vue"; -import MkToast from "@/components/MkToast.vue"; -import MkWaitingDialog from "@/components/MkWaitingDialog.vue"; -import { apiUrl, url } from "@/config"; -import { me } from "@/me"; -import type { MenuItem } from "@/types/menu"; export const pendingApiRequestsCount = ref(0); diff --git a/packages/client/src/pages/about.emojis.vue b/packages/client/src/pages/about.emojis.vue index 3efcd665b9..b94c415caf 100644 --- a/packages/client/src/pages/about.emojis.vue +++ b/packages/client/src/pages/about.emojis.vue @@ -94,10 +94,7 @@ export default defineComponent({ methods: { search() { - if ( - (this.q === "" || this.q == null) && - this.selectedTags.size === 0 - ) { + if ((this.q === "" || this.q == null) && this.selectedTags.size === 0) { this.searchEmojis = null; return; } @@ -105,17 +102,13 @@ export default defineComponent({ if (this.selectedTags.size === 0) { this.searchEmojis = this.customEmojis.filter( (emoji) => - emoji.name.includes(this.q) || - emoji.aliases.includes(this.q), + emoji.name.includes(this.q) || emoji.aliases.includes(this.q), ); } else { this.searchEmojis = this.customEmojis.filter( (emoji) => - (emoji.name.includes(this.q) || - emoji.aliases.includes(this.q)) && - [...this.selectedTags].every((t) => - emoji.aliases.includes(t), - ), + (emoji.name.includes(this.q) || emoji.aliases.includes(this.q)) && + [...this.selectedTags].every((t) => emoji.aliases.includes(t)), ); } }, diff --git a/packages/client/src/pages/about.vue b/packages/client/src/pages/about.vue index 3f4ddb4d7e..caf70856af 100644 --- a/packages/client/src/pages/about.vue +++ b/packages/client/src/pages/about.vue @@ -276,9 +276,7 @@ function easterEgg() { setTimeout(() => { if (iconClicks % 6 === 0) { iconSrc.value = - instance.iconUrl || - instance.faviconUrl || - "/favicon.ico"; + instance.iconUrl || instance.faviconUrl || "/favicon.ico"; } else { iconSrc.value = "/static-assets/woozy.png"; } diff --git a/packages/client/src/pages/admin-file.vue b/packages/client/src/pages/admin-file.vue index 2ac0f66288..b2778ddbbf 100644 --- a/packages/client/src/pages/admin-file.vue +++ b/packages/client/src/pages/admin-file.vue @@ -254,9 +254,7 @@ const headerTabs = computed(() => [ definePageMetadata( computed(() => ({ - title: file.value - ? i18n.ts.file + ": " + file.value.name - : i18n.ts.file, + title: file.value ? i18n.ts.file + ": " + file.value.name : i18n.ts.file, icon: `${icon("ph-file")}`, })), ); diff --git a/packages/client/src/pages/admin/_header_.vue b/packages/client/src/pages/admin/_header_.vue index 2c4e330672..5992438654 100644 --- a/packages/client/src/pages/admin/_header_.vue +++ b/packages/client/src/pages/admin/_header_.vue @@ -169,12 +169,10 @@ onMounted(() => { if (tabEl && tabHighlightEl.value) { // offsetWidth や offsetLeft は少数を丸めてしまうため getBoundingClientRect を使う必要がある // https://developer.mozilla.org/ja/docs/Web/API/HTMLElement/offsetWidth#%E5%80%A4 - const parentRect = - tabEl.parentElement.getBoundingClientRect(); + const parentRect = tabEl.parentElement.getBoundingClientRect(); const rect = tabEl.getBoundingClientRect(); tabHighlightEl.value.style.width = rect.width + "px"; - tabHighlightEl.value.style.left = - rect.left - parentRect.left + "px"; + tabHighlightEl.value.style.left = rect.left - parentRect.left + "px"; } }); }, diff --git a/packages/client/src/pages/admin/announcements.vue b/packages/client/src/pages/admin/announcements.vue index 4b666d43af..2928f98f1b 100644 --- a/packages/client/src/pages/admin/announcements.vue +++ b/packages/client/src/pages/admin/announcements.vue @@ -97,9 +97,7 @@ function remove(announcement) { text: i18n.t("removeAreYouSure", { x: announcement.title }), }).then(({ canceled }) => { if (canceled) return; - announcements.value = announcements.value.filter( - (x) => x !== announcement, - ); + announcements.value = announcements.value.filter((x) => x !== announcement); os.api("admin/announcements/delete", announcement); }); } diff --git a/packages/client/src/pages/admin/database.vue b/packages/client/src/pages/admin/database.vue index c746c7032e..b3b5023910 100644 --- a/packages/client/src/pages/admin/database.vue +++ b/packages/client/src/pages/admin/database.vue @@ -46,9 +46,7 @@ import icon from "@/scripts/icon"; const databasePromiseFactory = () => os .api("admin/get-table-stats") - .then((res) => - Object.entries(res).sort((a, b) => b[1].size - a[1].size), - ); + .then((res) => Object.entries(res).sort((a, b) => b[1].size - a[1].size)); const headerActions = computed(() => []); diff --git a/packages/client/src/pages/admin/emojis.vue b/packages/client/src/pages/admin/emojis.vue index 0941f25b67..7802e5aad6 100644 --- a/packages/client/src/pages/admin/emojis.vue +++ b/packages/client/src/pages/admin/emojis.vue @@ -184,9 +184,7 @@ const remotePagination = { limit: 30, params: computed(() => ({ query: - queryRemote.value && queryRemote.value !== "" - ? queryRemote.value - : null, + queryRemote.value && queryRemote.value !== "" ? queryRemote.value : null, host: host.value && host.value !== "" ? host.value : null, })), }; @@ -203,9 +201,7 @@ const selectAll = () => { const toggleSelect = (emoji) => { if (selectedEmojis.value.includes(emoji.id)) { - selectedEmojis.value = selectedEmojis.value.filter( - (x) => x !== emoji.id, - ); + selectedEmojis.value = selectedEmojis.value.filter((x) => x !== emoji.id); } else { selectedEmojis.value.push(emoji.id); } @@ -305,9 +301,7 @@ const menu = (ev: MouseEvent) => { icon: `${icon("ph-upload-simple")}`, text: i18n.ts.importZip, action: async () => { - const file = await selectFile( - ev.currentTarget ?? ev.target, - ); + const file = await selectFile(ev.currentTarget ?? ev.target); os.api("admin/emoji/import-zip", { fileId: file.id, }) @@ -329,10 +323,7 @@ const menu = (ev: MouseEvent) => { icon: `${icon("ph-info")}`, text: i18n.ts.emojiPackCreator, action: () => { - window.open( - "https://firefish.dev/firefish/emoji-gen", - "_blank", - ); + window.open("https://firefish.dev/firefish/emoji-gen", "_blank"); }, }, ], diff --git a/packages/client/src/pages/admin/files.vue b/packages/client/src/pages/admin/files.vue index ef2dd28a24..ce4fc1f58d 100644 --- a/packages/client/src/pages/admin/files.vue +++ b/packages/client/src/pages/admin/files.vue @@ -103,9 +103,7 @@ const pagination = { userId: userId.value && userId.value !== "" ? userId.value : null, origin: origin.value, hostname: - searchHost.value && searchHost.value !== "" - ? searchHost.value - : null, + searchHost.value && searchHost.value !== "" ? searchHost.value : null, })), }; diff --git a/packages/client/src/pages/admin/hashtags.vue b/packages/client/src/pages/admin/hashtags.vue index 12e24e1611..6ec2efb804 100644 --- a/packages/client/src/pages/admin/hashtags.vue +++ b/packages/client/src/pages/admin/hashtags.vue @@ -46,8 +46,7 @@ async function init() { function save() { os.apiWithDialog("admin/update-meta", { - hiddenTags: - hiddenTags.value.split("\n").map((h: string) => h.trim()) || [], + hiddenTags: hiddenTags.value.split("\n").map((h: string) => h.trim()) || [], }).then(() => { fetchInstance(); }); diff --git a/packages/client/src/pages/admin/index.vue b/packages/client/src/pages/admin/index.vue index 701a63e6c2..7586e7952c 100644 --- a/packages/client/src/pages/admin/index.vue +++ b/packages/client/src/pages/admin/index.vue @@ -221,31 +221,25 @@ const menuDef = computed(() => [ icon: `${icon("ph-gear-six")}`, text: i18n.ts.general, to: "/admin/settings", - active: - currentPage.value?.route.name === "settings", + active: currentPage.value?.route.name === "settings", }, { icon: `${icon("ph-envelope-simple-open")}`, text: i18n.ts.emailServer, to: "/admin/email-settings", - active: - currentPage.value?.route.name === - "email-settings", + active: currentPage.value?.route.name === "email-settings", }, { icon: `${icon("ph-cloud")}`, text: i18n.ts.objectStorage, to: "/admin/object-storage", - active: - currentPage.value?.route.name === - "object-storage", + active: currentPage.value?.route.name === "object-storage", }, { icon: `${icon("ph-lock")}`, text: i18n.ts.security, to: "/admin/security", - active: - currentPage.value?.route.name === "security", + active: currentPage.value?.route.name === "security", }, { icon: `${icon("ph-arrows-merge")}`, @@ -257,38 +251,31 @@ const menuDef = computed(() => [ icon: `${icon("ph-prohibit")}`, text: i18n.ts.instanceBlocking, to: "/admin/instance-block", - active: - currentPage.value?.route.name === - "instance-block", + active: currentPage.value?.route.name === "instance-block", }, { icon: `${icon("ph-hash")}`, text: i18n.ts.hiddenTags, to: "/admin/hashtags", - active: - currentPage.value?.route.name === "hashtags", + active: currentPage.value?.route.name === "hashtags", }, { icon: `${icon("ph-ghost")}`, text: i18n.ts.proxyAccount, to: "/admin/proxy-account", - active: - currentPage.value?.route.name === - "proxy-account", + active: currentPage.value?.route.name === "proxy-account", }, { icon: `${icon("ph-database")}`, text: i18n.ts.database, to: "/admin/database", - active: - currentPage.value?.route.name === "database", + active: currentPage.value?.route.name === "database", }, { icon: `${icon("ph-flask")}`, text: i18n.ts._experiments.title, to: "/admin/experiments", - active: - currentPage.value?.route.name === "experiments", + active: currentPage.value?.route.name === "experiments", }, ], }, diff --git a/packages/client/src/pages/admin/instance-block.vue b/packages/client/src/pages/admin/instance-block.vue index fd80a1564c..80d9046c88 100644 --- a/packages/client/src/pages/admin/instance-block.vue +++ b/packages/client/src/pages/admin/instance-block.vue @@ -70,8 +70,7 @@ async function init() { function save() { os.apiWithDialog("admin/update-meta", { blockedHosts: blockedHosts.value.split("\n").map((h) => h.trim()) || [], - silencedHosts: - silencedHosts.value.split("\n").map((h) => h.trim()) || [], + silencedHosts: silencedHosts.value.split("\n").map((h) => h.trim()) || [], }).then(() => { fetchInstance(); }); diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index 01ded1f321..f69c4fb23b 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -530,7 +530,8 @@ function isValidHttpUrl(src: string) { function parseMoreUrls(src: string): { name: string; url: string }[] { const toReturn: { name: string; url: string }[] = []; const pattern = /"(.+)"\s*:\s*(http.+)/; - src.trim() + src + .trim() .split("\n") .forEach((line) => { const match = pattern.exec(line); @@ -590,9 +591,7 @@ async function init() { defaultReaction.value = ["⭐", "👍", "❤️"].includes(meta.defaultReaction) ? meta.defaultReaction : "custom"; - defaultReactionCustom.value = ["⭐", "👍", "❤️"].includes( - meta.defaultReaction, - ) + defaultReactionCustom.value = ["⭐", "👍", "❤️"].includes(meta.defaultReaction) ? "" : meta.defaultReaction; enableServerMachineStats.value = meta.enableServerMachineStats; diff --git a/packages/client/src/pages/auth.vue b/packages/client/src/pages/auth.vue index 8a600f7d72..a874d0fd26 100644 --- a/packages/client/src/pages/auth.vue +++ b/packages/client/src/pages/auth.vue @@ -72,11 +72,9 @@ onMounted(() => { fetching.value = false; if (session.value.app.isAuthorized) { - os.api("auth/accept", { token: session.value.token }).then( - () => { - accepted(); - }, - ); + os.api("auth/accept", { token: session.value.token }).then(() => { + accepted(); + }); } else { state.value = "waiting"; } diff --git a/packages/client/src/pages/clip.vue b/packages/client/src/pages/clip.vue index 155983ff22..ffe00beeec 100644 --- a/packages/client/src/pages/clip.vue +++ b/packages/client/src/pages/clip.vue @@ -75,28 +75,25 @@ const headerActions = computed(() => icon: `${icon("ph-pencil")}`, text: i18n.ts.toEdit, handler: async (): Promise => { - const { canceled, result } = await os.form( - clip.value.name, - { - name: { - type: "string", - label: i18n.ts.name, - default: clip.value.name, - }, - description: { - type: "string", - required: false, - multiline: true, - label: i18n.ts.description, - default: clip.value.description, - }, - isPublic: { - type: "boolean", - label: i18n.ts.public, - default: clip.value.isPublic, - }, + const { canceled, result } = await os.form(clip.value.name, { + name: { + type: "string", + label: i18n.ts.name, + default: clip.value.name, }, - ); + description: { + type: "string", + required: false, + multiline: true, + label: i18n.ts.description, + default: clip.value.description, + }, + isPublic: { + type: "boolean", + label: i18n.ts.public, + default: clip.value.isPublic, + }, + }); if (canceled) return; os.apiWithDialog("clips/update", { diff --git a/packages/client/src/pages/emojis.emoji.vue b/packages/client/src/pages/emojis.emoji.vue index c1edd640d8..a531625e38 100644 --- a/packages/client/src/pages/emojis.emoji.vue +++ b/packages/client/src/pages/emojis.emoji.vue @@ -37,14 +37,12 @@ function menu(ev) { text: i18n.ts.license, icon: `${icon("ph-info")}`, action: () => { - os.apiGet("emoji", { name: props.emoji.name }).then( - (res) => { - os.alert({ - type: "info", - text: `${res.license || i18n.ts.notSet}`, - }); - }, - ); + os.apiGet("emoji", { name: props.emoji.name }).then((res) => { + os.alert({ + type: "info", + text: `${res.license || i18n.ts.notSet}`, + }); + }); }, }, ], diff --git a/packages/client/src/pages/messaging/index.vue b/packages/client/src/pages/messaging/index.vue index 8bbabc2fcb..c74cb6d3c0 100644 --- a/packages/client/src/pages/messaging/index.vue +++ b/packages/client/src/pages/messaging/index.vue @@ -182,8 +182,7 @@ function onMessage(message): void { !( (m.recipientId === message.recipientId && m.userId === message.userId) || - (m.recipientId === message.userId && - m.userId === message.recipientId) + (m.recipientId === message.userId && m.userId === message.recipientId) ), ); @@ -267,8 +266,7 @@ onMounted(() => { const _messages = userMessages.concat(groupMessages); _messages.sort( (a, b) => - new Date(b.createdAt).getTime() - - new Date(a.createdAt).getTime(), + new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime(), ); messages.value = _messages; }, diff --git a/packages/client/src/pages/messaging/messaging-room.form.vue b/packages/client/src/pages/messaging/messaging-room.form.vue index 1ee092b25e..bc5698a084 100644 --- a/packages/client/src/pages/messaging/messaging-room.form.vue +++ b/packages/client/src/pages/messaging/messaging-room.form.vue @@ -90,8 +90,7 @@ const draftKey = computed(() => props.user ? "user:" + props.user.id : "group:" + props.group?.id, ); const canSend = computed( - () => - (text.value != null && text.value.trim() !== "") || file.value != null, + () => (text.value != null && text.value.trim() !== "") || file.value != null, ); watch([text, file], saveDraft); diff --git a/packages/client/src/pages/messaging/messaging-room.vue b/packages/client/src/pages/messaging/messaging-room.vue index e130a714f5..fa61ec4bc3 100644 --- a/packages/client/src/pages/messaging/messaging-room.vue +++ b/packages/client/src/pages/messaging/messaging-room.vue @@ -280,9 +280,7 @@ function onRead(x) { if (!Array.isArray(x)) x = [x]; for (const id of x) { if (pagingComponent.value.items.some((y) => y.id === id)) { - const exist = pagingComponent.value.items - .map((y) => y.id) - .indexOf(id); + const exist = pagingComponent.value.items.map((y) => y.id).indexOf(id); pagingComponent.value.items[exist] = { ...pagingComponent.value.items[exist], isRead: true, @@ -292,15 +290,10 @@ function onRead(x) { } else if (group.value) { for (const id of x.ids) { if (pagingComponent.value.items.some((y) => y.id === id)) { - const exist = pagingComponent.value.items - .map((y) => y.id) - .indexOf(id); + const exist = pagingComponent.value.items.map((y) => y.id).indexOf(id); pagingComponent.value.items[exist] = { ...pagingComponent.value.items[exist], - reads: [ - ...pagingComponent.value.items[exist].reads, - x.userId, - ], + reads: [...pagingComponent.value.items[exist].reads, x.userId], }; } } diff --git a/packages/client/src/pages/note.vue b/packages/client/src/pages/note.vue index aebfe7a430..e8f7d4bef6 100644 --- a/packages/client/src/pages/note.vue +++ b/packages/client/src/pages/note.vue @@ -175,20 +175,15 @@ definePageMetadata( appearNote.value ? { title: i18n.t("noteOf", { - user: - appearNote.value.user.name || - appearNote.value.user.username, + user: appearNote.value.user.name || appearNote.value.user.username, }), - subtitle: new Date( - appearNote.value.createdAt, - ).toLocaleString(), + subtitle: new Date(appearNote.value.createdAt).toLocaleString(), avatar: appearNote.value.user, path: `/notes/${appearNote.value.id}`, share: { title: i18n.t("noteOf", { user: - appearNote.value.user.name || - appearNote.value.user.username, + appearNote.value.user.name || appearNote.value.user.username, }), text: appearNote.value.text, }, diff --git a/packages/client/src/pages/page-editor/page-editor.script-block.vue b/packages/client/src/pages/page-editor/page-editor.script-block.vue index e271fcf795..d9403a4d52 100644 --- a/packages/client/src/pages/page-editor/page-editor.script-block.vue +++ b/packages/client/src/pages/page-editor/page-editor.script-block.vue @@ -164,9 +164,7 @@ export default defineComponent({ components: { XContainer, MkTextarea, - XV: defineAsyncComponent( - () => import("./page-editor.script-block.vue"), - ), + XV: defineAsyncComponent(() => import("./page-editor.script-block.vue")), }, inject: ["getScriptBlockList"], @@ -228,12 +226,10 @@ export default defineComponent({ watch: { slots: { handler() { - this.modelValue.value.slots = this.slots - .split("\n") - .map((x) => ({ - name: x, - type: null, - })); + this.modelValue.value.slots = this.slots.split("\n").map((x) => ({ + name: x, + type: null, + })); }, deep: true, }, @@ -243,9 +239,7 @@ export default defineComponent({ if (this.modelValue.value == null) this.modelValue.value = null; if (this.modelValue.value && this.modelValue.value.slots) - this.slots = this.modelValue.value.slots - .map((x) => x.name) - .join("\n"); + this.slots = this.modelValue.value.slots.map((x) => x.name).join("\n"); this.$watch( () => this.modelValue.type, @@ -261,10 +255,7 @@ export default defineComponent({ return; } - if ( - this.modelValue.type && - this.modelValue.type.startsWith("fn:") - ) { + if (this.modelValue.type && this.modelValue.type.startsWith("fn:")) { const fnName = this.modelValue.type.split(":")[1]; const fn = this.hpml.getVarByName(fnName); @@ -280,27 +271,17 @@ export default defineComponent({ if (isLiteralValue(this.modelValue)) return; const empties = []; - for ( - let i = 0; - i < funcDefs[this.modelValue.type].in.length; - i++ - ) { + for (let i = 0; i < funcDefs[this.modelValue.type].in.length; i++) { const id = uuid(); empties.push({ id, type: null }); } this.modelValue.args = empties; - for ( - let i = 0; - i < funcDefs[this.modelValue.type].in.length; - i++ - ) { + for (let i = 0; i < funcDefs[this.modelValue.type].in.length; i++) { const inType = funcDefs[this.modelValue.type].in[i]; if (typeof inType !== "number") { - if (inType === "number") - this.modelValue.args[i].type = "number"; - if (inType === "string") - this.modelValue.args[i].type = "text"; + if (inType === "number") this.modelValue.args[i].type = "number"; + if (inType === "string") this.modelValue.args[i].type = "text"; } } }, diff --git a/packages/client/src/pages/registry.keys.vue b/packages/client/src/pages/registry.keys.vue index c7e4762ed4..f5e2e09290 100644 --- a/packages/client/src/pages/registry.keys.vue +++ b/packages/client/src/pages/registry.keys.vue @@ -64,9 +64,7 @@ function fetchKeys() { os.api("i/registry/keys-with-type", { scope: scope.value, }).then((res) => { - keys.value = Object.entries(res).sort((a, b) => - a[0].localeCompare(b[0]), - ); + keys.value = Object.entries(res).sort((a, b) => a[0].localeCompare(b[0])); }); } diff --git a/packages/client/src/pages/reset-password.vue b/packages/client/src/pages/reset-password.vue index 0aa2e78f0a..2cc56c4a0a 100644 --- a/packages/client/src/pages/reset-password.vue +++ b/packages/client/src/pages/reset-password.vue @@ -56,9 +56,7 @@ async function save() { onMounted(() => { if (props.token == null) { os.popup( - defineAsyncComponent( - () => import("@/components/MkForgotPassword.vue"), - ), + defineAsyncComponent(() => import("@/components/MkForgotPassword.vue")), {}, {}, "closed", diff --git a/packages/client/src/pages/scratchpad.vue b/packages/client/src/pages/scratchpad.vue index 179ed8cd4a..810bb461a5 100644 --- a/packages/client/src/pages/scratchpad.vue +++ b/packages/client/src/pages/scratchpad.vue @@ -89,10 +89,7 @@ async function run() { out: (value) => { logs.value.push({ id: Math.random(), - text: - value.type === "str" - ? value.value - : utils.valToString(value), + text: value.type === "str" ? value.value : utils.valToString(value), print: true, }); }, diff --git a/packages/client/src/pages/search.vue b/packages/client/src/pages/search.vue index 4f06b18b90..972a2d46b2 100644 --- a/packages/client/src/pages/search.vue +++ b/packages/client/src/pages/search.vue @@ -78,8 +78,7 @@ const notesPagination = { host: props.host == null ? undefined : getHost(props.host), sinceDate: props.since == null ? undefined : getUnixTime(props.since, false), - untilDate: - props.until == null ? undefined : getUnixTime(props.until, true), + untilDate: props.until == null ? undefined : getUnixTime(props.until, true), withFiles: props.withFiles === "1", searchCwAndAlt: props.searchCwAndAlt === "1", channelId: props.channel, diff --git a/packages/client/src/pages/settings/plugin.install.vue b/packages/client/src/pages/settings/plugin.install.vue index 7ad0ac20a1..2b523ce73b 100644 --- a/packages/client/src/pages/settings/plugin.install.vue +++ b/packages/client/src/pages/settings/plugin.install.vue @@ -107,8 +107,7 @@ async function install() { return; } - const { name, version, author, description, permissions, config } = - metadata; + const { name, version, author, description, permissions, config } = metadata; if (name == null || version == null || author == null) { os.alert({ type: "error", @@ -123,29 +122,22 @@ async function install() { : await new Promise((res, rej) => { os.popup( defineAsyncComponent( - () => - import( - "@/components/MkTokenGenerateWindow.vue" - ), + () => import("@/components/MkTokenGenerateWindow.vue"), ), { title: i18n.ts.tokenRequested, - information: - i18n.ts.pluginTokenRequestedDescription, + information: i18n.ts.pluginTokenRequestedDescription, initialName: name, initialPermissions: permissions, }, { done: async (result) => { const { name, permissions } = result; - const { token } = await os.api( - "miauth/gen-token", - { - session: null, - name, - permission: permissions, - }, - ); + const { token } = await os.api("miauth/gen-token", { + session: null, + name, + permission: permissions, + }); res(token); }, }, diff --git a/packages/client/src/pages/settings/preferences-backups.vue b/packages/client/src/pages/settings/preferences-backups.vue index cd55895b48..202de0a082 100644 --- a/packages/client/src/pages/settings/preferences-backups.vue +++ b/packages/client/src/pages/settings/preferences-backups.vue @@ -196,10 +196,7 @@ function validate(profile: unknown): void { // Check if createdAt and updatedAt is Date // https://zenn.dev/lollipop_onl/articles/eoz-judge-js-invalid-date - if ( - !profile.createdAt || - Number.isNaN(new Date(profile.createdAt).getTime()) - ) + if (!profile.createdAt || Number.isNaN(new Date(profile.createdAt).getTime())) throw new Error("createdAt is falsy or not Date"); if (profile.updatedAt) { if (Number.isNaN(new Date(profile.updatedAt).getTime())) { @@ -228,10 +225,7 @@ function getSettings(): Profile["settings"] { hot, cold, fontSize: localStorage.getItem("fontSize"), - useSystemFont: localStorage.getItem("useSystemFont") as - | "t" - | "f" - | null, + useSystemFont: localStorage.getItem("useSystemFont") as "t" | "f" | null, wallpaper: localStorage.getItem("wallpaper"), }; } @@ -468,12 +462,9 @@ function menu(ev: MouseEvent, profileId: string) { text: i18n.ts.download, icon: `${icon("ph-download-simple")}`, href: URL.createObjectURL( - new Blob( - [JSON.stringify(profiles.value[profileId], null, 2)], - { - type: "application/json", - }, - ), + new Blob([JSON.stringify(profiles.value[profileId], null, 2)], { + type: "application/json", + }), ), download: `${profiles.value[profileId].name}.json`, }, @@ -502,20 +493,17 @@ function menu(ev: MouseEvent, profileId: string) { onMounted(() => { // streamingのuser storage updateイベントを監視して更新 - connection?.on( - "registryUpdated", - ({ scope: recievedScope, key, value }) => { - if ( - !recievedScope || - recievedScope.length !== scope.length || - recievedScope[0] !== scope[0] - ) - return; - if (!profiles.value) return; + connection?.on("registryUpdated", ({ scope: recievedScope, key, value }) => { + if ( + !recievedScope || + recievedScope.length !== scope.length || + recievedScope[0] !== scope[0] + ) + return; + if (!profiles.value) return; - profiles.value[key] = value; - }, - ); + profiles.value[key] = value; + }); }); onUnmounted(() => { diff --git a/packages/client/src/pages/settings/profile.vue b/packages/client/src/pages/settings/profile.vue index 7f9f29d7ad..1dcb2e118f 100644 --- a/packages/client/src/pages/settings/profile.vue +++ b/packages/client/src/pages/settings/profile.vue @@ -213,9 +213,7 @@ while (fields.length < 4) { function saveFields() { os.apiWithDialog("i/update", { - fields: fields.filter( - (field) => field.name !== "" && field.value !== "", - ), + fields: fields.filter((field) => field.name !== "" && field.value !== ""), }); } diff --git a/packages/client/src/pages/settings/reaction.vue b/packages/client/src/pages/settings/reaction.vue index 0b352ac537..395e79f1af 100644 --- a/packages/client/src/pages/settings/reaction.vue +++ b/packages/client/src/pages/settings/reaction.vue @@ -179,9 +179,7 @@ function remove(reaction, ev: MouseEvent) { { text: i18n.ts.remove, action: () => { - reactions.value = reactions.value.filter( - (x) => x !== reaction, - ); + reactions.value = reactions.value.filter((x) => x !== reaction); save(); }, }, @@ -192,9 +190,7 @@ function remove(reaction, ev: MouseEvent) { function preview(ev: MouseEvent) { os.popup( - defineAsyncComponent( - () => import("@/components/MkEmojiPickerDialog.vue"), - ), + defineAsyncComponent(() => import("@/components/MkEmojiPickerDialog.vue")), { asReactionPicker: true, src: ev.currentTarget ?? ev.target, diff --git a/packages/client/src/pages/settings/security.vue b/packages/client/src/pages/settings/security.vue index 6d77381366..1a131cdc2b 100644 --- a/packages/client/src/pages/settings/security.vue +++ b/packages/client/src/pages/settings/security.vue @@ -71,13 +71,11 @@ const pagination = { }; async function change() { - const { canceled: canceled1, result: currentPassword } = await os.inputText( - { - title: i18n.ts.currentPassword, - type: "password", - autocomplete: "current-password", - }, - ); + const { canceled: canceled1, result: currentPassword } = await os.inputText({ + title: i18n.ts.currentPassword, + type: "password", + autocomplete: "current-password", + }); if (canceled1) return; const { canceled: canceled2, result: newPassword } = await os.inputText({ diff --git a/packages/client/src/pages/settings/statusbar.statusbar.vue b/packages/client/src/pages/settings/statusbar.statusbar.vue index 24bc7e8859..ab7a755433 100644 --- a/packages/client/src/pages/settings/statusbar.statusbar.vue +++ b/packages/client/src/pages/settings/statusbar.statusbar.vue @@ -193,9 +193,7 @@ watch( watch(statusbar, save); async function save() { - const i = defaultStore.state.statusbars.findIndex( - (x) => x.id === props._id, - ); + const i = defaultStore.state.statusbars.findIndex((x) => x.id === props._id); const statusbars = deepClone(defaultStore.state.statusbars); statusbars[i] = deepClone(statusbar); defaultStore.set("statusbars", statusbars); diff --git a/packages/client/src/pages/settings/theme.vue b/packages/client/src/pages/settings/theme.vue index c4c34d7c8f..edb2931fb9 100644 --- a/packages/client/src/pages/settings/theme.vue +++ b/packages/client/src/pages/settings/theme.vue @@ -179,9 +179,7 @@ const instanceLightTheme = computed(() => instance.defaultLightTheme ? JSON5.parse(instance.defaultLightTheme) : null, ); const installedLightThemes = computed(() => - installedThemes.value.filter( - (t) => t.base === "light" || t.kind === "light", - ), + installedThemes.value.filter((t) => t.base === "light" || t.kind === "light"), ); const builtinLightThemes = computed(() => builtinThemes.value.filter((t) => t.base === "light" || t.kind === "light"), diff --git a/packages/client/src/pages/settings/word-mute.vue b/packages/client/src/pages/settings/word-mute.vue index 7646ef9385..10b4cfcb29 100644 --- a/packages/client/src/pages/settings/word-mute.vue +++ b/packages/client/src/pages/settings/word-mute.vue @@ -224,10 +224,7 @@ async function save() { let softMutes, softMLangs, hardMWords, hardMPatterns; try { - softMutes = parseSoftMutes( - softMutedWords.value, - i18n.ts._wordMute.soft, - ); + softMutes = parseSoftMutes(softMutedWords.value, i18n.ts._wordMute.soft); softMLangs = parseMutedWords(softMutedLangs.value); hardMWords = parseMutedWords(hardMutedWords.value); hardMPatterns = parseMutedPatterns( diff --git a/packages/client/src/pages/share.vue b/packages/client/src/pages/share.vue index 38533d6df4..be44dd6b34 100644 --- a/packages/client/src/pages/share.vue +++ b/packages/client/src/pages/share.vue @@ -81,9 +81,7 @@ async function init() { ...(visibleUserIds ? visibleUserIds.split(",").map((userId) => ({ userId })) : []), - ...(visibleAccts - ? visibleAccts.split(",").map(acct.parse) - : []), + ...(visibleAccts ? visibleAccts.split(",").map(acct.parse) : []), ] // TypeScriptの指示通りに変換する .map((q) => @@ -100,9 +98,7 @@ async function init() { visibleUsers.value.push(user); }, () => { - console.error( - `Invalid user query: ${JSON.stringify(q)}`, - ); + console.error(`Invalid user query: ${JSON.stringify(q)}`); }, ), ), diff --git a/packages/client/src/pages/user-info.vue b/packages/client/src/pages/user-info.vue index 2fa62e8258..90fab34eb1 100644 --- a/packages/client/src/pages/user-info.vue +++ b/packages/client/src/pages/user-info.vue @@ -414,8 +414,7 @@ function createFetcher() { emojiModPerm.value = info.value.emojiModPerm; silenced.value = info.value.isSilenced; suspended.value = info.value.isSuspended; - driveCapacityOverrideMb.value = - user.value.driveCapacityOverrideMb; + driveCapacityOverrideMb.value = user.value.driveCapacityOverrideMb; moderationNote.value = info.value.moderationNote; watch(moderationNote, async () => { diff --git a/packages/client/src/pages/welcome.entrance.b.vue b/packages/client/src/pages/welcome.entrance.b.vue index 2758f11c2e..192dddbc84 100644 --- a/packages/client/src/pages/welcome.entrance.b.vue +++ b/packages/client/src/pages/welcome.entrance.b.vue @@ -168,10 +168,7 @@ export default defineComponent({ text: i18n.ts.help, icon: `${icon("ph-question")}`, action: () => { - window.open( - `https://misskey-hub.net/help.md`, - "_blank", - ); + window.open(`https://misskey-hub.net/help.md`, "_blank"); }, }, ], diff --git a/packages/client/src/pizzax.ts b/packages/client/src/pizzax.ts index 6974df94dc..6832770e90 100644 --- a/packages/client/src/pizzax.ts +++ b/packages/client/src/pizzax.ts @@ -1,10 +1,10 @@ // PIZZAX --- A lightweight store +import { isSignedIn, me } from "@/me"; import type { Ref } from "vue"; import { onUnmounted, ref, watch } from "vue"; import { api } from "./os"; import { useStream } from "./stream"; -import { isSignedIn, me } from "@/me"; type StateDef = Record< string, diff --git a/packages/client/src/plugin.ts b/packages/client/src/plugin.ts index c38aaa365a..2789cc7937 100644 --- a/packages/client/src/plugin.ts +++ b/packages/client/src/plugin.ts @@ -1,4 +1,3 @@ -import { Interpreter, Parser, utils, values } from "@syuilo/aiscript"; import { inputText } from "@/os"; import { createAiScriptEnv } from "@/scripts/aiscript/api"; import { @@ -8,6 +7,7 @@ import { postFormActions, userActions, } from "@/store"; +import { Interpreter, Parser, utils, values } from "@syuilo/aiscript"; const parser = new Parser(); const pluginContexts = new Map(); diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 35b54b20ec..eddbea49c7 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -1,9 +1,9 @@ -import type { AsyncComponentLoader } from "vue"; -import { defineAsyncComponent, inject } from "vue"; import { isEmojiMod, isModerator, me } from "@/me"; import { Router } from "@/nirax"; import MkError from "@/pages/_error_.vue"; import MkLoading from "@/pages/_loading_.vue"; +import type { AsyncComponentLoader } from "vue"; +import { defineAsyncComponent, inject } from "vue"; const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ diff --git a/packages/client/src/stream.ts b/packages/client/src/stream.ts index 89dda63f08..7dd32b40da 100644 --- a/packages/client/src/stream.ts +++ b/packages/client/src/stream.ts @@ -1,7 +1,7 @@ -import { Stream } from "firefish-js"; -import { markRaw } from "vue"; import { url } from "@/config"; import { me } from "@/me"; +import { Stream } from "firefish-js"; +import { markRaw } from "vue"; let stream: Stream | null = null; let timeoutHeartBeat: number | null = null; diff --git a/packages/client/src/theme-store.ts b/packages/client/src/theme-store.ts index a5957dea8f..9660e63f90 100644 --- a/packages/client/src/theme-store.ts +++ b/packages/client/src/theme-store.ts @@ -1,6 +1,6 @@ -import type { Theme } from "./scripts/theme"; import { isSignedIn, me } from "@/me"; import { api } from "@/os"; +import type { Theme } from "./scripts/theme"; const lsCacheKey = isSignedIn ? `themes:${me.id}` : ""; diff --git a/packages/client/src/ui/_common_/navbar.vue b/packages/client/src/ui/_common_/navbar.vue index 0251a38c6a..001001504e 100644 --- a/packages/client/src/ui/_common_/navbar.vue +++ b/packages/client/src/ui/_common_/navbar.vue @@ -178,8 +178,7 @@ const otherMenuItemIndicated = computed(() => { const calcViewState = () => { iconOnly.value = - window.innerWidth <= 1279 || - defaultStore.state.menuDisplay === "sideIcon"; + window.innerWidth <= 1279 || defaultStore.state.menuDisplay === "sideIcon"; }; calcViewState(); diff --git a/packages/client/src/ui/deck.vue b/packages/client/src/ui/deck.vue index 1f345e7b95..acbdb1c127 100644 --- a/packages/client/src/ui/deck.vue +++ b/packages/client/src/ui/deck.vue @@ -216,9 +216,7 @@ const XStatusBars = defineAsyncComponent( mainRouter.navHook = (path, flag): boolean => { if (flag === "forcePage") return false; - const noMainColumn = !deckStore.state.columns.some( - (x) => x.type === "main", - ); + const noMainColumn = !deckStore.state.columns.some((x) => x.type === "main"); if (deckStore.state.navWindow || noMainColumn) { os.pageWindow(path); return true; diff --git a/packages/client/src/ui/universal.vue b/packages/client/src/ui/universal.vue index 93cee4183a..4b3bca62eb 100644 --- a/packages/client/src/ui/universal.vue +++ b/packages/client/src/ui/universal.vue @@ -394,9 +394,7 @@ async function startGroup(): void { onMounted(() => { if (!isDesktop.value) { - matchMedia(`(min-width: ${DESKTOP_THRESHOLD - 1}px)`).onchange = ( - mql, - ) => { + matchMedia(`(min-width: ${DESKTOP_THRESHOLD - 1}px)`).onchange = (mql) => { if (mql.matches) isDesktop.value = true; }; } diff --git a/packages/client/src/ui/visitor/a.vue b/packages/client/src/ui/visitor/a.vue index 1010d3a052..107c4014cf 100644 --- a/packages/client/src/ui/visitor/a.vue +++ b/packages/client/src/ui/visitor/a.vue @@ -140,8 +140,7 @@ export default defineComponent({ window.addEventListener( "resize", () => { - if (window.innerWidth >= DESKTOP_THRESHOLD) - this.isDesktop = true; + if (window.innerWidth >= DESKTOP_THRESHOLD) this.isDesktop = true; }, { passive: true }, ); diff --git a/packages/client/src/ui/visitor/b.vue b/packages/client/src/ui/visitor/b.vue index 5d5a7a31cd..68e3f9d1bf 100644 --- a/packages/client/src/ui/visitor/b.vue +++ b/packages/client/src/ui/visitor/b.vue @@ -166,8 +166,7 @@ onMounted(() => { window.addEventListener( "resize", () => { - if (window.innerWidth >= DESKTOP_THRESHOLD) - isDesktop.value = true; + if (window.innerWidth >= DESKTOP_THRESHOLD) isDesktop.value = true; }, { passive: true }, ); diff --git a/packages/client/src/widgets/aiscript.vue b/packages/client/src/widgets/aiscript.vue index 7028c36d74..a954b8385b 100644 --- a/packages/client/src/widgets/aiscript.vue +++ b/packages/client/src/widgets/aiscript.vue @@ -99,10 +99,7 @@ const run = async () => { out: (value) => { logs.value.push({ id: Math.random().toString(), - text: - value.type === "str" - ? value.value - : utils.valToString(value), + text: value.type === "str" ? value.value : utils.valToString(value), print: true, }); }, diff --git a/packages/client/src/widgets/clock.vue b/packages/client/src/widgets/clock.vue index ab0c41f1e6..8b7b80fbb7 100644 --- a/packages/client/src/widgets/clock.vue +++ b/packages/client/src/widgets/clock.vue @@ -203,13 +203,10 @@ const tzAbbrev = computed( ? timezones.find( (tz) => tz.name.toLowerCase() === - Intl.DateTimeFormat() - .resolvedOptions() - .timeZone.toLowerCase(), + Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase(), )?.abbrev - : timezones.find( - (tz) => tz.name.toLowerCase() === widgetProps.timezone, - )?.abbrev) ?? "?", + : timezones.find((tz) => tz.name.toLowerCase() === widgetProps.timezone) + ?.abbrev) ?? "?", ); const tzOffset = computed(() => diff --git a/packages/client/src/widgets/digital-clock.vue b/packages/client/src/widgets/digital-clock.vue index 5bf47a5624..d01c0722ca 100644 --- a/packages/client/src/widgets/digital-clock.vue +++ b/packages/client/src/widgets/digital-clock.vue @@ -83,13 +83,10 @@ const tzAbbrev = computed( ? timezones.find( (tz) => tz.name.toLowerCase() === - Intl.DateTimeFormat() - .resolvedOptions() - .timeZone.toLowerCase(), + Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase(), )?.abbrev - : timezones.find( - (tz) => tz.name.toLowerCase() === widgetProps.timezone, - )?.abbrev) ?? "?", + : timezones.find((tz) => tz.name.toLowerCase() === widgetProps.timezone) + ?.abbrev) ?? "?", ); const tzOffset = computed(() => diff --git a/packages/client/src/widgets/server-metric/cpu-mem.vue b/packages/client/src/widgets/server-metric/cpu-mem.vue index df03b8135e..21997bf89e 100644 --- a/packages/client/src/widgets/server-metric/cpu-mem.vue +++ b/packages/client/src/widgets/server-metric/cpu-mem.vue @@ -147,19 +147,13 @@ function onStats(connStats) { viewBoxY.value } ${memPolylinePoints.value} ${viewBoxX.value},${viewBoxY.value}`; - cpuHeadX.value = - cpuPolylinePointsStats[cpuPolylinePointsStats.length - 1][0]; - cpuHeadY.value = - cpuPolylinePointsStats[cpuPolylinePointsStats.length - 1][1]; - memHeadX.value = - memPolylinePointsStats[memPolylinePointsStats.length - 1][0]; - memHeadY.value = - memPolylinePointsStats[memPolylinePointsStats.length - 1][1]; + cpuHeadX.value = cpuPolylinePointsStats[cpuPolylinePointsStats.length - 1][0]; + cpuHeadY.value = cpuPolylinePointsStats[cpuPolylinePointsStats.length - 1][1]; + memHeadX.value = memPolylinePointsStats[memPolylinePointsStats.length - 1][0]; + memHeadY.value = memPolylinePointsStats[memPolylinePointsStats.length - 1][1]; cpuP.value = (connStats.cpu * 100).toFixed(0); - memP.value = ((connStats.mem.active / connStats.mem.total) * 100).toFixed( - 0, - ); + memP.value = ((connStats.mem.active / connStats.mem.total) * 100).toFixed(0); } function onStatsLog(statsLog) { diff --git a/packages/client/src/widgets/server-metric/net.vue b/packages/client/src/widgets/server-metric/net.vue index 592604c5a1..993c53c3c4 100644 --- a/packages/client/src/widgets/server-metric/net.vue +++ b/packages/client/src/widgets/server-metric/net.vue @@ -112,10 +112,8 @@ function onStats(connStats) { inHeadX.value = inPolylinePointsStats[inPolylinePointsStats.length - 1][0]; inHeadY.value = inPolylinePointsStats[inPolylinePointsStats.length - 1][1]; - outHeadX.value = - outPolylinePointsStats[outPolylinePointsStats.length - 1][0]; - outHeadY.value = - outPolylinePointsStats[outPolylinePointsStats.length - 1][1]; + outHeadX.value = outPolylinePointsStats[outPolylinePointsStats.length - 1][0]; + outHeadY.value = outPolylinePointsStats[outPolylinePointsStats.length - 1][1]; inRecent.value = connStats.net.rx; outRecent.value = connStats.net.tx; diff --git a/packages/megalodon/src/filter_context.ts b/packages/megalodon/src/filter_context.ts index 4c83cb15f2..471b0ceedb 100644 --- a/packages/megalodon/src/filter_context.ts +++ b/packages/megalodon/src/filter_context.ts @@ -1,4 +1,4 @@ -import Entity from "./entity"; +import type Entity from "./entity"; namespace FilterContext { export const Home: Entity.FilterContext = "home"; diff --git a/packages/megalodon/src/index.ts b/packages/megalodon/src/index.ts index 758d3a46ad..bfb3935435 100644 --- a/packages/megalodon/src/index.ts +++ b/packages/megalodon/src/index.ts @@ -1,17 +1,17 @@ -import Response from "./response"; -import OAuth from "./oauth"; -import { isCancel, RequestCanceledError } from "./cancel"; -import { ProxyConfig } from "./proxy_config"; +import { RequestCanceledError, isCancel } from "./cancel"; +import Converter from "./converter"; +import Entity from "./entity"; +import FilterContext from "./filter_context"; import generator, { detector, MegalodonInterface, WebSocketInterface, } from "./megalodon"; import Misskey from "./misskey"; -import Entity from "./entity"; import NotificationType from "./notification"; -import FilterContext from "./filter_context"; -import Converter from "./converter"; +import OAuth from "./oauth"; +import { ProxyConfig } from "./proxy_config"; +import Response from "./response"; export { Response, diff --git a/packages/megalodon/src/megalodon.ts b/packages/megalodon/src/megalodon.ts index 33a5790f67..b2947b2fad 100644 --- a/packages/megalodon/src/megalodon.ts +++ b/packages/megalodon/src/megalodon.ts @@ -1,10 +1,10 @@ -import Response from "./response"; -import OAuth from "./oauth"; -import proxyAgent, { ProxyConfig } from "./proxy_config"; -import Entity from "./entity"; -import axios, { AxiosRequestConfig } from "axios"; -import Misskey from "./misskey"; +import axios, { type AxiosRequestConfig } from "axios"; import { DEFAULT_UA } from "./default"; +import type Entity from "./entity"; +import Misskey from "./misskey"; +import type OAuth from "./oauth"; +import proxyAgent, { type ProxyConfig } from "./proxy_config"; +import type Response from "./response"; export interface WebSocketInterface { start(): void; diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index 25922a2ffc..f86ad09d35 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -1,22 +1,22 @@ -import FormData from "form-data"; import AsyncLock from "async-lock"; +import FormData from "form-data"; -import MisskeyAPI from "./misskey/api_client"; -import { DEFAULT_UA } from "./default"; -import { ProxyConfig } from "./proxy_config"; -import OAuth from "./oauth"; -import Response from "./response"; -import Entity from "./entity"; -import { - MegalodonInterface, - WebSocketInterface, - NoImplementedError, - ArgumentError, - UnexpectedError, -} from "./megalodon"; -import MegalodonEntity from "@/entity"; import fs from "node:fs"; +import type MegalodonEntity from "@/entity"; +import { DEFAULT_UA } from "./default"; +import type Entity from "./entity"; +import { + ArgumentError, + type MegalodonInterface, + NoImplementedError, + UnexpectedError, + type WebSocketInterface, +} from "./megalodon"; +import MisskeyAPI from "./misskey/api_client"; import MisskeyNotificationType from "./misskey/notification"; +import OAuth from "./oauth"; +import type { ProxyConfig } from "./proxy_config"; +import type Response from "./response"; type AccountCache = { locks: AsyncLock; diff --git a/packages/megalodon/src/notification.ts b/packages/megalodon/src/notification.ts index 84cd23e40d..591cfa6ce0 100644 --- a/packages/megalodon/src/notification.ts +++ b/packages/megalodon/src/notification.ts @@ -1,4 +1,4 @@ -import Entity from "./entity"; +import type Entity from "./entity"; namespace NotificationType { export const Follow: Entity.NotificationType = "follow"; diff --git a/packages/megalodon/src/parser.ts b/packages/megalodon/src/parser.ts index 2ddf2ac2e6..31365e537a 100644 --- a/packages/megalodon/src/parser.ts +++ b/packages/megalodon/src/parser.ts @@ -1,5 +1,5 @@ import { EventEmitter } from "events"; -import Entity from "./entity"; +import type Entity from "./entity"; /** * Parser diff --git a/packages/megalodon/src/proxy_config.ts b/packages/megalodon/src/proxy_config.ts index fadbcf084e..dd5f8e3cf2 100644 --- a/packages/megalodon/src/proxy_config.ts +++ b/packages/megalodon/src/proxy_config.ts @@ -1,5 +1,11 @@ -import { HttpsProxyAgent, HttpsProxyAgentOptions } from "https-proxy-agent"; -import { SocksProxyAgent, SocksProxyAgentOptions } from "socks-proxy-agent"; +import { + HttpsProxyAgent, + type HttpsProxyAgentOptions, +} from "https-proxy-agent"; +import { + SocksProxyAgent, + type SocksProxyAgentOptions, +} from "socks-proxy-agent"; export type ProxyConfig = { host: string;