diff options
author | Vendicated <vendicated@riseup.net> | 2022-10-08 20:36:57 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-10-08 20:36:57 +0200 |
commit | dea34503ef61fe8f2600d2d9b0edb2eec90ebd1b (patch) | |
tree | bf4a0037dbecb8b9b00413c59f1af2b434d561e6 /src/plugins | |
parent | 0109381a4f5a513a23258130bca06d40fcbc8ea9 (diff) | |
download | Vencord-dea34503ef61fe8f2600d2d9b0edb2eec90ebd1b.tar.gz Vencord-dea34503ef61fe8f2600d2d9b0edb2eec90ebd1b.tar.bz2 Vencord-dea34503ef61fe8f2600d2d9b0edb2eec90ebd1b.zip |
Add more eslint rules
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/betterGifAltText.ts | 2 | ||||
-rw-r--r-- | src/plugins/nitroBypass.ts | 4 | ||||
-rw-r--r-- | src/plugins/quickreply.ts | 14 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/betterGifAltText.ts b/src/plugins/betterGifAltText.ts index 08fa07b..4712f71 100644 --- a/src/plugins/betterGifAltText.ts +++ b/src/plugins/betterGifAltText.ts @@ -26,7 +26,7 @@ export default definePlugin({ ], altify(props: any) { - if (props.alt !== "GIF") return; + if (props.alt !== "GIF") return props.alt; let url: string = props.original || props.src; try { diff --git a/src/plugins/nitroBypass.ts b/src/plugins/nitroBypass.ts index e3b6747..8920bc6 100644 --- a/src/plugins/nitroBypass.ts +++ b/src/plugins/nitroBypass.ts @@ -55,7 +55,7 @@ export default definePlugin({ } this.preSend = addPreSendListener((_, messageObj) => { - const guildId = this.guildId; + const { guildId } = this; for (const emoji of messageObj.validNonShortcutEmojis) { if (!emoji.require_colons) continue; if (emoji.guildId === guildId && !emoji.animated) continue; @@ -69,7 +69,7 @@ export default definePlugin({ }); this.preEdit = addPreEditListener((_, __, messageObj) => { - const guildId = this.guildId; + const { guildId } = this; for (const [emojiStr, _, emojiId] of messageObj.content.matchAll(/(?<!\\)<a?:(\w+):(\d+)>/ig)) { const emoji = getCustomEmojiById(emojiId); diff --git a/src/plugins/quickreply.ts b/src/plugins/quickreply.ts index 111d9bb..f1a8451 100644 --- a/src/plugins/quickreply.ts +++ b/src/plugins/quickreply.ts @@ -15,21 +15,21 @@ export default definePlugin({ start() { Dispatcher.subscribe("DELETE_PENDING_REPLY", onDeletePendingReply); - document.addEventListener("keydown", keydown); + document.addEventListener("keydown", onKeydown); }, stop() { Dispatcher.unsubscribe("DELETE_PENDING_REPLY", onDeletePendingReply); - document.removeEventListener("keydown", keydown); + document.removeEventListener("keydown", onKeydown); }, }); let idx = -1; -const onDeletePendingReply = () => { +function onDeletePendingReply() { idx = -1; -}; +} -const keydown = e => { +function onKeydown(e: KeyboardEvent) { if ( (!e.ctrlKey && !e.metaKey) || (e.key !== "ArrowUp" && e.key !== "ArrowDown") @@ -46,7 +46,7 @@ const keydown = e => { if (idx > messages.length) idx = messages.length; if (idx < 0) { - return Dispatcher.dispatch({ + return void Dispatcher.dispatch({ type: "DELETE_PENDING_REPLY", channelId, }); @@ -58,4 +58,4 @@ const keydown = e => { message: messages[idx], showMentionToggle: channel.guild_id !== null, }); -}; +} |