From 81275823502b4ed913b49144cbf78105d7925cb4 Mon Sep 17 00:00:00 2001 From: "zeon-neon[bot]" <136533918+zeon-neon[bot]@users.noreply.github.com> Date: Sat, 19 Apr 2025 04:41:45 +0000 Subject: [PATCH] enhancement(lint): Fix lint errors for src/modules/slackapp.ts Co-authored-by: NeonGamerBot-QK Signed-off-by: zeon-neon[bot] <136533918+zeon-neon[bot]@users.noreply.github.com> --- src/modules/slackapp.ts | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/modules/slackapp.ts b/src/modules/slackapp.ts index c33de99..56d13d1 100644 --- a/src/modules/slackapp.ts +++ b/src/modules/slackapp.ts @@ -103,8 +103,8 @@ export const app = new App({ }, }, { - "path": "/project-feed-journey.xml", - "method": ["GET"], + path: "/project-feed-journey.xml", + method: ["GET"], async handler(req, res) { // get ID query const query = new URLSearchParams(req.url.split("?")[1]); @@ -112,35 +112,38 @@ export const app = new App({ if (!id) return res.writeHead(400).end(`I cant find that project`); //@ts-ignore const entry = app.dbs.journey.get(id); - if (!entry) return res.writeHead(400).end(`I cant find that project - db`); + if (!entry) + return res.writeHead(400).end(`I cant find that project - db`); const rss = new RSS({ title: `Journey for ${id}`, site_url: `https://journey.hackclub.com/projects/${id}`, feed_url: `https://slack.mybot.saahild.com/project-feed-journey.xml?id=${id}`, description: `Journey for ${id}`, }); - const updates = entry.updates + const updates = entry.updates; for (const m of updates) { - const meta = m.meta as Update + const meta = m.meta as Update; rss.item({ title: `Update for ${new Date(meta.created_at).toLocaleDateString()}`, description: m.text, link: `https://journey.hackclub.com/projects/${id}`, guid: m.ts, author: meta.slack_id, - enclosure: meta.attachment ? { - url: meta.attachment, - type: "image/png", - } : undefined, + enclosure: meta.attachment + ? { + url: meta.attachment, + type: "image/png", + } + : undefined, date: new Date(m.meta.created_at), }); } res - .writeHead(200, { - "Content-Type": "text/xml", - }) - .end(rss.xml({ indent: true })); - } + .writeHead(200, { + "Content-Type": "text/xml", + }) + .end(rss.xml({ indent: true })); + }, }, { path: "/happenings.xml",