Lint: Enabling 'noUnusedLocals'

This commit is contained in:
David Teller 2021-07-22 08:47:41 +02:00
parent 2e22154870
commit 46d099e8e0
3 changed files with 2 additions and 13 deletions

View File

@ -33,7 +33,6 @@ import { redactUserMessagesIn } from "../utils";
export async function applyUserBans(lists: BanList[], roomIds: string[], mjolnir: Mjolnir): Promise<RoomUpdateError[]> { export async function applyUserBans(lists: BanList[], roomIds: string[], mjolnir: Mjolnir): Promise<RoomUpdateError[]> {
// We can only ban people who are not already banned, and who match the rules. // We can only ban people who are not already banned, and who match the rules.
const errors: RoomUpdateError[] = []; const errors: RoomUpdateError[] = [];
let bansApplied = 0;
for (const roomId of roomIds) { for (const roomId of roomIds) {
try { try {
// We specifically use sendNotice to avoid having to escape HTML // 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); await logMessage(LogLevel.WARN, "ApplyBan", `Tried to ban ${member.userId} in ${roomId} but Mjolnir is running in no-op mode`, roomId);
} }
bansApplied++;
banned = true; banned = true;
break; break;
} }

View File

@ -15,19 +15,9 @@ limitations under the License.
*/ */
import { Mjolnir } from "../Mjolnir"; import { Mjolnir } from "../Mjolnir";
import BanList, { RULE_ROOM, RULE_SERVER, RULE_USER, USER_RULE_TYPES } from "../models/BanList"; import { LogLevel } from "matrix-bot-sdk";
import { LogLevel, LogService, MatrixGlob, RichReply } from "matrix-bot-sdk";
import { RECOMMENDATION_BAN, recommendationToStable } from "../models/ListRule";
import config from "../config"; import config from "../config";
import { logMessage } from "../LogProxy"; import { logMessage } from "../LogProxy";
import { DEFAULT_LIST_EVENT_TYPE } from "./SetDefaultBanListCommand";
interface Arguments {
list: BanList;
entity: string;
ruleType: string;
reason: string;
}
// !mjolnir kick <user> [room] [reason] // !mjolnir kick <user> [room] [reason]
export async function execKickCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) { export async function execKickCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {

View File

@ -6,6 +6,7 @@
"module": "commonjs", "module": "commonjs",
"moduleResolution": "node", "moduleResolution": "node",
"noImplicitReturns": true, "noImplicitReturns": true,
"noUnusedLocals": true,
"target": "es2015", "target": "es2015",
"noImplicitAny": false, "noImplicitAny": false,
"sourceMap": true, "sourceMap": true,