diff --git a/packages/backend/src/const.ts b/packages/backend/src/const.ts index 6dddf1fff5..8fc4bd25e0 100644 --- a/packages/backend/src/const.ts +++ b/packages/backend/src/const.ts @@ -1,7 +1,7 @@ import config from "@/config/index.js"; import { - DB_MAX_NOTE_TEXT_LENGTH, DB_MAX_IMAGE_COMMENT_LENGTH, + DB_MAX_NOTE_TEXT_LENGTH, } from "@/misc/hard-limits.js"; export const MAX_NOTE_TEXT_LENGTH = Math.min( diff --git a/packages/backend/src/global.d.ts b/packages/backend/src/global.d.ts index 503e26eb60..6c5a22e4b4 100644 --- a/packages/backend/src/global.d.ts +++ b/packages/backend/src/global.d.ts @@ -1,2 +1,2 @@ -// rome-ignore lint/suspicious/noExplicitAny: i have no idea +// biome-ignore lint/suspicious/noExplicitAny: i have no idea type FIXME = any; diff --git a/packages/backend/src/server/file/send-drive-file.ts b/packages/backend/src/server/file/send-drive-file.ts index 1c4d4136b5..cb29934911 100644 --- a/packages/backend/src/server/file/send-drive-file.ts +++ b/packages/backend/src/server/file/send-drive-file.ts @@ -25,7 +25,8 @@ const assets = `${_dirname}/../../server/file/assets/`; const MAX_BYTE_RANGES = 10; const commonReadableHandlerGenerator = - (ctx: Koa.Context) => (e: Error): void => { + (ctx: Koa.Context) => + (e: Error): void => { serverLogger.error(e); ctx.status = 500; ctx.set("Cache-Control", "max-age=300"); diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index 63a295fb33..8670f6275d 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -175,7 +175,8 @@ export default async ( ) => // biome-ignore lint/suspicious/noAsyncPromiseExecutor: FIXME new Promise(async (res, rej) => { - const dontFederateInitially = data.localOnly || data.visibility?.startsWith("hidden") === true; + const dontFederateInitially = + data.localOnly || data.visibility?.startsWith("hidden") === true; // If you reply outside the channel, match the scope of the target. // TODO (I think it's a process that could be done on the client side, but it's server side for now.) diff --git a/packages/backend/test/ap-request.ts b/packages/backend/test/ap-request.ts index bf77a38532..722977fe14 100644 --- a/packages/backend/test/ap-request.ts +++ b/packages/backend/test/ap-request.ts @@ -2,8 +2,8 @@ import * as assert from "assert"; import httpSignature from "@peertube/http-signature"; import { genRsaKeyPair } from "../src/misc/gen-key-pair.js"; import { - createSignedPost, createSignedGet, + createSignedPost, } from "../src/remote/activitypub/ap-request.js"; export const buildParsedSignature = ( diff --git a/packages/backend/test/api-visibility.ts b/packages/backend/test/api-visibility.ts index 0ee4a4d337..49b1b5a064 100644 --- a/packages/backend/test/api-visibility.ts +++ b/packages/backend/test/api-visibility.ts @@ -4,11 +4,11 @@ import * as assert from "assert"; import * as childProcess from "child_process"; import { async, - signup, - request, post, - startServer, + request, shutdownServer, + signup, + startServer, } from "./utils.js"; describe("API visibility", () => { diff --git a/packages/backend/test/api.ts b/packages/backend/test/api.ts index 19a754552c..0fc2f424ec 100644 --- a/packages/backend/test/api.ts +++ b/packages/backend/test/api.ts @@ -4,13 +4,13 @@ import * as assert from "assert"; import * as childProcess from "child_process"; import { async, - signup, - request, post, react, - uploadFile, - startServer, + request, shutdownServer, + signup, + startServer, + uploadFile, } from "./utils.js"; describe("API", () => { diff --git a/packages/backend/test/block.ts b/packages/backend/test/block.ts index 08192e4869..100a4ab7d5 100644 --- a/packages/backend/test/block.ts +++ b/packages/backend/test/block.ts @@ -4,11 +4,11 @@ import * as assert from "assert"; import * as childProcess from "child_process"; import { async, - signup, - request, post, - startServer, + request, shutdownServer, + signup, + startServer, } from "./utils.js"; describe("Block", () => { diff --git a/packages/backend/test/chart.ts b/packages/backend/test/chart.ts index e194c6c195..cd600f661a 100644 --- a/packages/backend/test/chart.ts +++ b/packages/backend/test/chart.ts @@ -2,11 +2,11 @@ process.env.NODE_ENV = "test"; import * as assert from "assert"; import * as lolex from "@sinonjs/fake-timers"; -import TestChart from "../src/services/chart/charts/test.js"; -import TestGroupedChart from "../src/services/chart/charts/test-grouped.js"; -import TestUniqueChart from "../src/services/chart/charts/test-unique.js"; -import TestIntersectionChart from "../src/services/chart/charts/test-intersection.js"; import { initDb } from "../src/db/postgre.js"; +import TestGroupedChart from "../src/services/chart/charts/test-grouped.js"; +import TestIntersectionChart from "../src/services/chart/charts/test-intersection.js"; +import TestUniqueChart from "../src/services/chart/charts/test-unique.js"; +import TestChart from "../src/services/chart/charts/test.js"; describe("Chart", () => { let testChart: TestChart; diff --git a/packages/backend/test/fetch-resource.ts b/packages/backend/test/fetch-resource.ts index da3116f0e8..00c0d736ef 100644 --- a/packages/backend/test/fetch-resource.ts +++ b/packages/backend/test/fetch-resource.ts @@ -5,13 +5,13 @@ import * as childProcess from "child_process"; import * as openapi from "@redocly/openapi-core"; import { async, - startServer, - signup, + port, post, request, - simpleGet, - port, shutdownServer, + signup, + simpleGet, + startServer, } from "./utils.js"; // Request Accept diff --git a/packages/backend/test/ff-visibility.ts b/packages/backend/test/ff-visibility.ts index f898926d99..efdbe7f0f6 100644 --- a/packages/backend/test/ff-visibility.ts +++ b/packages/backend/test/ff-visibility.ts @@ -4,14 +4,14 @@ import * as assert from "assert"; import * as childProcess from "child_process"; import { async, - signup, - request, + connectStream, post, react, - connectStream, - startServer, + request, shutdownServer, + signup, simpleGet, + startServer, } from "./utils.js"; describe("FF visibility", () => { diff --git a/packages/backend/test/get-file-info.ts b/packages/backend/test/get-file-info.ts index 22dc28c8e0..b1092af278 100644 --- a/packages/backend/test/get-file-info.ts +++ b/packages/backend/test/get-file-info.ts @@ -1,6 +1,6 @@ import * as assert from "assert"; -import { fileURLToPath } from "node:url"; import { dirname } from "node:path"; +import { fileURLToPath } from "node:url"; import { getFileInfo } from "../src/misc/get-file-info.js"; import { async } from "./utils.js"; diff --git a/packages/backend/test/mfm.ts b/packages/backend/test/mfm.ts index 926bdd259d..81ed95848a 100644 --- a/packages/backend/test/mfm.ts +++ b/packages/backend/test/mfm.ts @@ -1,8 +1,8 @@ import * as assert from "assert"; import * as mfm from "mfm-js"; -import { toHtml } from "../src/mfm/to-html.js"; import { fromHtml } from "../src/mfm/from-html.js"; +import { toHtml } from "../src/mfm/to-html.js"; describe("toHtml", () => { it("br", () => { diff --git a/packages/backend/test/mute.ts b/packages/backend/test/mute.ts index c511628342..831c2c1ee4 100644 --- a/packages/backend/test/mute.ts +++ b/packages/backend/test/mute.ts @@ -4,12 +4,12 @@ import * as assert from "assert"; import * as childProcess from "child_process"; import { async, - signup, - request, post, react, - startServer, + request, shutdownServer, + signup, + startServer, waitFire, } from "./utils.js"; diff --git a/packages/backend/test/note.ts b/packages/backend/test/note.ts index 3af4b88d87..b78138b1ed 100644 --- a/packages/backend/test/note.ts +++ b/packages/backend/test/note.ts @@ -4,15 +4,15 @@ import * as assert from "assert"; import * as childProcess from "child_process"; import { Note } from "../src/models/entities/note.js"; import { - async, - signup, - request, - post, - uploadUrl, - startServer, - shutdownServer, - initTestDb, api, + async, + initTestDb, + post, + request, + shutdownServer, + signup, + startServer, + uploadUrl, } from "./utils.js"; describe("Note", () => { diff --git a/packages/backend/test/streaming.ts b/packages/backend/test/streaming.ts index 3292c66e17..37171f4184 100644 --- a/packages/backend/test/streaming.ts +++ b/packages/backend/test/streaming.ts @@ -4,13 +4,13 @@ import * as assert from "assert"; import * as childProcess from "child_process"; import { Following } from "../src/models/entities/following.js"; import { - connectStream, - signup, api, - post, - startServer, - shutdownServer, + connectStream, initTestDb, + post, + shutdownServer, + signup, + startServer, waitFire, } from "./utils.js"; diff --git a/packages/backend/test/thread-mute.ts b/packages/backend/test/thread-mute.ts index 9b3bb8dfe4..88483b51c8 100644 --- a/packages/backend/test/thread-mute.ts +++ b/packages/backend/test/thread-mute.ts @@ -4,13 +4,13 @@ import * as assert from "assert"; import * as childProcess from "child_process"; import { async, - signup, - request, + connectStream, post, react, - connectStream, - startServer, + request, shutdownServer, + signup, + startServer, } from "./utils.js"; describe("Note thread mute", () => { diff --git a/packages/backend/test/user-notes.ts b/packages/backend/test/user-notes.ts index 86a541c101..cdf5e7dbbb 100644 --- a/packages/backend/test/user-notes.ts +++ b/packages/backend/test/user-notes.ts @@ -4,12 +4,12 @@ import * as assert from "assert"; import * as childProcess from "child_process"; import { async, - signup, - request, post, - uploadUrl, - startServer, + request, shutdownServer, + signup, + startServer, + uploadUrl, } from "./utils.js"; describe("users/notes", () => { diff --git a/packages/backend/test/utils.ts b/packages/backend/test/utils.ts index ff2dd79de9..3c8449fb58 100644 --- a/packages/backend/test/utils.ts +++ b/packages/backend/test/utils.ts @@ -1,18 +1,18 @@ -import * as fs from "node:fs"; -import * as path from "node:path"; -import { fileURLToPath } from "node:url"; -import { dirname } from "node:path"; import * as childProcess from "child_process"; -import * as http from "node:http"; import { SIGKILL } from "constants"; -import WebSocket from "ws"; +import * as fs from "node:fs"; +import * as http from "node:http"; +import * as path from "node:path"; +import { dirname } from "node:path"; +import { fileURLToPath } from "node:url"; import * as firefish from "firefish-js"; -import fetch from "node-fetch"; import FormData from "form-data"; +import got from "got"; +import fetch from "node-fetch"; import { DataSource } from "typeorm"; +import WebSocket from "ws"; import loadConfig from "../src/config/load.js"; import { entities } from "../src/db/postgre.js"; -import got from "got"; const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index c91259d127..562a9e5422 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -1,12 +1,12 @@ -import { defineAsyncComponent } from "vue"; import type * as firefish from "firefish-js"; +import { defineAsyncComponent } from "vue"; import { i18n } from "./i18n"; -import { del, get, set } from "@/scripts/idb-proxy"; import { apiUrl } from "@/config"; import { alert, api, popup, popupMenu, waiting } from "@/os"; -import { reloadChannel, unisonReload } from "@/scripts/unison-reload"; -import icon from "@/scripts/icon"; import { $i } from "@/reactiveAccount"; +import icon from "@/scripts/icon"; +import { del, get, set } from "@/scripts/idb-proxy"; +import { reloadChannel, unisonReload } from "@/scripts/unison-reload"; // TODO: 他のタブと永続化されたstateを同期 diff --git a/packages/client/src/components/MkChatPreview.vue b/packages/client/src/components/MkChatPreview.vue index 27db671bd5..b309c8b002 100644 --- a/packages/client/src/components/MkChatPreview.vue +++ b/packages/client/src/components/MkChatPreview.vue @@ -22,8 +22,8 @@ message.groupId ? message.user : isMe(message) - ? message.recipient - : message.user + ? message.recipient + : message.user " :show-indicator="true" disable-link diff --git a/packages/client/src/components/MkDialog.vue b/packages/client/src/components/MkDialog.vue index a940f7d010..2659f139b8 100644 --- a/packages/client/src/components/MkDialog.vue +++ b/packages/client/src/components/MkDialog.vue @@ -327,8 +327,8 @@ async function ok() { const result = props.input ? inputValue.value : props.select - ? selectedValue.value - : true; + ? selectedValue.value + : true; done(false, result); } diff --git a/packages/client/src/components/MkDriveSelectDialog.vue b/packages/client/src/components/MkDriveSelectDialog.vue index af40dc8490..1047acce97 100644 --- a/packages/client/src/components/MkDriveSelectDialog.vue +++ b/packages/client/src/components/MkDriveSelectDialog.vue @@ -17,8 +17,8 @@ ? i18n.ts.selectFiles : i18n.ts.selectFolders : type === "file" - ? i18n.ts.selectFile - : i18n.ts.selectFolder + ? i18n.ts.selectFile + : i18n.ts.selectFolder }} >(); diff --git a/packages/client/src/components/MkMedia.vue b/packages/client/src/components/MkMedia.vue index 24db8d4e74..dad2f9e77d 100644 --- a/packages/client/src/components/MkMedia.vue +++ b/packages/client/src/components/MkMedia.vue @@ -113,9 +113,9 @@ const url = props.raw || defaultStore.state.loadRawImages ? props.media.url : defaultStore.state.disableShowingAnimatedImages && - props.media.type.startsWith("image") - ? getStaticImageUrl(props.media.thumbnailUrl) - : props.media.thumbnailUrl; + props.media.type.startsWith("image") + ? getStaticImageUrl(props.media.thumbnailUrl) + : props.media.thumbnailUrl; const mediaType = computed(() => { return props.media.type === "video/quicktime" diff --git a/packages/client/src/components/MkModal.vue b/packages/client/src/components/MkModal.vue index 893cced0d5..f6b52a626c 100644 --- a/packages/client/src/components/MkModal.vue +++ b/packages/client/src/components/MkModal.vue @@ -169,22 +169,22 @@ const transitionName = computed(() => ? useSendAnime.value ? "send" : type.value === "drawer" - ? "modal-drawer" - : type.value === "popup" - ? "modal-popup" - : "modal" + ? "modal-drawer" + : type.value === "popup" + ? "modal-popup" + : "modal" : "", ); const transitionDuration = computed(() => transitionName.value === "send" ? 400 : transitionName.value === "modal-popup" - ? 100 - : transitionName.value === "modal" - ? 200 - : transitionName.value === "modal-drawer" - ? 200 - : 0, + ? 100 + : transitionName.value === "modal" + ? 200 + : transitionName.value === "modal-drawer" + ? 200 + : 0, ); let contentClicking = false; diff --git a/packages/client/src/components/MkModalWindow.vue b/packages/client/src/components/MkModalWindow.vue index 1a2b3db85e..cab0f07a79 100644 --- a/packages/client/src/components/MkModalWindow.vue +++ b/packages/client/src/components/MkModalWindow.vue @@ -17,8 +17,8 @@ ? `${props.height}px` : null : height - ? `min(${props.height}px, 100%)` - : '100%', + ? `min(${props.height}px, 100%)` + : '100%', }" tabindex="-1" > diff --git a/packages/client/src/components/MkPagination.vue b/packages/client/src/components/MkPagination.vue index f06e8a11d9..17d2ef3e7a 100644 --- a/packages/client/src/components/MkPagination.vue +++ b/packages/client/src/components/MkPagination.vue @@ -259,12 +259,12 @@ const fetchMore = async (): Promise => { offset: offset.value, } : props.pagination.reversed - ? { - sinceId: items.value[0].id, - } - : { - untilId: items.value[items.value.length - 1].id, - }), + ? { + sinceId: items.value[0].id, + } + : { + untilId: items.value[items.value.length - 1].id, + }), }) .then( (res) => { @@ -320,12 +320,12 @@ const fetchMoreAhead = async (): Promise => { offset: offset.value, } : props.pagination.reversed - ? { - untilId: items.value[0].id, - } - : { - sinceId: items.value[items.value.length - 1].id, - }), + ? { + untilId: items.value[0].id, + } + : { + sinceId: items.value[items.value.length - 1].id, + }), }) .then( (res) => { diff --git a/packages/client/src/components/MkPoll.vue b/packages/client/src/components/MkPoll.vue index 21540ba454..48211f1712 100644 --- a/packages/client/src/components/MkPoll.vue +++ b/packages/client/src/components/MkPoll.vue @@ -81,10 +81,10 @@ const timer = computed(() => remaining.value >= 86400 ? "_poll.remainingDays" : remaining.value >= 3600 - ? "_poll.remainingHours" - : remaining.value >= 60 - ? "_poll.remainingMinutes" - : "_poll.remainingSeconds", + ? "_poll.remainingHours" + : remaining.value >= 60 + ? "_poll.remainingMinutes" + : "_poll.remainingSeconds", { s: Math.floor(remaining.value % 60), m: Math.floor(remaining.value / 60) % 60, diff --git a/packages/client/src/components/MkPollEditor.vue b/packages/client/src/components/MkPollEditor.vue index d6dcd75b31..622ac7fd98 100644 --- a/packages/client/src/components/MkPollEditor.vue +++ b/packages/client/src/components/MkPollEditor.vue @@ -171,8 +171,8 @@ function get() { ...(expiration.value === "at" ? { expiresAt: calcAt() } : expiration.value === "after" - ? { expiredAfter: calcAfter() } - : {}), + ? { expiredAfter: calcAfter() } + : {}), }; } diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index a3d7b46667..490d75bab6 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -72,8 +72,8 @@ reply ? 'ph-arrow-u-up-left' : renote - ? 'ph-quotes' - : 'ph-paper-plane-tilt', + ? 'ph-quotes' + : 'ph-paper-plane-tilt', ) " > @@ -401,10 +401,10 @@ const submitText = computed((): string => { return props.editId ? i18n.ts.edit : props.renote - ? i18n.ts.quote - : props.reply - ? i18n.ts.reply - : i18n.ts.note; + ? i18n.ts.quote + : props.reply + ? i18n.ts.reply + : i18n.ts.note; }); const textLength = computed((): number => { @@ -473,8 +473,8 @@ if (props.reply && props.reply.text != null) { const mention = x.host ? `@${x.username}@${toASCII(x.host)}` : otherHost == null || otherHost === host - ? `@${x.username}` - : `@${x.username}@${toASCII(otherHost)}`; + ? `@${x.username}` + : `@${x.username}@${toASCII(otherHost)}`; // 自分は除外 if ($i.username === x.username && (x.host == null || x.host === host)) @@ -868,8 +868,8 @@ async function post() { renoteId: props.renote ? props.renote.id : quoteId.value - ? quoteId.value - : undefined, + ? quoteId.value + : undefined, channelId: props.channel ? props.channel.id : undefined, poll: poll.value, cw: useCw.value ? cw.value || "" : undefined, diff --git a/packages/client/src/components/MkSignup.vue b/packages/client/src/components/MkSignup.vue index ff41c5a5d9..9340d9af92 100644 --- a/packages/client/src/components/MkSignup.vue +++ b/packages/client/src/components/MkSignup.vue @@ -371,10 +371,10 @@ function onChangeUsername(): void { const err = !username.value.match(/^[a-zA-Z0-9_]+$/) ? "invalid-format" : username.value.length < 1 - ? "min-range" - : username.value.length > 20 - ? "max-range" - : null; + ? "min-range" + : username.value.length > 20 + ? "max-range" + : null; if (err) { usernameState.value = err; @@ -410,16 +410,16 @@ function onChangeEmail(): void { emailState.value = result.available ? "ok" : result.reason === "used" - ? "unavailable:used" - : result.reason === "format" - ? "unavailable:format" - : result.reason === "disposable" - ? "unavailable:disposable" - : result.reason === "mx" - ? "unavailable:mx" - : result.reason === "smtp" - ? "unavailable:smtp" - : "unavailable"; + ? "unavailable:used" + : result.reason === "format" + ? "unavailable:format" + : result.reason === "disposable" + ? "unavailable:disposable" + : result.reason === "mx" + ? "unavailable:mx" + : result.reason === "smtp" + ? "unavailable:smtp" + : "unavailable"; }) .catch(() => { emailState.value = "error"; diff --git a/packages/client/src/components/global/MkTime.vue b/packages/client/src/components/global/MkTime.vue index 8e25b6d78a..e235684584 100644 --- a/packages/client/src/components/global/MkTime.vue +++ b/packages/client/src/components/global/MkTime.vue @@ -29,11 +29,11 @@ const _time = props.time == null ? NaN : typeof props.time === "number" - ? props.time - : (props.time instanceof Date - ? props.time - : new Date(props.time) - ).getTime(); + ? props.time + : (props.time instanceof Date + ? props.time + : new Date(props.time) + ).getTime(); const invalid = Number.isNaN(_time); const absolute = !invalid ? dateTimeFormat.format(_time) : i18n.ts._ago.invalid; @@ -46,20 +46,30 @@ const relative = computed(() => { return ago >= 31536000 ? i18n.t("_ago.yearsAgo", { n: Math.floor(ago / 31536000).toString() }) : ago >= 2592000 - ? i18n.t("_ago.monthsAgo", { n: Math.floor(ago / 2592000).toString() }) - : ago >= 604800 - ? i18n.t("_ago.weeksAgo", { n: Math.floor(ago / 604800).toString() }) - : ago >= 86400 - ? i18n.t("_ago.daysAgo", { n: Math.floor(ago / 86400).toString() }) - : ago >= 3600 - ? i18n.t("_ago.hoursAgo", { n: Math.floor(ago / 3600).toString() }) - : ago >= 60 - ? i18n.t("_ago.minutesAgo", { n: (~~(ago / 60)).toString() }) - : ago >= 10 - ? i18n.t("_ago.secondsAgo", { n: (~~(ago % 60)).toString() }) - : ago >= -1 - ? i18n.ts._ago.justNow - : i18n.ts._ago.future; + ? i18n.t("_ago.monthsAgo", { + n: Math.floor(ago / 2592000).toString(), + }) + : ago >= 604800 + ? i18n.t("_ago.weeksAgo", { + n: Math.floor(ago / 604800).toString(), + }) + : ago >= 86400 + ? i18n.t("_ago.daysAgo", { + n: Math.floor(ago / 86400).toString(), + }) + : ago >= 3600 + ? i18n.t("_ago.hoursAgo", { + n: Math.floor(ago / 3600).toString(), + }) + : ago >= 60 + ? i18n.t("_ago.minutesAgo", { n: (~~(ago / 60)).toString() }) + : ago >= 10 + ? i18n.t("_ago.secondsAgo", { + n: (~~(ago % 60)).toString(), + }) + : ago >= -1 + ? i18n.ts._ago.justNow + : i18n.ts._ago.future; }); let tickId: number; diff --git a/packages/client/src/directives/ripple.ts b/packages/client/src/directives/ripple.ts index efbc5ee5aa..bf364d1268 100644 --- a/packages/client/src/directives/ripple.ts +++ b/packages/client/src/directives/ripple.ts @@ -1,6 +1,6 @@ +import type { Ref } from "vue"; import Ripple from "@/components/MkRipple.vue"; import { popup } from "@/os"; -import type { Ref } from "vue"; export default { mounted(el: HTMLElement, binding: Ref) { diff --git a/packages/client/src/filters/note.ts b/packages/client/src/filters/note.ts index c3f0d6ade1..3f7294634e 100644 --- a/packages/client/src/filters/note.ts +++ b/packages/client/src/filters/note.ts @@ -1,4 +1,4 @@ -import { entities } from "firefish-js"; +import type { entities } from "firefish-js"; export const notePage = (note: entities.Note) => { return `/notes/${note.id}`; diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index 637e5aafaf..b758b4c99e 100644 --- a/packages/client/src/init.ts +++ b/packages/client/src/init.ts @@ -7,11 +7,11 @@ import "vite/modulepreload-polyfill"; import "@/style.scss"; -import "@phosphor-icons/web/fill"; import "@phosphor-icons/web/bold"; -import "@phosphor-icons/web/regular"; -import "@phosphor-icons/web/light"; import "@phosphor-icons/web/duotone"; +import "@phosphor-icons/web/fill"; +import "@phosphor-icons/web/light"; +import "@phosphor-icons/web/regular"; // #region account indexedDB migration @@ -22,6 +22,7 @@ if (accounts) { } // #endregion +import { compareVersions } from "compare-versions"; import { computed, createApp, @@ -30,31 +31,30 @@ import { version as vueVersion, watch, } from "vue"; -import { compareVersions } from "compare-versions"; import { set } from "@/scripts/idb-proxy"; -import widgets from "@/widgets"; -import directives from "@/directives"; +import { login, refreshAccount, signout, updateAccount } from "@/account"; import components from "@/components"; import { lang, ui, version } from "@/config"; -import { applyTheme } from "@/scripts/theme"; -import { isDeviceDarkmode } from "@/scripts/is-device-darkmode"; +import directives from "@/directives"; import { i18n } from "@/i18n"; -import { alert, api, confirm, popup, post, toast } from "@/os"; -import { stream } from "@/stream"; -import * as sound from "@/scripts/sound"; -import { login, refreshAccount, signout, updateAccount } from "@/account"; -import { $i } from "@/reactiveAccount"; -import { ColdDeviceStorage, defaultStore } from "@/store"; import { fetchInstance, instance } from "@/instance"; -import { makeHotkey } from "@/scripts/hotkey"; -import { search } from "@/scripts/search"; +import { alert, api, confirm, popup, post, toast } from "@/os"; +import { $i } from "@/reactiveAccount"; import { deviceKind } from "@/scripts/device-kind"; -import { initializeSw } from "@/scripts/initialize-sw"; -import { reloadChannel } from "@/scripts/unison-reload"; -import { reactionPicker } from "@/scripts/reaction-picker"; -import { getUrlWithoutLoginId } from "@/scripts/login-id"; import { getAccountFromId } from "@/scripts/get-account-from-id"; +import { makeHotkey } from "@/scripts/hotkey"; +import { initializeSw } from "@/scripts/initialize-sw"; +import { isDeviceDarkmode } from "@/scripts/is-device-darkmode"; +import { getUrlWithoutLoginId } from "@/scripts/login-id"; +import { reactionPicker } from "@/scripts/reaction-picker"; +import { search } from "@/scripts/search"; +import * as sound from "@/scripts/sound"; +import { applyTheme } from "@/scripts/theme"; +import { reloadChannel } from "@/scripts/unison-reload"; +import { ColdDeviceStorage, defaultStore } from "@/store"; +import { stream } from "@/stream"; +import widgets from "@/widgets"; function checkForSplash() { const splash = document.getElementById("splash"); diff --git a/packages/client/src/instance.ts b/packages/client/src/instance.ts index 783cb01ad6..493baeb94b 100644 --- a/packages/client/src/instance.ts +++ b/packages/client/src/instance.ts @@ -1,5 +1,5 @@ -import { computed, reactive } from "vue"; import type * as firefish from "firefish-js"; +import { computed, reactive } from "vue"; import { api } from "./os"; // TODO: 他のタブと永続化されたstateを同期 diff --git a/packages/client/src/navbar.ts b/packages/client/src/navbar.ts index 3021359e41..55cfab5bba 100644 --- a/packages/client/src/navbar.ts +++ b/packages/client/src/navbar.ts @@ -1,11 +1,11 @@ import { computed, reactive } from "vue"; -import { $i } from "@/reactiveAccount"; -import { search } from "@/scripts/search"; -import * as os from "@/os"; -import { i18n } from "@/i18n"; import { ui } from "@/config"; -import { unisonReload } from "@/scripts/unison-reload"; +import { i18n } from "@/i18n"; +import * as os from "@/os"; +import { $i } from "@/reactiveAccount"; import icon from "@/scripts/icon"; +import { search } from "@/scripts/search"; +import { unisonReload } from "@/scripts/unison-reload"; export const navbarItemDef = reactive({ notifications: { diff --git a/packages/client/src/nirax.ts b/packages/client/src/nirax.ts index 0ce413d393..800d47042c 100644 --- a/packages/client/src/nirax.ts +++ b/packages/client/src/nirax.ts @@ -3,8 +3,8 @@ import { EventEmitter } from "eventemitter3"; import type { Component, ShallowRef } from "vue"; import { shallowRef } from "vue"; -import { pleaseLogin } from "@/scripts/please-login"; import { safeURIDecode } from "@/scripts/safe-uri-decode"; +import { pleaseLogin } from "@/scripts/please-login"; interface RouteDef { path: string; @@ -112,7 +112,7 @@ export class Router extends EventEmitter<{ let parts = [..._parts]; const props = new Map(); - pathMatchLoop: for (const p of parsePath(route.path)) { + for (const p of parsePath(route.path)) { if (typeof p === "string") { if (p === parts[0]) { parts.shift(); @@ -128,7 +128,7 @@ export class Router extends EventEmitter<{ props.set(p.name, safeURIDecode(parts.join("/"))); parts = []; } - break pathMatchLoop; + break; } else { if (p.startsWith) { if (parts[0] == null || !parts[0].startsWith(p.startsWith)) @@ -159,7 +159,7 @@ export class Router extends EventEmitter<{ child, }; } else { - continue forEachRouteLoop; + continue; } } diff --git a/packages/client/src/os.ts b/packages/client/src/os.ts index 0baefc68a9..d367dc2fc9 100644 --- a/packages/client/src/os.ts +++ b/packages/client/src/os.ts @@ -1,18 +1,18 @@ // TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する +import { EventEmitter } from "eventemitter3"; +import * as firefish from "firefish-js"; +import insertTextAtCursor from "insert-text-at-cursor"; import type { Component, Ref } from "vue"; import { defineAsyncComponent, markRaw, ref } from "vue"; -import { EventEmitter } from "eventemitter3"; -import insertTextAtCursor from "insert-text-at-cursor"; -import * as firefish from "firefish-js"; import { i18n } from "./i18n"; -import { apiUrl, url } from "@/config"; -import MkPostFormDialog from "@/components/MkPostFormDialog.vue"; -import MkWaitingDialog from "@/components/MkWaitingDialog.vue"; -import MkToast from "@/components/MkToast.vue"; import MkDialog from "@/components/MkDialog.vue"; -import type { MenuItem } from "@/types/menu"; +import MkPostFormDialog from "@/components/MkPostFormDialog.vue"; +import MkToast from "@/components/MkToast.vue"; +import MkWaitingDialog from "@/components/MkWaitingDialog.vue"; +import { apiUrl, url } from "@/config"; import { $i } from "@/reactiveAccount"; +import type { MenuItem } from "@/types/menu"; export const pendingApiRequestsCount = ref(0); diff --git a/packages/client/src/pages/about.federation.vue b/packages/client/src/pages/about.federation.vue index 163166a382..d2d00dce27 100644 --- a/packages/client/src/pages/about.federation.vue +++ b/packages/client/src/pages/about.federation.vue @@ -127,18 +127,18 @@ const pagination = { ...(state.value === "federating" ? { federating: true } : state.value === "subscribing" - ? { subscribing: true } - : state.value === "publishing" - ? { publishing: true } - : state.value === "suspended" - ? { suspended: true } - : state.value === "blocked" - ? { blocked: true } - : state.value === "silenced" - ? { silenced: true } - : state.value === "notResponding" - ? { notResponding: true } - : {}), + ? { subscribing: true } + : state.value === "publishing" + ? { publishing: true } + : state.value === "suspended" + ? { suspended: true } + : state.value === "blocked" + ? { blocked: true } + : state.value === "silenced" + ? { silenced: true } + : state.value === "notResponding" + ? { notResponding: true } + : {}), })), }; diff --git a/packages/client/src/pages/admin/bot-protection.vue b/packages/client/src/pages/admin/bot-protection.vue index 54d1b2ae11..0114aa3993 100644 --- a/packages/client/src/pages/admin/bot-protection.vue +++ b/packages/client/src/pages/admin/bot-protection.vue @@ -105,8 +105,8 @@ async function init() { provider.value = meta.enableHcaptcha ? "hcaptcha" : meta.enableRecaptcha - ? "recaptcha" - : null; + ? "recaptcha" + : null; } function save() { diff --git a/packages/client/src/pages/admin/overview.queue.chart.vue b/packages/client/src/pages/admin/overview.queue.chart.vue index 2e9195e205..6482d99db7 100644 --- a/packages/client/src/pages/admin/overview.queue.chart.vue +++ b/packages/client/src/pages/admin/overview.queue.chart.vue @@ -51,23 +51,23 @@ const label = props.type === "process" ? "Process" : props.type === "active" - ? "Active" - : props.type === "delayed" - ? "Delayed" - : props.type === "waiting" - ? "Waiting" - : ("?" as never); + ? "Active" + : props.type === "delayed" + ? "Delayed" + : props.type === "waiting" + ? "Waiting" + : ("?" as never); const color = props.type === "process" ? "#c4a7e7" : props.type === "active" - ? "#31748f" - : props.type === "delayed" - ? "#eb6f92" - : props.type === "waiting" - ? "#f6c177" - : ("?" as never); + ? "#31748f" + : props.type === "delayed" + ? "#eb6f92" + : props.type === "waiting" + ? "#f6c177" + : ("?" as never); onMounted(() => { const vLineColor = defaultStore.state.darkMode diff --git a/packages/client/src/pages/admin/queue.chart.chart.vue b/packages/client/src/pages/admin/queue.chart.chart.vue index bd7b781cbb..fd3edea98d 100644 --- a/packages/client/src/pages/admin/queue.chart.chart.vue +++ b/packages/client/src/pages/admin/queue.chart.chart.vue @@ -96,23 +96,23 @@ const label = props.type === "process" ? "Process" : props.type === "active" - ? "Active" - : props.type === "delayed" - ? "Delayed" - : props.type === "waiting" - ? "Waiting" - : ("?" as never); + ? "Active" + : props.type === "delayed" + ? "Delayed" + : props.type === "waiting" + ? "Waiting" + : ("?" as never); const color = props.type === "process" ? "#9ccfd8" : props.type === "active" - ? "#31748f" - : props.type === "delayed" - ? "#eb6f92" - : props.type === "waiting" - ? "#f6c177" - : ("?" as never); + ? "#31748f" + : props.type === "delayed" + ? "#eb6f92" + : props.type === "waiting" + ? "#f6c177" + : ("?" as never); onMounted(() => { chartInstance = new Chart(chartEl.value, { diff --git a/packages/client/src/pages/admin/queue.chart.vue b/packages/client/src/pages/admin/queue.chart.vue index fad0deb6ca..cb10e27e7f 100644 --- a/packages/client/src/pages/admin/queue.chart.vue +++ b/packages/client/src/pages/admin/queue.chart.vue @@ -117,8 +117,8 @@ onMounted(() => { props.domain === "inbox" ? "admin/queue/inbox-delayed" : props.domain === "deliver" - ? "admin/queue/deliver-delayed" - : null, + ? "admin/queue/deliver-delayed" + : null, {}, ).then((result) => { jobs.value = result; diff --git a/packages/client/src/pages/admin/security.vue b/packages/client/src/pages/admin/security.vue index dd8eff4fe4..7522b53d8a 100644 --- a/packages/client/src/pages/admin/security.vue +++ b/packages/client/src/pages/admin/security.vue @@ -290,14 +290,14 @@ async function init() { meta.sensitiveMediaDetectionSensitivity === "veryLow" ? 0 : meta.sensitiveMediaDetectionSensitivity === "low" - ? 1 - : meta.sensitiveMediaDetectionSensitivity === "medium" - ? 2 - : meta.sensitiveMediaDetectionSensitivity === "high" - ? 3 - : meta.sensitiveMediaDetectionSensitivity === "veryHigh" - ? 4 - : 0; + ? 1 + : meta.sensitiveMediaDetectionSensitivity === "medium" + ? 2 + : meta.sensitiveMediaDetectionSensitivity === "high" + ? 3 + : meta.sensitiveMediaDetectionSensitivity === "veryHigh" + ? 4 + : 0; setSensitiveFlagAutomatically.value = meta.setSensitiveFlagAutomatically; enableSensitiveMediaDetectionForVideos.value = meta.enableSensitiveMediaDetectionForVideos; @@ -317,14 +317,14 @@ function save() { sensitiveMediaDetectionSensitivity.value === 0 ? "veryLow" : sensitiveMediaDetectionSensitivity.value === 1 - ? "low" - : sensitiveMediaDetectionSensitivity.value === 2 - ? "medium" - : sensitiveMediaDetectionSensitivity.value === 3 - ? "high" - : sensitiveMediaDetectionSensitivity.value === 4 - ? "veryHigh" - : 0, + ? "low" + : sensitiveMediaDetectionSensitivity.value === 2 + ? "medium" + : sensitiveMediaDetectionSensitivity.value === 3 + ? "high" + : sensitiveMediaDetectionSensitivity.value === 4 + ? "veryHigh" + : 0, setSensitiveFlagAutomatically: setSensitiveFlagAutomatically.value, enableSensitiveMediaDetectionForVideos: enableSensitiveMediaDetectionForVideos.value, diff --git a/packages/client/src/pages/api-console.vue b/packages/client/src/pages/api-console.vue index 63957c115f..083db86ce0 100644 --- a/packages/client/src/pages/api-console.vue +++ b/packages/client/src/pages/api-console.vue @@ -98,14 +98,14 @@ function onEndpointChange() { p.type === "String" ? "" : p.type === "Number" - ? 0 - : p.type === "Boolean" - ? false - : p.type === "Array" - ? [] - : p.type === "Object" - ? {} - : null; + ? 0 + : p.type === "Boolean" + ? false + : p.type === "Array" + ? [] + : p.type === "Object" + ? {} + : null; } body.value = JSON5.stringify(endpointBody, null, 2); }); diff --git a/packages/client/src/pages/attached-files.vue b/packages/client/src/pages/attached-files.vue index e0fd09d419..91528b981a 100644 --- a/packages/client/src/pages/attached-files.vue +++ b/packages/client/src/pages/attached-files.vue @@ -5,7 +5,7 @@ />
- +
diff --git a/packages/client/src/pages/settings/plugin.install.vue b/packages/client/src/pages/settings/plugin.install.vue index 59d5a95343..3b736d39ec 100644 --- a/packages/client/src/pages/settings/plugin.install.vue +++ b/packages/client/src/pages/settings/plugin.install.vue @@ -21,6 +21,7 @@ import { defineAsyncComponent, nextTick, ref } from "vue"; import { Interpreter, Parser, utils } from "@syuilo/aiscript"; import { v4 as uuid } from "uuid"; +import { compareVersions } from "compare-versions"; import FormTextarea from "@/components/form/textarea.vue"; import FormButton from "@/components/MkButton.vue"; import FormInfo from "@/components/MkInfo.vue"; @@ -29,7 +30,6 @@ import { ColdDeviceStorage } from "@/store"; import { unisonReload } from "@/scripts/unison-reload"; import { i18n } from "@/i18n"; import { definePageMetadata } from "@/scripts/page-metadata"; -import { compareVersions } from "compare-versions"; import icon from "@/scripts/icon"; const code = ref(); diff --git a/packages/client/src/pages/theme-editor.vue b/packages/client/src/pages/theme-editor.vue index 527b62c470..474fe51b08 100644 --- a/packages/client/src/pages/theme-editor.vue +++ b/packages/client/src/pages/theme-editor.vue @@ -90,8 +90,8 @@ color: color.forPreview ? color.forPreview : theme.base === 'light' - ? '#5f5f5f' - : '#dadada', + ? '#5f5f5f' + : '#dadada', }" > A diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index 05dcaa6abf..af5af76d84 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -270,12 +270,12 @@ definePageMetadata( src.value === "local" ? "ph-users ph-lg" : src.value === "social" - ? "ph-handshake ph-lg" - : src.value === "recommended" - ? "ph-thumbs-up ph-lg" - : src.value === "global" - ? "ph-planet ph-lg" - : "ph-house ph-lg", + ? "ph-handshake ph-lg" + : src.value === "recommended" + ? "ph-thumbs-up ph-lg" + : src.value === "global" + ? "ph-planet ph-lg" + : "ph-house ph-lg", })), ); diff --git a/packages/client/src/plugin.ts b/packages/client/src/plugin.ts index 44df90ff08..c38aaa365a 100644 --- a/packages/client/src/plugin.ts +++ b/packages/client/src/plugin.ts @@ -1,6 +1,6 @@ import { Interpreter, Parser, utils, values } from "@syuilo/aiscript"; -import { createAiScriptEnv } from "@/scripts/aiscript/api"; import { inputText } from "@/os"; +import { createAiScriptEnv } from "@/scripts/aiscript/api"; import { noteActions, notePostInterruptors, @@ -114,7 +114,10 @@ function createPluginEnv(opts) { }); }), "Plugin:register_page_view_interruptor": values.FN_NATIVE(([handler]) => { - registerPageViewInterruptor({ pluginId: opts.plugin.id, handler }); + registerPageViewInterruptor({ + pluginId: opts.plugin.id, + handler, + }); }), "Plugin:open_url": values.FN_NATIVE(([url]) => { window.open(url.value, "_blank"); diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 2f7446e68b..5dff5a4ba8 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -1,10 +1,10 @@ import type { AsyncComponentLoader } from "vue"; import { defineAsyncComponent, inject } from "vue"; -import { Router } from "@/nirax"; import { iAmModerator } from "@/account"; -import { $i } from "@/reactiveAccount"; -import MkLoading from "@/pages/_loading_.vue"; +import { Router } from "@/nirax"; import MkError from "@/pages/_error_.vue"; +import MkLoading from "@/pages/_loading_.vue"; +import { $i } from "@/reactiveAccount"; // import { api } from "@/os"; // function getGuestTimelineStatus() { diff --git a/packages/client/src/scripts/autocomplete.ts b/packages/client/src/scripts/autocomplete.ts index 0d5d16f180..18e56ba38d 100644 --- a/packages/client/src/scripts/autocomplete.ts +++ b/packages/client/src/scripts/autocomplete.ts @@ -88,7 +88,11 @@ export class Autocomplete { const isHashtag = hashtagIndex !== -1; const isMfmTag = mfmTagIndex !== -1; const isEmoji = - emojiIndex !== -1 && text.split(/:[a-z0-9_+\-]+:/).pop()!.includes(":"); + emojiIndex !== -1 && + text + .split(/:[a-z0-9_+\-]+:/) + .pop()! + .includes(":"); let opened = false; diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index 39dd533785..48885bac62 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -385,11 +385,11 @@ interface Plugin { ast: any[]; } +import darkTheme from "@/themes/d-rosepine.json5"; /** * Storage for configuration information that does not need to be constantly loaded into memory (non-reactive) */ import lightTheme from "@/themes/l-rosepinedawn.json5"; -import darkTheme from "@/themes/d-rosepine.json5"; export class ColdDeviceStorage { public static default = { diff --git a/packages/client/src/stream.ts b/packages/client/src/stream.ts index 28a8a26650..f0dd1879a2 100644 --- a/packages/client/src/stream.ts +++ b/packages/client/src/stream.ts @@ -1,7 +1,7 @@ import * as firefish from "firefish-js"; import { markRaw } from "vue"; -import { $i } from "@/reactiveAccount"; import { url } from "@/config"; +import { $i } from "@/reactiveAccount"; export const stream = markRaw( new firefish.Stream( diff --git a/packages/client/src/widgets/aiscript.vue b/packages/client/src/widgets/aiscript.vue index 0f1469a0c1..a00f143d85 100644 --- a/packages/client/src/widgets/aiscript.vue +++ b/packages/client/src/widgets/aiscript.vue @@ -28,12 +28,12 @@