From ebcc50634bed0c79fbca8832c73a200fc407c597 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Thu, 8 Jun 2023 11:01:00 -0700 Subject: [PATCH] chore: formatting --- packages/backend/package.json | 4 ++-- packages/backend/src/misc/fetch-meta.ts | 4 ++-- packages/backend/src/server/web/index.ts | 16 ++++++++-------- packages/client/src/components/MkMenu.vue | 6 +++++- .../pages/messaging/messaging-room.message.vue | 5 ++++- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index 0d7ea1f92..cf04b3bf7 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -15,10 +15,10 @@ "check:connect": "node ./check_connect.js", "build": "pnpm swc src -d built -D", "watch": "pnpm swc src -d built -D -w", - "lint": "pnpm rome check \"src/**/*.ts\"", + "lint": "pnpm rome check --apply *", "mocha": "cross-env NODE_ENV=test TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha", "test": "pnpm run mocha", - "format": "pnpm rome format * --write && pnpm rome check --apply *" + "format": "pnpm rome format * --write" }, "resolutions": { "chokidar": "^3.3.1" diff --git a/packages/backend/src/misc/fetch-meta.ts b/packages/backend/src/misc/fetch-meta.ts index c354ae6d9..b5426e31a 100644 --- a/packages/backend/src/misc/fetch-meta.ts +++ b/packages/backend/src/misc/fetch-meta.ts @@ -3,7 +3,7 @@ import { Meta } from "@/models/entities/meta.js"; let cache: Meta; -export function metaToPugArgs(meta: Meta) : object { +export function metaToPugArgs(meta: Meta): object { let motd = ["Loading..."]; if (meta.customMOTD.length > 0) { motd = meta.customMOTD; @@ -26,7 +26,7 @@ export function metaToPugArgs(meta: Meta) : object { themeColor: meta.themeColor, randomMOTD: motd[Math.floor(Math.random() * motd.length)], privateMode: meta.privateMode, - } + }; } export async function fetchMeta(noCache = false): Promise { diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts index 123c41d03..c6748fd80 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -367,7 +367,7 @@ const userPage: Router.Middleware = async (ctx, next) => { profile, me, avatarUrl: await Users.getAvatarUrl(user), - sub: subParam + sub: subParam, }; await ctx.render("user", userDetail); @@ -446,7 +446,7 @@ router.get("/posts/:note", async (ctx, next) => { await Users.findOneByOrFail({ id: note.userId }), ), // TODO: Let locale changeable by instance setting - summary: getNoteSummary(_note) + summary: getNoteSummary(_note), }); ctx.set("Cache-Control", "public, max-age=15"); @@ -482,7 +482,7 @@ router.get("/@:user/pages/:page", async (ctx, next) => { profile, avatarUrl: await Users.getAvatarUrl( await Users.findOneByOrFail({ id: page.userId }), - ) + ), }); if (["public"].includes(page.visibility)) { @@ -514,7 +514,7 @@ router.get("/clips/:clip", async (ctx, next) => { profile, avatarUrl: await Users.getAvatarUrl( await Users.findOneByOrFail({ id: clip.userId }), - ) + ), }); ctx.set("Cache-Control", "public, max-age=15"); @@ -539,7 +539,7 @@ router.get("/gallery/:post", async (ctx, next) => { profile, avatarUrl: await Users.getAvatarUrl( await Users.findOneByOrFail({ id: post.userId }), - ) + ), }); ctx.set("Cache-Control", "public, max-age=15"); @@ -561,7 +561,7 @@ router.get("/channels/:channel", async (ctx, next) => { const meta = await fetchMeta(); await ctx.render("channel", { ...metaToPugArgs(meta), - channel: _channel + channel: _channel, }); ctx.set("Cache-Control", "public, max-age=15"); @@ -612,9 +612,9 @@ router.get("/api/v1/streaming", async (ctx) => { // Render base html for all requests router.get("(.*)", async (ctx) => { const meta = await fetchMeta(); - + await ctx.render("base", { - ...metaToPugArgs(meta) + ...metaToPugArgs(meta), }); ctx.set("Cache-Control", "public, max-age=3"); }); diff --git a/packages/client/src/components/MkMenu.vue b/packages/client/src/components/MkMenu.vue index 978db091a..5f243a363 100644 --- a/packages/client/src/components/MkMenu.vue +++ b/packages/client/src/components/MkMenu.vue @@ -128,7 +128,11 @@