From 27ddc335012cb9f1e7acd560d13f48e35bf37168 Mon Sep 17 00:00:00 2001 From: tomato6966 Date: Sat, 21 Sep 2024 15:58:19 +0200 Subject: [PATCH] Cleanup eslint config, tsconfig & eslint error --- .gitignore | 1 - eslint.config.mjs | 68 +++++++++++++++++----------------- src/structures/Types/Utils.ts | 5 ++- tsconfig.json | 69 ++++++++++++++++++----------------- 4 files changed, 72 insertions(+), 71 deletions(-) diff --git a/.gitignore b/.gitignore index a259689..3569052 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -# Others node_modules testBot/.env testBot/node_modules diff --git a/eslint.config.mjs b/eslint.config.mjs index 3214e88..57d87c2 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -13,39 +13,39 @@ const compat = new FlatCompat({ allConfig: js.configs.all }); -export default [{ - ignores: [ - "**/config", - "**/dist", - "**/docs", - "**/node_modules", - "**/testBot", - "**/tsDocs", - "**/tools", - "**/.*.js", - "**/.*.mjs", - "**/.*.ts", - ], -}, ...compat.extends("plugin:@typescript-eslint/recommended"), { - plugins: { - "@typescript-eslint": typescriptEslint, - }, - - languageOptions: { - globals: {}, - parser: tsParser, - ecmaVersion: "latest", - sourceType: "module", - - parserOptions: { - project: "tsconfig.json", - }, - }, - rules: { - "@typescript-eslint/consistent-type-imports": "error", - "@typescript-eslint/no-explicit-any": 1, - "@typescript-eslint/no-unsafe-declaration-merging": 1, - "@typescript-eslint/no-unused-vars": 1, +export default [ + { + ignores: [ + "**/config", + "**/dist", + "**/docs", + "**/node_modules", + "**/testBot", + "**/tools", + "eslint.config.mjs", + ], }, -}]; \ No newline at end of file + ...compat.extends("plugin:@typescript-eslint/recommended"), + { + plugins: { + "@typescript-eslint": typescriptEslint, + }, + languageOptions: { + globals: {}, + parser: tsParser, + ecmaVersion: "latest", + sourceType: "module", + parserOptions: { + project: true, + tsconfigRootDir: __dirname, + }, + }, + rules: { + "@typescript-eslint/consistent-type-imports": "error", + "@typescript-eslint/no-explicit-any": 1, + "@typescript-eslint/no-unsafe-declaration-merging": 1, + "@typescript-eslint/no-unused-vars": 1, + }, + } +]; diff --git a/src/structures/Types/Utils.ts b/src/structures/Types/Utils.ts index e9857f7..da6db91 100644 --- a/src/structures/Types/Utils.ts +++ b/src/structures/Types/Utils.ts @@ -91,7 +91,7 @@ export type SourcesRegex = "YoutubeRegex" | "musicYandex" | "radiohost" | "bandcamp" | - "jiosaavn" | + "jiosaavn" | "appleMusic" | "TwitchTv" | "vimeo"; @@ -377,7 +377,8 @@ export interface LavalinkPlayerVoice { /** The Ping to the voice server */ ping?: number } -export interface LavalinkPlayerVoiceOptions extends Omit { } + +export type LavalinkPlayerVoiceOptions = Omit; export interface FailingAddress { /** The failing address */ diff --git a/tsconfig.json b/tsconfig.json index 9b8d171..d75f239 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,37 +1,38 @@ { "compilerOptions": { - /* Basic Options */ - "target": "ESNext", - "module": "CommonJS", - "declaration": true, - "outDir": "./dist", - "rootDir": "./src", - "skipLibCheck": true, - "importHelpers": true, - "moduleResolution": "node", - "baseUrl": ".", - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "forceConsistentCasingInFileNames": true, - "types": [ "node", "ws" ], - "lib": [ - "ESNext", "DOM" - ] - }, - "include": [ - "src/**/*.ts", - ".eslintrc.js" - ], - "exclude": [ - "node_modules", - "dist", - "docs", - "tsDocs", - "config", - "testBot", - ], - "tsc-alias": { - "verbose": false, - "resolveFullPaths": true, - } + "target": "ESNext", + "module": "CommonJS", + "declaration": true, + "outDir": "./dist", + "rootDir": "./src", + "skipLibCheck": true, + "importHelpers": true, + "moduleResolution": "node", + "baseUrl": ".", + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "types": [ + "node", + "ws" + ], + "lib": [ + "ESNext", + "DOM" + ] + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "node_modules", + "dist", + "docs", + "config", + "testBot", + ], + "tsc-alias": { + "verbose": false, + "resolveFullPaths": true, + } }