diff --git a/package.json b/package.json index 0203670c4..c0c0918f1 100644 --- a/package.json +++ b/package.json @@ -46,14 +46,14 @@ "seedrandom": "^3.0.5" }, "devDependencies": { - "@biomejs/biome": "1.0.0", - "@biomejs/cli-darwin-arm64": "^1.0.0", - "@biomejs/cli-darwin-x64": "^1.0.0", - "@biomejs/cli-linux-arm64": "^1.0.0", - "@biomejs/cli-linux-x64": "^1.0.0", - "@types/gulp": "4.0.13", - "@types/gulp-rename": "2.0.2", - "@types/node": "20.5.8", + "@biomejs/biome": "1.3.0", + "@biomejs/cli-darwin-arm64": "^1.3.0", + "@biomejs/cli-darwin-x64": "^1.3.0", + "@biomejs/cli-linux-arm64": "^1.3.0", + "@biomejs/cli-linux-x64": "^1.3.0", + "@types/gulp": "4.0.16", + "@types/gulp-rename": "2.0.4", + "@types/node": "20.8.7", "add": "2.0.6", "cross-env": "7.0.3", "cypress": "10.11.0", diff --git a/packages/backend/package.json b/packages/backend/package.json index 110b8e14e..9e891fad8 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -162,7 +162,7 @@ "@types/koa__multer": "2.0.4", "@types/koa__router": "8.0.11", "@types/mocha": "9.1.1", - "@types/node": "18.11.18", + "@types/node": "20.8.7", "@types/node-fetch": "3.0.3", "@types/nodemailer": "6.4.9", "@types/oauth": "0.9.1", diff --git a/packages/backend/src/const.ts b/packages/backend/src/const.ts index 6dddf1fff..8fc4bd25e 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 503e26eb6..6c5a22e4b 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/test/ap-request.ts b/packages/backend/test/ap-request.ts index bf77a3853..722977fe1 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 0ee4a4d33..49b1b5a06 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 19a754552..0fc2f424e 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 08192e486..100a4ab7d 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 e194c6c19..cd600f661 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 da3116f0e..00c0d736e 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 f898926d9..efdbe7f0f 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 22dc28c8e..b1092af27 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 926bdd259..81ed95848 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 c51162834..831c2c1ee 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 3af4b88d8..b78138b1e 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 3292c66e1..37171f418 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 9b3bb8dfe..88483b51c 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 86a541c10..cdf5e7dbb 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 ff2dd79de..3c8449fb5 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/package.json b/packages/client/package.json index 890aba4ab..022bde257 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -20,8 +20,8 @@ "@syuilo/aiscript": "0.11.1", "@types/escape-regexp": "0.0.1", "@types/glob": "8.1.0", - "@types/gulp": "4.0.13", - "@types/gulp-rename": "2.0.2", + "@types/gulp": "4.0.16", + "@types/gulp-rename": "2.0.4", "@types/katex": "0.16.2", "@types/matter-js": "0.19.0", "@types/punycode": "2.1.0", diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index 761ebe5e0..fd5b25514 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -1,11 +1,11 @@ -import { defineAsyncComponent, reactive } from "vue"; -import type * as firefish from "firefish-js"; -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 { del, get, set } from "@/scripts/idb-proxy"; +import { reloadChannel, unisonReload } from "@/scripts/unison-reload"; +import type * as firefish from "firefish-js"; +import { defineAsyncComponent, reactive } from "vue"; +import { i18n } from "./i18n"; // TODO: 他のタブと永続化されたstateを同期 diff --git a/packages/client/src/components/MkDialog.vue b/packages/client/src/components/MkDialog.vue index 216fb4500..79439709e 100644 --- a/packages/client/src/components/MkDialog.vue +++ b/packages/client/src/components/MkDialog.vue @@ -19,7 +19,10 @@ > import { shallowRef, watch } from "vue"; import MkModal from "@/components/MkModal.vue"; -import iconClass from "@/scripts/icon" +import iconClass from "@/scripts/icon"; const modal = shallowRef>(); diff --git a/packages/client/src/i18n.ts b/packages/client/src/i18n.ts index 5b0a7f9ed..31a6686f1 100644 --- a/packages/client/src/i18n.ts +++ b/packages/client/src/i18n.ts @@ -1,6 +1,6 @@ -import { markRaw } from "vue"; import { locale } from "@/config"; import { I18n } from "@/scripts/i18n"; +import { markRaw } from "vue"; export const i18n = markRaw(new I18n(locale)); diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index ddcdfc207..2888e5ebf 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 import { set } from "@/scripts/idb-proxy"; @@ -23,6 +23,7 @@ if (accounts) { } // #endregion +import { compareVersions } from "compare-versions"; import { computed, createApp, @@ -31,29 +32,28 @@ import { version as vueVersion, watch, } from "vue"; -import { compareVersions } from "compare-versions"; -import widgets from "@/widgets"; -import directives from "@/directives"; +import { $i, login, refreshAccount, signout, updateAccount } from "@/account"; import components from "@/components"; import { host, 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 { $i, login, refreshAccount, signout, updateAccount } from "@/account"; -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 { 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 783cb01ad..493baeb94 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 c2ab1d4d1..a917a5587 100644 --- a/packages/client/src/navbar.ts +++ b/packages/client/src/navbar.ts @@ -1,11 +1,11 @@ +import { ui } from "@/config"; +import { i18n } from "@/i18n"; +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"; import { $i } from "./account"; -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 icon from "@/scripts/icon"; export const navbarItemDef = reactive({ notifications: { diff --git a/packages/client/src/nirax.ts b/packages/client/src/nirax.ts index 43e770ec3..9f5477ea2 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 { Ref, ref, shallowRef } from "vue"; -import { pleaseLogin } from "@/scripts/please-login"; -import { safeURIDecode } from "@/scripts/safe-uri-decode"; 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 7a78e9553..a0f3d6e98 100644 --- a/packages/client/src/os.ts +++ b/packages/client/src/os.ts @@ -1,18 +1,18 @@ // TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する +import { $i } from "@/account"; +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 type { MenuItem } from "@/types/menu"; +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 { $i } from "@/account"; export const pendingApiRequestsCount = ref(0); diff --git a/packages/client/src/pages/admin/_header_.vue b/packages/client/src/pages/admin/_header_.vue index 6d2506a17..7b0b62708 100644 --- a/packages/client/src/pages/admin/_header_.vue +++ b/packages/client/src/pages/admin/_header_.vue @@ -2,7 +2,11 @@