From 71082eb918f055f07fa45cd44c90fcb0c8dd6a29 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/util/handlers/route.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/api/util/handlers/route.ts') diff --git a/src/api/util/handlers/route.ts b/src/api/util/handlers/route.ts index 6fcc6c73..cb160637 100644 --- a/src/api/util/handlers/route.ts +++ b/src/api/util/handlers/route.ts @@ -34,6 +34,8 @@ import { NextFunction, Request, Response } from "express"; import { AnyValidateFunction } from "ajv/dist/core"; declare global { + // TODO: fix this + // eslint-disable-next-line @typescript-eslint/no-namespace namespace Express { interface Request { permission?: Permissions; @@ -53,7 +55,7 @@ export interface RouteOptions { body?: `${string}Schema`; // typescript interface name test?: { response?: RouteResponse; - body?: any; + body?: unknown; path?: string; event?: EVENT | EVENT[]; headers?: Record; @@ -61,7 +63,7 @@ export interface RouteOptions { } export function route(opts: RouteOptions) { - var validate: AnyValidateFunction | undefined; + let validate: AnyValidateFunction | undefined; if (opts.body) { validate = ajv.getSchema(opts.body); if (!validate) throw new Error(`Body schema ${opts.body} not found`); -- cgit 1.5.1