From 2ef9500ae9d902af1ac4a4e5441beb2662a23145 Mon Sep 17 00:00:00 2001 From: na2na-p Date: Thu, 3 Oct 2024 21:42:23 +0900 Subject: [PATCH] fix lint --- eslint.config.js | 2 ++ .../commands/internal/YouTube/internal/YouTube.class.ts | 4 ++-- src/features/core/internal/Client/internal/Client.class.ts | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 31c799a7..e198da03 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -41,6 +41,8 @@ const typescriptEslintCustomRules = { { varsIgnorePattern: '^_', argsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + destructuredArrayIgnorePattern: '^_', }, ], '@typescript-eslint/consistent-type-imports': [ diff --git a/src/features/commands/internal/YouTube/internal/YouTube.class.ts b/src/features/commands/internal/YouTube/internal/YouTube.class.ts index aa94a1c3..7dda7f9e 100644 --- a/src/features/commands/internal/YouTube/internal/YouTube.class.ts +++ b/src/features/commands/internal/YouTube/internal/YouTube.class.ts @@ -6,11 +6,11 @@ import { } from '@/features/core/index.js'; import { AudioPlayerStatus, - StreamType, createAudioPlayer, createAudioResource, entersState, isNil, + StreamType, } from '@/features/library/index.js'; import { LogicException } from '@/features/others/Error/LogicException.js'; @@ -58,7 +58,7 @@ export class YouTube extends CommandBase { ); if (ytdl.validateURL(url)) return url; else throw new Error('Invalid URL'); - } catch (error) { + } catch (_) { return; } })(); diff --git a/src/features/core/internal/Client/internal/Client.class.ts b/src/features/core/internal/Client/internal/Client.class.ts index 7cff1020..2e7f16ce 100644 --- a/src/features/core/internal/Client/internal/Client.class.ts +++ b/src/features/core/internal/Client/internal/Client.class.ts @@ -33,7 +33,7 @@ export class Client extends DiscordJsClient { try { this.login(this.#config.DISCORD_APP_TOKEN); } catch (error) { - this.log(chalk.red('Failed to fetch the account')); + this.log(chalk.red(`Failed to fetch the account: ${error}`)); exit(1); } @@ -104,7 +104,7 @@ export class Client extends DiscordJsClient { }); return true; } catch (error) { - throw new Error('Failed to install commands'); + throw new Error(`Failed to install commands: ${error}`); } }