From 46d099e8e0ac1513ae28078d766467db4939e3b4 Mon Sep 17 00:00:00 2001 From: David Teller Date: Thu, 22 Jul 2021 08:47:41 +0200 Subject: [PATCH] Lint: Enabling 'noUnusedLocals' --- src/actions/ApplyBan.ts | 2 -- src/commands/KickCommand.ts | 12 +----------- tsconfig.json | 1 + 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/actions/ApplyBan.ts b/src/actions/ApplyBan.ts index efdf343..7731767 100644 --- a/src/actions/ApplyBan.ts +++ b/src/actions/ApplyBan.ts @@ -33,7 +33,6 @@ import { redactUserMessagesIn } from "../utils"; export async function applyUserBans(lists: BanList[], roomIds: string[], mjolnir: Mjolnir): Promise { // We can only ban people who are not already banned, and who match the rules. const errors: RoomUpdateError[] = []; - let bansApplied = 0; for (const roomId of roomIds) { try { // We specifically use sendNotice to avoid having to escape HTML @@ -76,7 +75,6 @@ export async function applyUserBans(lists: BanList[], roomIds: string[], mjolnir await logMessage(LogLevel.WARN, "ApplyBan", `Tried to ban ${member.userId} in ${roomId} but Mjolnir is running in no-op mode`, roomId); } - bansApplied++; banned = true; break; } diff --git a/src/commands/KickCommand.ts b/src/commands/KickCommand.ts index 1d1cd47..ead0bcc 100644 --- a/src/commands/KickCommand.ts +++ b/src/commands/KickCommand.ts @@ -15,19 +15,9 @@ limitations under the License. */ import { Mjolnir } from "../Mjolnir"; -import BanList, { RULE_ROOM, RULE_SERVER, RULE_USER, USER_RULE_TYPES } from "../models/BanList"; -import { LogLevel, LogService, MatrixGlob, RichReply } from "matrix-bot-sdk"; -import { RECOMMENDATION_BAN, recommendationToStable } from "../models/ListRule"; +import { LogLevel } from "matrix-bot-sdk"; import config from "../config"; import { logMessage } from "../LogProxy"; -import { DEFAULT_LIST_EVENT_TYPE } from "./SetDefaultBanListCommand"; - -interface Arguments { - list: BanList; - entity: string; - ruleType: string; - reason: string; -} // !mjolnir kick [room] [reason] export async function execKickCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) { diff --git a/tsconfig.json b/tsconfig.json index 3e9b06f..a91f71f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,7 @@ "module": "commonjs", "moduleResolution": "node", "noImplicitReturns": true, + "noUnusedLocals": true, "target": "es2015", "noImplicitAny": false, "sourceMap": true,