From 46aa88e9b36563f280e748547df814af804f03a6 Mon Sep 17 00:00:00 2001 From: Manuel Ruwe Date: Tue, 20 Dec 2022 11:03:24 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20EsLint=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 1 + src/commands/disconnect.command.ts | 1 + src/commands/help.command.ts | 1 + src/commands/next.command.ts | 1 + src/commands/pause.command.ts | 1 + src/commands/play.comands.ts | 1 + src/commands/playlist.command.ts | 1 + src/commands/previous.command.ts | 1 + src/commands/status.command.ts | 5 +++-- src/commands/stop.command.ts | 1 + src/middleware/command-execution-filter.ts | 4 ---- src/models/jellyfinAudioItems.ts | 1 - src/types/env.ts | 2 +- src/updates/updates.service.ts | 2 +- 14 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 8f5aedb..2cd11ba 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,5 +21,6 @@ module.exports = { '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-explicit-any': 'off', + 'linebreak-style': 0, }, }; diff --git a/src/commands/disconnect.command.ts b/src/commands/disconnect.command.ts index 6474d8e..b0eb637 100644 --- a/src/commands/disconnect.command.ts +++ b/src/commands/disconnect.command.ts @@ -17,6 +17,7 @@ export class DisconnectCommand implements DiscordCommand { private readonly discordMessageService: DiscordMessageService, ) {} + // eslint-disable-next-line @typescript-eslint/no-unused-vars handler(interaction: CommandInteraction): GenericCustomReply { const disconnect = this.discordVoiceService.disconnect(); diff --git a/src/commands/help.command.ts b/src/commands/help.command.ts index 0457dd1..46827c6 100644 --- a/src/commands/help.command.ts +++ b/src/commands/help.command.ts @@ -13,6 +13,7 @@ import { GenericCustomReply } from '../models/generic-try-handler'; export class HelpCommand implements DiscordCommand { constructor(private readonly discordMessageService: DiscordMessageService) {} + // eslint-disable-next-line @typescript-eslint/no-unused-vars handler(commandInteraction: CommandInteraction): GenericCustomReply { return { embeds: [ diff --git a/src/commands/next.command.ts b/src/commands/next.command.ts index bed2bcd..04eb4a3 100644 --- a/src/commands/next.command.ts +++ b/src/commands/next.command.ts @@ -17,6 +17,7 @@ export class SkipTrackCommand implements DiscordCommand { ) {} handler( + // eslint-disable-next-line @typescript-eslint/no-unused-vars interactionCommand: CommandInteraction, ): InteractionReplyOptions | string { if (!this.playbackService.nextTrack()) { diff --git a/src/commands/pause.command.ts b/src/commands/pause.command.ts index 3fc4e61..1216663 100644 --- a/src/commands/pause.command.ts +++ b/src/commands/pause.command.ts @@ -17,6 +17,7 @@ export class PausePlaybackCommand implements DiscordCommand { ) {} handler( + // eslint-disable-next-line @typescript-eslint/no-unused-vars commandInteraction: CommandInteraction, ): string | InteractionReplyOptions { const shouldBePaused = this.discordVoiceService.togglePaused(); diff --git a/src/commands/play.comands.ts b/src/commands/play.comands.ts index fe7a97c..6e17997 100644 --- a/src/commands/play.comands.ts +++ b/src/commands/play.comands.ts @@ -49,6 +49,7 @@ export class PlayItemCommand async handler( @Payload() dto: TrackRequestDto, + // eslint-disable-next-line @typescript-eslint/no-unused-vars executionContext: TransformedCommandExecutionContext, ): Promise { const items = await this.jellyfinSearchService.search(dto.search); diff --git a/src/commands/playlist.command.ts b/src/commands/playlist.command.ts index 46e7e1d..fbd1f2a 100644 --- a/src/commands/playlist.command.ts +++ b/src/commands/playlist.command.ts @@ -20,6 +20,7 @@ export class PlaylistCommand implements DiscordCommand { private readonly playbackService: PlaybackService, ) {} + // eslint-disable-next-line @typescript-eslint/no-unused-vars handler(interaction: CommandInteraction): GenericCustomReply { const playList = this.playbackService.getPlaylist(); diff --git a/src/commands/previous.command.ts b/src/commands/previous.command.ts index f131fb6..7d89f3a 100644 --- a/src/commands/previous.command.ts +++ b/src/commands/previous.command.ts @@ -17,6 +17,7 @@ export class PreviousTrackCommand implements DiscordCommand { ) {} handler( + // eslint-disable-next-line @typescript-eslint/no-unused-vars dcommandInteraction: CommandInteraction, ): InteractionReplyOptions | string { if (!this.playbackService.previousTrack()) { diff --git a/src/commands/status.command.ts b/src/commands/status.command.ts index be116a4..0b7b752 100644 --- a/src/commands/status.command.ts +++ b/src/commands/status.command.ts @@ -4,13 +4,13 @@ import { Command, DiscordCommand, InjectDiscordClient, - UsePipes + UsePipes, } from '@discord-nestjs/core'; import { Client, CommandInteraction, InteractionReplyOptions, - Status + Status, } from 'discord.js'; import { formatDuration, intervalToDuration } from 'date-fns'; @@ -34,6 +34,7 @@ export class StatusCommand implements DiscordCommand { ) {} async handler( + // eslint-disable-next-line @typescript-eslint/no-unused-vars commandInteraction: CommandInteraction, ): Promise { const ping = this.client.ws.ping; diff --git a/src/commands/stop.command.ts b/src/commands/stop.command.ts index a9b7977..9e80303 100644 --- a/src/commands/stop.command.ts +++ b/src/commands/stop.command.ts @@ -18,6 +18,7 @@ export class StopPlaybackCommand implements DiscordCommand { private readonly discordMessageService: DiscordMessageService, private readonly discordVoiceService: DiscordVoiceService, ) {} + // eslint-disable-next-line @typescript-eslint/no-unused-vars handler(CommandInteraction: CommandInteraction): GenericCustomReply { this.playbackService.clear(); this.discordVoiceService.stop(false); diff --git a/src/middleware/command-execution-filter.ts b/src/middleware/command-execution-filter.ts index f15e5c8..19741a6 100644 --- a/src/middleware/command-execution-filter.ts +++ b/src/middleware/command-execution-filter.ts @@ -2,7 +2,6 @@ import { Catch, DiscordArgumentMetadata, DiscordExceptionFilter, - On, } from '@discord-nestjs/core'; import { Logger } from '@nestjs/common'; import { @@ -10,9 +9,6 @@ import { ButtonBuilder, ButtonStyle, CommandInteraction, - ComponentBuilder, - Events, - Interaction, } from 'discord.js'; import { DiscordMessageService } from '../clients/discord/discord.message.service'; import { Constants } from '../utils/constants'; diff --git a/src/models/jellyfinAudioItems.ts b/src/models/jellyfinAudioItems.ts index 5e83f15..0dcf77b 100644 --- a/src/models/jellyfinAudioItems.ts +++ b/src/models/jellyfinAudioItems.ts @@ -7,7 +7,6 @@ import { Track } from '../types/track'; import { trimStringToFixedLength } from '../utils/stringUtils'; import { Logger } from '@nestjs/common'; -import { v4 as uuidv4 } from 'uuid'; import { JellyfinSearchService } from '../clients/jellyfin/jellyfin.search.service'; export interface BaseJellyfinAudioPlayable { diff --git a/src/types/env.ts b/src/types/env.ts index a57cce4..2e1bdfc 100644 --- a/src/types/env.ts +++ b/src/types/env.ts @@ -1,3 +1,3 @@ export interface EnvironmentVariablesType { DISCORD_CLIENT_TOKEN: string; -} \ No newline at end of file +} diff --git a/src/updates/updates.service.ts b/src/updates/updates.service.ts index 739769c..3c237ec 100644 --- a/src/updates/updates.service.ts +++ b/src/updates/updates.service.ts @@ -62,7 +62,7 @@ export class UpdatesService { const isoDate = parseISO(latestVersion.published_at); const relativeReadable = formatRelative(isoDate, new Date()); - guilds.forEach(async (guild, key) => { + guilds.forEach(async (guild) => { const owner = await guild.fetchOwner(); await owner.send({