diff --git a/eslint.config.mjs b/eslint.config.mjs index a420912..e321115 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -41,5 +41,7 @@ "no-mixed-spaces-and-tabs": "off", "@typescript-eslint/no-inferrable-types": "off", // Required by typeorm "@typescript-eslint/no-var-requires": "off", // Sometimes requred by typeorm to resolve circular deps + "@typescript-eslint/no-require-imports": "off", + "@typescript-eslint/no-unused-vars": "off", }, }]; \ No newline at end of file diff --git a/src/api/middlewares/Authentication.ts b/src/api/middlewares/Authentication.ts index b5204ff..b4f4847 100644 --- a/src/api/middlewares/Authentication.ts +++ b/src/api/middlewares/Authentication.ts @@ -108,7 +108,6 @@ req.rights = new Rights(Number(user.rights)); return next(); } catch (error) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion return next(new HTTPError(error!.toString(), 400)); } } diff --git a/src/api/routes/auth/reset.ts b/src/api/routes/auth/reset.ts index b3ca1e9..da4d333 100644 --- a/src/api/routes/auth/reset.ts +++ b/src/api/routes/auth/reset.ts @@ -72,7 +72,6 @@ await User.update({ id: user.id }, data); // come on, the user has to have an email to reset their password in the first place - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion await Email.sendPasswordChanged(user, user.email!); res.json({ token: await generateToken(user.id) }); diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts index 94320ee..c6f987f 100644 --- a/src/gateway/opcodes/Identify.ts +++ b/src/gateway/opcodes/Identify.ts @@ -171,7 +171,6 @@ // but we do want almost everything from guild. // How do you do that without just enumerating the guild props? guild: Object.fromEntries( - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion getDatabase()! .getMetadata(Guild) .columns.map((x) => [x.propertyName, true]), diff --git a/src/gateway/opcodes/LazyRequest.ts b/src/gateway/opcodes/LazyRequest.ts index 45eaccf..eba284b 100644 --- a/src/gateway/opcodes/LazyRequest.ts +++ b/src/gateway/opcodes/LazyRequest.ts @@ -214,7 +214,6 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { // TODO: check data check.call(this, LazyRequestSchema, d); - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { guild_id, typing, channels, activities, members } = d as LazyRequestSchema; diff --git a/src/gateway/opcodes/VoiceStateUpdate.ts b/src/gateway/opcodes/VoiceStateUpdate.ts index ffc143e..b45c820 100644 --- a/src/gateway/opcodes/VoiceStateUpdate.ts +++ b/src/gateway/opcodes/VoiceStateUpdate.ts @@ -99,7 +99,6 @@ voiceState.token = genVoiceToken(); voiceState.session_id = this.session_id; - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { id, ...newObj } = voiceState; await Promise.all([ diff --git a/src/util/entities/BaseClass.ts b/src/util/entities/BaseClass.ts index f4b3cf5..0171e01 100644 --- a/src/util/entities/BaseClass.ts +++ b/src/util/entities/BaseClass.ts @@ -46,7 +46,7 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any toJSON(): any { return Object.fromEntries( - // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/no-non-null-assertion + // eslint-disable-next-line @typescript-eslint/ban-ts-comment this.metadata!.columns // @ts-ignore .map((x) => [x.propertyName, this[x.propertyName]]) .concat( diff --git a/src/util/schemas/MessageCreateSchema.ts b/src/util/schemas/MessageCreateSchema.ts index 15537ca..4eaf7c9 100644 --- a/src/util/schemas/MessageCreateSchema.ts +++ b/src/util/schemas/MessageCreateSchema.ts @@ -69,7 +69,6 @@ } // TypeScript complains once this is used above -// eslint-disable-next-line @typescript-eslint/no-unused-vars interface PollCreationSchema { question: PollMedia; answers: PollAnswer[]; diff --git a/src/util/schemas/responses/TeamListResponse.ts b/src/util/schemas/responses/TeamListResponse.ts index 375f0ae..c4a7d17 100644 --- a/src/util/schemas/responses/TeamListResponse.ts +++ b/src/util/schemas/responses/TeamListResponse.ts @@ -18,4 +18,5 @@ import { Team } from "@spacebar/util"; +// eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface TeamListResponse extends Array {} diff --git a/src/util/util/AutoUpdate.ts b/src/util/util/AutoUpdate.ts index b7721cd..9a3c0a2 100644 --- a/src/util/util/AutoUpdate.ts +++ b/src/util/util/AutoUpdate.ts @@ -70,7 +70,6 @@ }); } -// eslint-disable-next-line @typescript-eslint/no-unused-vars async function download(url: string, dir: string) { try { // TODO: use file stream instead of buffer (to prevent crash because of high memory usage for big files) diff --git a/src/util/util/Event.ts b/src/util/util/Event.ts index 01f4911..bbc93aa 100644 --- a/src/util/util/Event.ts +++ b/src/util/util/Event.ts @@ -100,6 +100,7 @@ }; const listener = (msg: ProcessEvent) => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions msg.type === "event" && msg.id === event && callback({ ...msg.event, cancel }); diff --git a/src/util/util/Sentry.ts b/src/util/util/Sentry.ts index 510ed45..005b09e 100644 --- a/src/util/util/Sentry.ts +++ b/src/util/util/Sentry.ts @@ -117,7 +117,7 @@ Integrations.setupExpressErrorHandler(app); // The typings for this are broken? - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-explicit-any app.use(function onError(err: any, req: any, res: any, next: any) { res.statusCode = 500; res.end(res.sentry + "\n");