From 084dc0be08555891cad4c2bb984822a62ec5ec9f Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Fri, 20 Jan 2023 18:10:47 +1100 Subject: Add ESLint (#941) * Add eslint, switch to lint-staged for precommit * Fix all ESLint errors * Update GH workflow to check prettier and eslint --- src/api/routes/applications/#id/bot/index.ts | 6 +++--- src/api/routes/applications/#id/index.ts | 2 -- src/api/routes/applications/#id/skus.ts | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src/api/routes/applications/#id') diff --git a/src/api/routes/applications/#id/bot/index.ts b/src/api/routes/applications/#id/bot/index.ts index 7d0a637e..9bc3c571 100644 --- a/src/api/routes/applications/#id/bot/index.ts +++ b/src/api/routes/applications/#id/bot/index.ts @@ -64,8 +64,8 @@ router.post("/", route({}), async (req: Request, res: Response) => { }); router.post("/reset", route({}), async (req: Request, res: Response) => { - let bot = await User.findOneOrFail({ where: { id: req.params.id } }); - let owner = await User.findOneOrFail({ where: { id: req.user_id } }); + const bot = await User.findOneOrFail({ where: { id: req.params.id } }); + const owner = await User.findOneOrFail({ where: { id: req.user_id } }); if (owner.id != req.user_id) throw DiscordApiErrors.ACTION_NOT_AUTHORIZED_ON_APPLICATION; @@ -80,7 +80,7 @@ router.post("/reset", route({}), async (req: Request, res: Response) => { await bot.save(); - let token = await generateToken(bot.id); + const token = await generateToken(bot.id); res.json({ token }).status(200); }); diff --git a/src/api/routes/applications/#id/index.ts b/src/api/routes/applications/#id/index.ts index 2b283880..59e90168 100644 --- a/src/api/routes/applications/#id/index.ts +++ b/src/api/routes/applications/#id/index.ts @@ -20,10 +20,8 @@ import { Request, Response, Router } from "express"; import { route } from "@fosscord/api"; import { Application, - OrmUtils, DiscordApiErrors, ApplicationModifySchema, - User, } from "@fosscord/util"; import { verifyToken } from "node-2fa"; import { HTTPError } from "lambert-server"; diff --git a/src/api/routes/applications/#id/skus.ts b/src/api/routes/applications/#id/skus.ts index 23e6eb6b..5a3a479f 100644 --- a/src/api/routes/applications/#id/skus.ts +++ b/src/api/routes/applications/#id/skus.ts @@ -18,7 +18,6 @@ import { Request, Response, Router } from "express"; import { route } from "@fosscord/api"; -import { Application, OrmUtils, Team, trimSpecial, User } from "@fosscord/util"; const router: Router = Router(); -- cgit 1.5.1