diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index 8883536235..4fd201fa49 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/MkAnalogClock.vue b/packages/client/src/components/MkAnalogClock.vue index 30c3fa3800..8ac144dbe6 100644 --- a/packages/client/src/components/MkAnalogClock.vue +++ b/packages/client/src/components/MkAnalogClock.vue @@ -166,21 +166,21 @@ const texts = computed(() => { return angles; }); -let enabled = true, - majorGraduationColor = ref(), - // let minorGraduationColor = $ref(); - sHandColor = ref(), - mHandColor = ref(), - hHandColor = ref(), - nowColor = ref(), - h = ref(0), - m = ref(0), - s = ref(0), - hAngle = ref(0), - mAngle = ref(0), - sAngle = ref(0), - disableSAnimate = ref(false), - sOneRound = false; +let enabled = true; +const majorGraduationColor = ref(); +// let minorGraduationColor = $ref(); +const sHandColor = ref(); +const mHandColor = ref(); +const hHandColor = ref(); +const nowColor = ref(); +const h = ref(0); +const m = ref(0); +const s = ref(0); +const hAngle = ref(0); +const mAngle = ref(0); +const sAngle = ref(0); +const disableSAnimate = ref(false); +let sOneRound = false; function tick() { const now = new Date(); diff --git a/packages/client/src/components/MkChart.vue b/packages/client/src/components/MkChart.vue index e3873e7602..d62f52d26f 100644 --- a/packages/client/src/components/MkChart.vue +++ b/packages/client/src/components/MkChart.vue @@ -128,20 +128,20 @@ const getColor = (i) => { }; const now = new Date(); -let chartInstance: Chart = null, - chartData: { - series: { - name: string; - type: "line" | "area"; - color?: string; - dashed?: boolean; - hidden?: boolean; - data: { - x: number; - y: number; - }[]; +let chartInstance: Chart = null; +let chartData: { + series: { + name: string; + type: "line" | "area"; + color?: string; + dashed?: boolean; + hidden?: boolean; + data: { + x: number; + y: number; }[]; - } = null; + }[]; +} = null; const chartEl = ref(null); const fetching = ref(true); diff --git a/packages/client/src/components/MkContextMenu.vue b/packages/client/src/components/MkContextMenu.vue index 3944719fae..42c9f74e1f 100644 --- a/packages/client/src/components/MkContextMenu.vue +++ b/packages/client/src/components/MkContextMenu.vue @@ -33,8 +33,8 @@ const rootEl = ref(); const zIndex = ref(os.claimZIndex("high")); onMounted(() => { - let left = props.ev.pageX + 1, // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1 - top = props.ev.pageY + 1; // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1 + let left = props.ev.pageX + 1; // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1 + let top = props.ev.pageY + 1; // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1 const width = rootEl.value.offsetWidth; const height = rootEl.value.offsetHeight; diff --git a/packages/client/src/components/MkCropperDialog.vue b/packages/client/src/components/MkCropperDialog.vue index 1dfbd1e2d5..16b42c2f2a 100644 --- a/packages/client/src/components/MkCropperDialog.vue +++ b/packages/client/src/components/MkCropperDialog.vue @@ -64,8 +64,8 @@ const imgUrl = `${url}/proxy/image.webp?${query({ })}`; const dialogEl = ref>(); const imgEl = ref(); -let cropper: Cropper | null = null, - loading = ref(true); +let cropper: Cropper | null = null; +const loading = ref(true); const ok = async () => { const promise = new Promise(async (res) => { diff --git a/packages/client/src/components/MkImgWithBlurhash.vue b/packages/client/src/components/MkImgWithBlurhash.vue index 27fa2779a7..5e70515a93 100644 --- a/packages/client/src/components/MkImgWithBlurhash.vue +++ b/packages/client/src/components/MkImgWithBlurhash.vue @@ -22,14 +22,14 @@ @load="onLoad" /> diff --git a/packages/client/src/components/MkModPlayer.vue b/packages/client/src/components/MkModPlayer.vue index 74c598ba94..cdaa5f7040 100644 --- a/packages/client/src/components/MkModPlayer.vue +++ b/packages/client/src/components/MkModPlayer.vue @@ -168,10 +168,10 @@ function load() { onMounted(load); -let currentRow = 0, - rowHeight = 0, - buffer = null, - isSeeking = false; +let currentRow = 0; +let rowHeight = 0; +let buffer = null; +const isSeeking = false; function captionPopup() { os.alert({ diff --git a/packages/client/src/components/MkModal.vue b/packages/client/src/components/MkModal.vue index 91b998e31b..1c9a252dda 100644 --- a/packages/client/src/components/MkModal.vue +++ b/packages/client/src/components/MkModal.vue @@ -235,7 +235,8 @@ const align = () => { const width = content.value!.offsetWidth; const height = content.value!.offsetHeight; - let left, top; + let left; + let top; const x = srcRect.left + (fixed.value ? 0 : window.pageXOffset); const y = srcRect.top + (fixed.value ? 0 : window.pageYOffset); @@ -314,8 +315,8 @@ const align = () => { left = 0; } - let transformOriginX = "center", - transformOriginY = "center"; + let transformOriginX = "center"; + let transformOriginY = "center"; if ( top >= diff --git a/packages/client/src/components/MkNotification.vue b/packages/client/src/components/MkNotification.vue index 7ea46b5a57..b00646cdd6 100644 --- a/packages/client/src/components/MkNotification.vue +++ b/packages/client/src/components/MkNotification.vue @@ -310,7 +310,8 @@ const defaultReaction = ["⭐", "👍", "❤️"].includes(instance.defaultReact ? instance.defaultReaction : "⭐"; -let readObserver: IntersectionObserver | undefined, connection; +let readObserver: IntersectionObserver | undefined; +let connection; onMounted(() => { if (!props.notification.isRead) { diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index 5286e50ad7..3890908026 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -331,8 +331,8 @@ import { vibrate } from "@/scripts/vibrate"; import { langmap } from "@/scripts/langmap"; import { detectLanguage, - isSupportedLang, isSameLanguage, + isSupportedLang, languageContains, parentLanguage, } from "@/scripts/language-utils"; diff --git a/packages/client/src/components/MkPullToRefresh.vue b/packages/client/src/components/MkPullToRefresh.vue index b12ecdd9ec..40e6ca4640 100644 --- a/packages/client/src/components/MkPullToRefresh.vue +++ b/packages/client/src/components/MkPullToRefresh.vue @@ -45,7 +45,7 @@ const isRefreshing = ref(false); const pullDistance = ref(0); let disabled = false; -let supportPointerDesktop = false; +const supportPointerDesktop = false; let startScreenY: number | null = null; const rootEl = shallowRef(); diff --git a/packages/client/src/components/MkSparkle.vue b/packages/client/src/components/MkSparkle.vue index bb3ec49bc4..b67b86355d 100644 --- a/packages/client/src/components/MkSparkle.vue +++ b/packages/client/src/components/MkSparkle.vue @@ -79,8 +79,8 @@ const el = ref(); const width = ref(0); const height = ref(0); const colors = ["#eb6f92", "#9ccfd8", "#f6c177", "#f6c177", "#f6c177"]; -let stop = false, - ro: ResizeObserver | undefined; +let stop = false; +let ro: ResizeObserver | undefined; onMounted(() => { if (!reducedMotion()) { diff --git a/packages/client/src/components/MkWindow.vue b/packages/client/src/components/MkWindow.vue index b28cc4b62b..147d0bec1f 100644 --- a/packages/client/src/components/MkWindow.vue +++ b/packages/client/src/components/MkWindow.vue @@ -174,12 +174,12 @@ provide("inWindow", true); const rootEl = ref(); const showing = ref(true); -let beforeClickedAt = 0, - maximized = ref(false), - unMaximizedTop = "", - unMaximizedLeft = "", - unMaximizedWidth = "", - unMaximizedHeight = ""; +let beforeClickedAt = 0; +const maximized = ref(false); +let unMaximizedTop = ""; +let unMaximizedLeft = ""; +let unMaximizedWidth = ""; +let unMaximizedHeight = ""; function close() { showing.value = false; @@ -280,8 +280,8 @@ function onHeaderMousedown(evt: MouseEvent) { const windowHeight = main.offsetHeight; function move(x: number, y: number) { - let moveLeft = x - moveBaseX, - moveTop = y - moveBaseY; + let moveLeft = x - moveBaseX; + let moveTop = y - moveBaseY; // 下はみ出し if (moveTop + windowHeight > browserHeight) diff --git a/packages/client/src/components/global/MkSpacer.vue b/packages/client/src/components/global/MkSpacer.vue index 347b763cd8..b2f137f9c3 100644 --- a/packages/client/src/components/global/MkSpacer.vue +++ b/packages/client/src/components/global/MkSpacer.vue @@ -24,10 +24,10 @@ const props = withDefaults( }, ); -let ro: ResizeObserver, - root = ref(), - content = ref(), - margin = ref(0); +let ro: ResizeObserver; +const root = ref(); +const content = ref(); +const margin = ref(0); const shouldSpacerMin = inject("shouldSpacerMin", false); const adjust = (rect: { width: number; height: number }) => { diff --git a/packages/client/src/i18n.ts b/packages/client/src/i18n.ts index 5e92817c3f..6d352ba03e 100644 --- a/packages/client/src/i18n.ts +++ b/packages/client/src/i18n.ts @@ -1,5 +1,5 @@ -import { locale } from "@/config"; import { markRaw } from "vue"; +import { locale } from "@/config"; class I18n> { public ts: T; diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index 5b986d8647..17b44bb9f8 100644 --- a/packages/client/src/init.ts +++ b/packages/client/src/init.ts @@ -22,7 +22,6 @@ if (accounts) { } // #endregion -import { set } from "@/scripts/idb-proxy"; import { computed, createApp, @@ -31,6 +30,7 @@ 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 7a8dc52cb3..0add04975b 100644 --- a/packages/client/src/me.ts +++ b/packages/client/src/me.ts @@ -1,5 +1,5 @@ -import type { Account } from "@/account"; import { reactive } from "vue"; +import type { Account } from "@/account"; const accountData = localStorage.getItem("account"); diff --git a/packages/client/src/navbar.ts b/packages/client/src/navbar.ts index 0d25014de2..d06c8cf18e 100644 --- a/packages/client/src/navbar.ts +++ b/packages/client/src/navbar.ts @@ -1,3 +1,4 @@ +import { computed, reactive } from "vue"; import { ui } from "@/config"; import { i18n } from "@/i18n"; import { isSignedIn, me } from "@/me"; @@ -5,7 +6,6 @@ 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 ed1a57bbf4..f214060762 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; @@ -93,8 +93,8 @@ export class Router extends EventEmitter<{ } public resolve(path: string): Resolved | null { - let queryString: string | null = null, - hash: string | null = null; + let queryString: string | null = null; + let hash: string | null = null; if (path[0] === "/") path = path.substring(1); if (path.includes("#")) { hash = path.substring(path.indexOf("#") + 1); diff --git a/packages/client/src/os.ts b/packages/client/src/os.ts index 4517056ce9..8fbf15ec3d 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); @@ -776,8 +776,8 @@ type AwaitType = T extends Promise : T extends (...args: any[]) => Promise ? V : T; -let openingEmojiPicker: AwaitType> | null = null, - activeTextarea: HTMLTextAreaElement | HTMLInputElement | null = null; +let openingEmojiPicker: AwaitType> | null = null; +let activeTextarea: HTMLTextAreaElement | HTMLInputElement | null = null; export async function openEmojiPicker( src?: HTMLElement, opts, diff --git a/packages/client/src/pages/authorize_interaction.vue b/packages/client/src/pages/authorize_interaction.vue index 22c6627aa0..b6b680cc20 100644 --- a/packages/client/src/pages/authorize_interaction.vue +++ b/packages/client/src/pages/authorize_interaction.vue @@ -4,11 +4,11 @@