mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 05:36:06 +00:00
Lint: Enabling 'noImplicitReturns'
This commit is contained in:
parent
43da763bb2
commit
2a77509f9e
@ -23,7 +23,8 @@ async function addRemoveFromDirectory(inRoomId: string, event: any, mjolnir: Mjo
|
||||
const message = "I am not a Synapse administrator, or the endpoint is blocked";
|
||||
const reply = RichReply.createFor(inRoomId, event, message, message);
|
||||
reply['msgtype'] = "m.notice";
|
||||
return mjolnir.client.sendMessage(inRoomId, reply);
|
||||
mjolnir.client.sendMessage(inRoomId, reply);
|
||||
return;
|
||||
}
|
||||
|
||||
const targetRoomId = await mjolnir.client.resolveRoom(roomRef);
|
||||
|
@ -28,7 +28,8 @@ export async function execMoveAliasCommand(roomId: string, event: any, mjolnir:
|
||||
const message = "I am not a Synapse administrator, or the endpoint is blocked";
|
||||
const reply = RichReply.createFor(roomId, event, message, message);
|
||||
reply['msgtype'] = "m.notice";
|
||||
return mjolnir.client.sendMessage(roomId, reply);
|
||||
mjolnir.client.sendMessage(roomId, reply);
|
||||
return;
|
||||
}
|
||||
|
||||
await mjolnir.client.deleteRoomAlias(movingAlias);
|
||||
@ -48,7 +49,8 @@ export async function execAddAliasCommand(roomId: string, event: any, mjolnir: M
|
||||
const message = "I am not a Synapse administrator, or the endpoint is blocked";
|
||||
const reply = RichReply.createFor(roomId, event, message, message);
|
||||
reply['msgtype'] = "m.notice";
|
||||
return mjolnir.client.sendMessage(roomId, reply);
|
||||
mjolnir.client.sendMessage(roomId, reply);
|
||||
return;
|
||||
}
|
||||
|
||||
const newRoomId = await mjolnir.client.resolveRoom(targetRoom);
|
||||
@ -66,7 +68,8 @@ export async function execRemoveAliasCommand(roomId: string, event: any, mjolnir
|
||||
const message = "I am not a Synapse administrator, or the endpoint is blocked";
|
||||
const reply = RichReply.createFor(roomId, event, message, message);
|
||||
reply['msgtype'] = "m.notice";
|
||||
return mjolnir.client.sendMessage(roomId, reply);
|
||||
mjolnir.client.sendMessage(roomId, reply);
|
||||
return;
|
||||
}
|
||||
|
||||
await mjolnir.client.deleteRoomAlias(aliasToRemove);
|
||||
|
@ -26,7 +26,8 @@ export async function execDeactivateCommand(roomId: string, event: any, mjolnir:
|
||||
const message = "I am not a Synapse administrator, or the endpoint is blocked";
|
||||
const reply = RichReply.createFor(roomId, event, message, message);
|
||||
reply['msgtype'] = "m.notice";
|
||||
return mjolnir.client.sendMessage(roomId, reply);
|
||||
mjolnir.client.sendMessage(roomId, reply);
|
||||
return;
|
||||
}
|
||||
|
||||
await mjolnir.deactivateSynapseUser(victim);
|
||||
|
@ -28,7 +28,8 @@ export async function execImportCommand(roomId: string, event: any, mjolnir: Mjo
|
||||
const errMessage = "Unable to find list - check your shortcode.";
|
||||
const errReply = RichReply.createFor(roomId, event, errMessage, errMessage);
|
||||
errReply["msgtype"] = "m.notice";
|
||||
return mjolnir.client.sendMessage(roomId, errReply);
|
||||
mjolnir.client.sendMessage(roomId, errReply);
|
||||
return;
|
||||
}
|
||||
|
||||
let importedRules = 0;
|
||||
|
@ -27,7 +27,8 @@ export async function execSetDefaultListCommand(roomId: string, event: any, mjol
|
||||
const replyText = "No ban list with that shortcode was found.";
|
||||
const reply = RichReply.createFor(roomId, event, replyText, replyText);
|
||||
reply["msgtype"] = "m.notice";
|
||||
return mjolnir.client.sendMessage(roomId, reply);
|
||||
mjolnir.client.sendMessage(roomId, reply);
|
||||
return;
|
||||
}
|
||||
|
||||
await mjolnir.client.setAccountData(DEFAULT_LIST_EVENT_TYPE, {shortcode});
|
||||
|
@ -26,7 +26,8 @@ export async function execShutdownRoomCommand(roomId: string, event: any, mjolni
|
||||
const message = "I am not a Synapse administrator, or the endpoint is blocked";
|
||||
const reply = RichReply.createFor(roomId, event, message, message);
|
||||
reply['msgtype'] = "m.notice";
|
||||
return mjolnir.client.sendMessage(roomId, reply);
|
||||
mjolnir.client.sendMessage(roomId, reply);
|
||||
return;
|
||||
}
|
||||
|
||||
await mjolnir.shutdownSynapseRoom(await mjolnir.client.resolveRoom(victim));
|
||||
|
@ -24,7 +24,8 @@ export async function execWatchCommand(roomId: string, event: any, mjolnir: Mjol
|
||||
const replyText = "Cannot watch list due to error - is that a valid room alias?";
|
||||
const reply = RichReply.createFor(roomId, event, replyText, replyText);
|
||||
reply["msgtype"] = "m.notice";
|
||||
return mjolnir.client.sendMessage(roomId, reply);
|
||||
mjolnir.client.sendMessage(roomId, reply);
|
||||
return;
|
||||
}
|
||||
await mjolnir.client.unstableApis.addReactionToEvent(roomId, event['event_id'], '✅');
|
||||
}
|
||||
@ -36,7 +37,8 @@ export async function execUnwatchCommand(roomId: string, event: any, mjolnir: Mj
|
||||
const replyText = "Cannot unwatch list due to error - is that a valid room alias?";
|
||||
const reply = RichReply.createFor(roomId, event, replyText, replyText);
|
||||
reply["msgtype"] = "m.notice";
|
||||
return mjolnir.client.sendMessage(roomId, reply);
|
||||
mjolnir.client.sendMessage(roomId, reply);
|
||||
return;
|
||||
}
|
||||
await mjolnir.client.unstableApis.addReactionToEvent(roomId, event['event_id'], '✅');
|
||||
}
|
||||
|
@ -32,8 +32,12 @@ export class ListRule {
|
||||
this.glob = new MatrixGlob(entity);
|
||||
}
|
||||
|
||||
public get recommendation(): string {
|
||||
/**
|
||||
* The recommendation for this rule, or `null` if there is no recommendation or the recommendation is invalid.
|
||||
*/
|
||||
public get recommendation(): string|null {
|
||||
if (RECOMMENDATION_BAN_TYPES.includes(this.action)) return RECOMMENDATION_BAN;
|
||||
return null;
|
||||
}
|
||||
|
||||
public isMatch(entity: string): boolean {
|
||||
|
@ -1,9 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"alwaysStrict": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"noImplicitReturns": true,
|
||||
"target": "es2015",
|
||||
"noImplicitAny": false,
|
||||
"sourceMap": true,
|
||||
|
Loading…
Reference in New Issue
Block a user