From da4941347b896afee48088f6282af7d5b7fe60a3 Mon Sep 17 00:00:00 2001 From: Brian Le Date: Sun, 3 Jul 2022 17:26:40 -0700 Subject: [PATCH] Disable class-methods-use-this lint rule (#1391) --- .eslintrc.json | 2 +- src/helpers/bot_listing_manager.ts | 1 - src/kmq_worker.ts | 2 -- src/structures/elimination_player.ts | 1 - src/structures/game_round.ts | 1 - src/structures/game_session.ts | 2 -- src/structures/listening_round.ts | 1 - src/structures/listening_session.ts | 3 --- src/structures/round.ts | 1 - src/structures/session.ts | 4 ---- src/structures/team.ts | 1 - 11 files changed, 1 insertion(+), 18 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index c2c344a6d..832e6e83e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -156,6 +156,6 @@ } ], "no-bitwise": ["off"], - "class-methods-use-this": ["warn", { "exceptMethods": ["call", "help", "resetPremium", "isUsingPremiumOption"] }] + "class-methods-use-this": ["off"] } } diff --git a/src/helpers/bot_listing_manager.ts b/src/helpers/bot_listing_manager.ts index 68b063a2c..9f8382b1f 100644 --- a/src/helpers/bot_listing_manager.ts +++ b/src/helpers/bot_listing_manager.ts @@ -77,7 +77,6 @@ export default class BotListingManager { } } - // eslint-disable-next-line class-methods-use-this private async postStat(siteConfigKeyName: string): Promise { const botListing = BOT_LISTING_SITES[siteConfigKeyName]; const { ipc } = State; diff --git a/src/kmq_worker.ts b/src/kmq_worker.ts index 2f4f3a23d..d72cf3d68 100644 --- a/src/kmq_worker.ts +++ b/src/kmq_worker.ts @@ -27,7 +27,6 @@ const logger = new IPCLogger("kmq"); config({ path: path.resolve(__dirname, "../.env") }); export default class BotWorker extends BaseClusterWorker { - // eslint-disable-next-line class-methods-use-this handleCommand = async (commandName: string): Promise => { logger.debug(`Received cluster command: ${commandName}`); if (commandName.startsWith("eval")) { @@ -93,7 +92,6 @@ export default class BotWorker extends BaseClusterWorker { } }; - // eslint-disable-next-line class-methods-use-this shutdown = async (done): Promise => { logger.debug("SHUTDOWN received, cleaning up..."); diff --git a/src/structures/elimination_player.ts b/src/structures/elimination_player.ts index 4d897b301..5408a80ee 100644 --- a/src/structures/elimination_player.ts +++ b/src/structures/elimination_player.ts @@ -47,7 +47,6 @@ export default class EliminationPlayer extends Player { /** * @returns whether to include this player in the scoreboard */ - // eslint-disable-next-line class-methods-use-this shouldIncludeInScoreboard(): boolean { return true; } diff --git a/src/structures/game_round.ts b/src/structures/game_round.ts index e5b9b08b5..092f9a5a9 100644 --- a/src/structures/game_round.ts +++ b/src/structures/game_round.ts @@ -430,7 +430,6 @@ export default class GameRound extends Round { return `${correctDescription}\n${uniqueSongMessage}`; } - // eslint-disable-next-line class-methods-use-this getEndRoundColor(correctGuess: boolean, userBonusActive: boolean): number { if (correctGuess) { if (userBonusActive) { diff --git a/src/structures/game_session.ts b/src/structures/game_session.ts index 2a6396e29..1cbcd118f 100644 --- a/src/structures/game_session.ts +++ b/src/structures/game_session.ts @@ -155,7 +155,6 @@ export default class GameSession extends Session { this.syncAllVoiceMembers(); } - // eslint-disable-next-line class-methods-use-this sessionName(): string { return "Game Session"; } @@ -644,7 +643,6 @@ export default class GameSession extends Session { return this.correctGuesses; } - // eslint-disable-next-line class-methods-use-this isGameSession(): this is GameSession { return true; } diff --git a/src/structures/listening_round.ts b/src/structures/listening_round.ts index 094643bd3..2a8ab8fde 100644 --- a/src/structures/listening_round.ts +++ b/src/structures/listening_round.ts @@ -26,7 +26,6 @@ export default class ListeningRound extends Round { ); } - // eslint-disable-next-line class-methods-use-this getEndRoundColor(_correctGuess: boolean, userBonusActive: boolean): number { if (userBonusActive) { return EMBED_SUCCESS_BONUS_COLOR; diff --git a/src/structures/listening_session.ts b/src/structures/listening_session.ts index d9198305c..e338e58d6 100644 --- a/src/structures/listening_session.ts +++ b/src/structures/listening_session.ts @@ -62,12 +62,10 @@ export default class ListeningSession extends Session { super.updateOwner(); } - // eslint-disable-next-line class-methods-use-this isListeningSession(): this is ListeningSession { return true; } - // eslint-disable-next-line class-methods-use-this sessionName(): string { return "Listening Session"; } @@ -212,7 +210,6 @@ export default class ListeningSession extends Session { * @param randomSong - The queried song * @returns the new GameRound */ - // eslint-disable-next-line class-methods-use-this protected prepareRound(randomSong: QueriedSong): Round { return new ListeningRound(randomSong); } diff --git a/src/structures/round.ts b/src/structures/round.ts index 9ad623bdd..78211e2a3 100644 --- a/src/structures/round.ts +++ b/src/structures/round.ts @@ -84,7 +84,6 @@ export default abstract class Round { return this.skippers.size; } - // eslint-disable-next-line class-methods-use-this protected getUniqueSongCounterMessage( messageContext: MessageContext, uniqueSongCounter: UniqueSongCounter diff --git a/src/structures/session.ts b/src/structures/session.ts index 75cfd0f12..ec530e36c 100644 --- a/src/structures/session.ts +++ b/src/structures/session.ts @@ -162,12 +162,10 @@ export default abstract class Session { } } - // eslint-disable-next-line class-methods-use-this isListeningSession(): this is ListeningSession { return false; } - // eslint-disable-next-line class-methods-use-this isGameSession(): this is GameSession { return false; } @@ -944,7 +942,6 @@ export default abstract class Session { return sendInfoMessage(messageContext, embed, shouldReply, false); } - // eslint-disable-next-line class-methods-use-this private getDurationFooter( locale: LocaleType, timeRemaining: number, @@ -998,7 +995,6 @@ export default abstract class Session { this.startRound(messageContext); } - // eslint-disable-next-line class-methods-use-this private getAliasFooter( guessModeType: GuessModeType, locale: LocaleType, diff --git a/src/structures/team.ts b/src/structures/team.ts index e54158e4d..75b1ccf00 100644 --- a/src/structures/team.ts +++ b/src/structures/team.ts @@ -108,7 +108,6 @@ export default class Team extends Player { /** * @returns whether to include this team in the scoreboard */ - // eslint-disable-next-line class-methods-use-this shouldIncludeInScoreboard(): boolean { return true; }