chore: upgrade to eslint v9 (#2574)

This commit is contained in:
Michael Thomas
2026-03-16 12:12:30 -04:00
committed by GitHub
parent 40e02bba6a
commit 36243a0deb
84 changed files with 916 additions and 883 deletions

View File

@@ -1,69 +0,0 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:jsx-a11y/recommended',
'plugin:@next/next/recommended',
'prettier',
],
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
'@typescript-eslint/no-explicit-any': 'warn', // disable the rule for now to replicate previous behavior
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/no-use-before-define': 0,
'jsx-a11y/no-noninteractive-tabindex': 0,
'arrow-parens': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'no-console': 1,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'formatjs/no-offset': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/array-type': ['error', { default: 'array' }],
'jsx-a11y/no-onchange': 'off',
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
},
],
'no-relative-import-paths/no-relative-import-paths': [
'error',
{ allowSameFolder: true },
],
},
overrides: [
{
files: ['**/*.tsx'],
plugins: ['react'],
rules: {
'react/prop-types': 'off',
'react/self-closing-comp': 'error',
},
},
],
plugins: ['jsx-a11y', 'react-hooks', 'formatjs', 'no-relative-import-paths'],
settings: {
react: {
pragma: 'React',
version: '16.8',
},
},
env: {
browser: true,
node: true,
jest: true,
es6: true,
},
reportUnusedDisableDirectives: true,
};

95
eslint.config.mts Normal file
View File

@@ -0,0 +1,95 @@
import js from '@eslint/js';
import nextPlugin from '@next/eslint-plugin-next';
import prettier from 'eslint-config-prettier';
import formatjs from 'eslint-plugin-formatjs';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import noRelativeImportPaths from 'eslint-plugin-no-relative-import-paths';
import reactPlugin from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import { defineConfig, type Config } from 'eslint/config';
import globals from 'globals';
import tseslint from 'typescript-eslint';
type Plugin = NonNullable<Config['plugins']>[string];
export default defineConfig(
// Global ignores
{
ignores: ['node_modules/**', '.next/**'],
},
js.configs.recommended,
tseslint.configs.recommended,
jsxA11y.flatConfigs.recommended,
{
languageOptions: {
ecmaVersion: 2023,
sourceType: 'module',
parserOptions: {
ecmaFeatures: { jsx: true },
},
globals: {
...globals.browser,
...globals.node,
...globals.jest,
},
},
settings: {
react: {
pragma: 'React',
version: '18.3',
},
},
plugins: {
react: reactPlugin,
'react-hooks': reactHooks as Plugin,
formatjs,
'no-relative-import-paths': noRelativeImportPaths,
'@next/next': nextPlugin,
},
rules: {
...nextPlugin.configs.recommended.rules,
// TypeScript
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/array-type': ['error', { default: 'array' }],
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports' },
],
// React
'react/prop-types': 'off',
'react/self-closing-comp': 'error',
// jsx-a11y
'jsx-a11y/no-noninteractive-tabindex': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/no-onchange': 'off',
// React Hooks
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// General
'arrow-parens': 'off',
'no-console': 'warn',
'no-unused-vars': 'off',
// Plugins
'formatjs/no-offset': 'error',
'no-relative-import-paths/no-relative-import-paths': [
'error',
{ allowSameFolder: true },
],
},
},
prettier,
{
linterOptions: {
reportUnusedDisableDirectives: true,
},
}
);

View File

@@ -118,6 +118,8 @@
"devDependencies": {
"@commitlint/cli": "17.4.4",
"@commitlint/config-conventional": "17.4.4",
"@eslint/js": "9.39.3",
"@next/eslint-plugin-next": "^16.1.6",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.10",
"@tailwindcss/typography": "^0.5.16",
@@ -126,6 +128,7 @@
"@types/country-flag-icons": "1.2.2",
"@types/csurf": "1.11.5",
"@types/email-templates": "10.0.4",
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
"@types/express": "4.17.17",
"@types/express-session": "1.18.2",
"@types/lodash": "4.17.21",
@@ -145,8 +148,6 @@
"@types/xml2js": "0.4.14",
"@types/yamljs": "0.2.31",
"@types/yup": "0.29.14",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"autoprefixer": "^10.4.23",
"baseline-browser-mapping": "^2.8.32",
"commander": "^14.0.3",
@@ -155,16 +156,17 @@
"cy-mobile-commands": "0.3.0",
"cypress": "14.5.4",
"cz-conventional-changelog": "3.3.0",
"eslint": "8.57.1",
"eslint-config-next": "^14.2.35",
"eslint-config-prettier": "8.6.0",
"eslint-plugin-formatjs": "4.9.0",
"eslint": "9.39.3",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-formatjs": "6.2.0",
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-no-relative-import-paths": "1.6.1",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-react-hooks": "7.0.1",
"globals": "^17.3.0",
"husky": "8.0.3",
"jiti": "^2.6.1",
"lint-staged": "13.1.2",
"nodemon": "3.1.11",
"postcss": "^8.5.6",
@@ -176,7 +178,8 @@
"ts-node": "10.9.2",
"tsc-alias": "1.8.16",
"tsconfig-paths": "4.2.0",
"typescript": "5.4.5"
"typescript": "5.4.5",
"typescript-eslint": "^8.56.1"
},
"engines": {
"node": "^22.0.0",

1106
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -154,7 +154,9 @@ class AnimeListMapping {
{ label: 'Anime-List Sync' }
);
} catch (e) {
throw new Error(`Failed to load Anime-List mappings: ${e.message}`);
throw new Error(`Failed to load Anime-List mappings: ${e.message}`, {
cause: e,
});
}
};
@@ -173,7 +175,9 @@ class AnimeListMapping {
response.data.pipe(writer);
});
} catch (e) {
throw new Error(`Failed to download Anime-List mapping: ${e.message}`);
throw new Error(`Failed to download Anime-List mapping: ${e.message}`, {
cause: e,
});
}
};

View File

@@ -284,7 +284,7 @@ class JellyfinAPI extends ExternalAPI {
const mediaFolderResponse = await this.get<any>(`/Library/MediaFolders`);
return this.mapLibraries(mediaFolderResponse.Items);
} catch (mediaFoldersResponseError) {
} catch {
// fallback to user views to get libraries
// this only and maybe/depending on factors affects LDAP users
try {

View File

@@ -205,7 +205,7 @@ class PlexTvAPI extends ExternalAPI {
label: 'Plex.tv API',
errorMessage: e.message,
});
throw new Error('Invalid auth token');
throw new Error('Invalid auth token', { cause: e });
}
}
@@ -221,7 +221,7 @@ class PlexTvAPI extends ExternalAPI {
`Something went wrong while getting the account from plex.tv: ${e.message}`,
{ label: 'Plex.tv API' }
);
throw new Error('Invalid auth token');
throw new Error('Invalid auth token', { cause: e });
}
}

View File

@@ -48,7 +48,9 @@ class PushoverAPI extends ExternalAPI {
return mapSounds(data.sounds);
} catch (e) {
throw new Error(`[Pushover] Failed to retrieve sounds: ${e.message}`);
throw new Error(`[Pushover] Failed to retrieve sounds: ${e.message}`, {
cause: e,
});
}
}
}

View File

@@ -192,7 +192,8 @@ class IMDBRadarrProxy extends ExternalAPI {
};
} catch (e) {
throw new Error(
`[IMDB RADARR PROXY API] Failed to retrieve movie ratings: ${e.message}`
`[IMDB RADARR PROXY API] Failed to retrieve movie ratings: ${e.message}`,
{ cause: e }
);
}
}

View File

@@ -167,7 +167,8 @@ class RottenTomatoes extends ExternalAPI {
};
} catch (e) {
throw new Error(
`[RT API] Failed to retrieve movie ratings: ${e.message}`
`[RT API] Failed to retrieve movie ratings: ${e.message}`,
{ cause: e }
);
}
}
@@ -205,7 +206,9 @@ class RottenTomatoes extends ExternalAPI {
year: Number(tvshow.releaseYear),
};
} catch (e) {
throw new Error(`[RT API] Failed to retrieve tv ratings: ${e.message}`);
throw new Error(`[RT API] Failed to retrieve tv ratings: ${e.message}`, {
cause: e,
});
}
}
}

View File

@@ -121,7 +121,8 @@ class ServarrBase<QueueItemAppendT> extends ExternalAPI {
return response.data;
} catch (e) {
throw new Error(
`[${this.apiName}] Failed to retrieve system status: ${e.message}`
`[${this.apiName}] Failed to retrieve system status: ${e.message}`,
{ cause: e }
);
}
};
@@ -137,7 +138,8 @@ class ServarrBase<QueueItemAppendT> extends ExternalAPI {
return data;
} catch (e) {
throw new Error(
`[${this.apiName}] Failed to retrieve profiles: ${e.message}`
`[${this.apiName}] Failed to retrieve profiles: ${e.message}`,
{ cause: e }
);
}
};
@@ -153,7 +155,8 @@ class ServarrBase<QueueItemAppendT> extends ExternalAPI {
return data;
} catch (e) {
throw new Error(
`[${this.apiName}] Failed to retrieve root folders: ${e.message}`
`[${this.apiName}] Failed to retrieve root folders: ${e.message}`,
{ cause: e }
);
}
};
@@ -172,7 +175,8 @@ class ServarrBase<QueueItemAppendT> extends ExternalAPI {
return response.data.records;
} catch (e) {
throw new Error(
`[${this.apiName}] Failed to retrieve queue: ${e.message}`
`[${this.apiName}] Failed to retrieve queue: ${e.message}`,
{ cause: e }
);
}
};
@@ -184,7 +188,8 @@ class ServarrBase<QueueItemAppendT> extends ExternalAPI {
return response.data;
} catch (e) {
throw new Error(
`[${this.apiName}] Failed to retrieve tags: ${e.message}`
`[${this.apiName}] Failed to retrieve tags: ${e.message}`,
{ cause: e }
);
}
};
@@ -197,7 +202,9 @@ class ServarrBase<QueueItemAppendT> extends ExternalAPI {
return response.data;
} catch (e) {
throw new Error(`[${this.apiName}] Failed to create tag: ${e.message}`);
throw new Error(`[${this.apiName}] Failed to create tag: ${e.message}`, {
cause: e,
});
}
};
@@ -216,7 +223,9 @@ class ServarrBase<QueueItemAppendT> extends ExternalAPI {
return response.data;
} catch (e) {
throw new Error(`[${this.apiName}] Failed to rename tag: ${e.message}`);
throw new Error(`[${this.apiName}] Failed to rename tag: ${e.message}`, {
cause: e,
});
}
};
@@ -234,7 +243,9 @@ class ServarrBase<QueueItemAppendT> extends ExternalAPI {
...options,
});
} catch (e) {
throw new Error(`[${this.apiName}] Failed to run command: ${e.message}`);
throw new Error(`[${this.apiName}] Failed to run command: ${e.message}`, {
cause: e,
});
}
}
}

View File

@@ -74,7 +74,9 @@ class RadarrAPI extends ServarrBase<{ movieId: number }> {
return response.data;
} catch (e) {
throw new Error(`[Radarr] Failed to retrieve movies: ${e.message}`);
throw new Error(`[Radarr] Failed to retrieve movies: ${e.message}`, {
cause: e,
});
}
};
@@ -84,7 +86,9 @@ class RadarrAPI extends ServarrBase<{ movieId: number }> {
return response.data;
} catch (e) {
throw new Error(`[Radarr] Failed to retrieve movie: ${e.message}`);
throw new Error(`[Radarr] Failed to retrieve movie: ${e.message}`, {
cause: e,
});
}
};
@@ -107,7 +111,7 @@ class RadarrAPI extends ServarrBase<{ movieId: number }> {
errorMessage: e.message,
tmdbId: id,
});
throw new Error('Movie not found');
throw new Error('Movie not found', { cause: e });
}
}
@@ -240,7 +244,7 @@ class RadarrAPI extends ServarrBase<{ movieId: number }> {
response: e?.response?.data,
}
);
throw new Error('Failed to add movie to Radarr');
throw new Error('Failed to add movie to Radarr', { cause: e });
}
};
@@ -274,7 +278,9 @@ class RadarrAPI extends ServarrBase<{ movieId: number }> {
});
logger.info(`[Radarr] Removed movie ${title}`);
} catch (e) {
throw new Error(`[Radarr] Failed to remove movie: ${e.message}`);
throw new Error(`[Radarr] Failed to remove movie: ${e.message}`, {
cause: e,
});
}
};

View File

@@ -123,7 +123,9 @@ class SonarrAPI extends ServarrBase<{
return response.data;
} catch (e) {
throw new Error(`[Sonarr] Failed to retrieve series: ${e.message}`);
throw new Error(`[Sonarr] Failed to retrieve series: ${e.message}`, {
cause: e,
});
}
}
@@ -133,7 +135,10 @@ class SonarrAPI extends ServarrBase<{
return response.data;
} catch (e) {
throw new Error(`[Sonarr] Failed to retrieve series by ID: ${e.message}`);
throw new Error(
`[Sonarr] Failed to retrieve series by ID: ${e.message}`,
{ cause: e }
);
}
}
@@ -156,7 +161,7 @@ class SonarrAPI extends ServarrBase<{
errorMessage: e.message,
title,
});
throw new Error('No series found');
throw new Error('No series found', { cause: e });
}
}
@@ -179,7 +184,7 @@ class SonarrAPI extends ServarrBase<{
errorMessage: e.message,
tvdbId: id,
});
throw new Error('Series not found');
throw new Error('Series not found', { cause: e });
}
}
@@ -303,7 +308,7 @@ class SonarrAPI extends ServarrBase<{
options,
response: e?.response?.data,
});
throw new Error('Failed to add series');
throw new Error('Failed to add series', { cause: e });
}
}
@@ -325,7 +330,7 @@ class SonarrAPI extends ServarrBase<{
}
);
throw new Error('Failed to get language profiles');
throw new Error('Failed to get language profiles', { cause: e });
}
}
@@ -361,7 +366,7 @@ class SonarrAPI extends ServarrBase<{
errorMessage: e.message,
seriesId,
});
throw new Error('Failed to get episodes');
throw new Error('Failed to get episodes', { cause: e });
}
}
@@ -377,7 +382,7 @@ class SonarrAPI extends ServarrBase<{
errorMessage: e.message,
episodeIds,
});
throw new Error('Failed to monitor episodes');
throw new Error('Failed to monitor episodes', { cause: e });
}
}
@@ -416,7 +421,9 @@ class SonarrAPI extends ServarrBase<{
});
logger.info(`[Sonarr] Removed series ${title}`);
} catch (e) {
throw new Error(`[Sonarr] Failed to remove series: ${e.message}`);
throw new Error(`[Sonarr] Failed to remove series: ${e.message}`, {
cause: e,
});
}
};

View File

@@ -140,7 +140,8 @@ class TautulliAPI {
errorMessage: e.message,
});
throw new Error(
`[Tautulli] Failed to fetch Tautulli server info: ${e.message}`
`[Tautulli] Failed to fetch Tautulli server info: ${e.message}`,
{ cause: e }
);
}
}
@@ -168,7 +169,8 @@ class TautulliAPI {
}
);
throw new Error(
`[Tautulli] Failed to fetch media watch stats: ${e.message}`
`[Tautulli] Failed to fetch media watch stats: ${e.message}`,
{ cause: e }
);
}
}
@@ -196,7 +198,8 @@ class TautulliAPI {
}
);
throw new Error(
`[Tautulli] Failed to fetch media watch users: ${e.message}`
`[Tautulli] Failed to fetch media watch users: ${e.message}`,
{ cause: e }
);
}
}
@@ -227,7 +230,8 @@ class TautulliAPI {
}
);
throw new Error(
`[Tautulli] Failed to fetch user watch stats: ${e.message}`
`[Tautulli] Failed to fetch user watch stats: ${e.message}`,
{ cause: e }
);
}
}
@@ -287,7 +291,8 @@ class TautulliAPI {
}
);
throw new Error(
`[Tautulli] Failed to fetch user watch history: ${e.message}`
`[Tautulli] Failed to fetch user watch history: ${e.message}`,
{ cause: e }
);
}
}

View File

@@ -162,7 +162,7 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
});
return data;
} catch (e) {
} catch {
return {
page: 1,
results: [],
@@ -191,7 +191,7 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
});
return data;
} catch (e) {
} catch {
return {
page: 1,
results: [],
@@ -220,7 +220,7 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
});
return data;
} catch (e) {
} catch {
return {
page: 1,
results: [],
@@ -244,7 +244,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch person details: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch person details: ${e.message}`, {
cause: e,
});
}
};
@@ -266,7 +268,8 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(
`[TMDB] Failed to fetch person combined credits: ${e.message}`
`[TMDB] Failed to fetch person combined credits: ${e.message}`,
{ cause: e }
);
}
};
@@ -294,7 +297,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch movie details: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch movie details: ${e.message}`, {
cause: e,
});
}
};
@@ -321,7 +326,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch TV show details: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch TV show details: ${e.message}`, {
cause: e,
});
}
};
@@ -354,7 +361,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch TV show details: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch TV show details: ${e.message}`, {
cause: e,
});
}
};
@@ -380,7 +389,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch discover movies: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch discover movies: ${e.message}`, {
cause: e,
});
}
}
@@ -406,7 +417,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch discover movies: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch discover movies: ${e.message}`, {
cause: e,
});
}
}
@@ -432,7 +445,10 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch movies by keyword: ${e.message}`);
throw new Error(
`[TMDB] Failed to fetch movies by keyword: ${e.message}`,
{ cause: e }
);
}
}
@@ -459,7 +475,8 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(
`[TMDB] Failed to fetch TV recommendations: ${e.message}`
`[TMDB] Failed to fetch TV recommendations: ${e.message}`,
{ cause: e }
);
}
}
@@ -483,7 +500,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch TV similar: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch TV similar: ${e.message}`, {
cause: e,
});
}
}
@@ -569,7 +588,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch discover movies: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch discover movies: ${e.message}`, {
cause: e,
});
}
};
@@ -655,7 +676,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch discover TV: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch discover TV: ${e.message}`, {
cause: e,
});
}
};
@@ -681,7 +704,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch upcoming movies: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch upcoming movies: ${e.message}`, {
cause: e,
});
}
};
@@ -708,7 +733,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch all trending: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch all trending: ${e.message}`, {
cause: e,
});
}
};
@@ -734,7 +761,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch all trending: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch all trending: ${e.message}`, {
cause: e,
});
}
};
@@ -760,7 +789,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch all trending: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch all trending: ${e.message}`, {
cause: e,
});
}
};
@@ -792,7 +823,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to find by external ID: ${e.message}`);
throw new Error(`[TMDB] Failed to find by external ID: ${e.message}`, {
cause: e,
});
}
}
@@ -830,7 +863,8 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
throw new Error(`No movie or show returned from API for ID ${imdbId}`);
} catch (e) {
throw new Error(
`[TMDB] Failed to find media using external IMDb ID: ${e.message}`
`[TMDB] Failed to find media using external IMDb ID: ${e.message}`,
{ cause: e }
);
}
}
@@ -860,7 +894,8 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
throw new Error(`No show returned from API for ID ${tvdbId}`);
} catch (e) {
throw new Error(
`[TMDB] Failed to get TV show using the external TVDB ID: ${e.message}`
`[TMDB] Failed to get TV show using the external TVDB ID: ${e.message}`,
{ cause: e }
);
}
}
@@ -884,7 +919,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch collection: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch collection: ${e.message}`, {
cause: e,
});
}
}
@@ -900,7 +937,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return regions;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch countries: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch countries: ${e.message}`, {
cause: e,
});
}
}
@@ -916,7 +955,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return languages;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch langauges: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch langauges: ${e.message}`, {
cause: e,
});
}
}
@@ -928,7 +969,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch movie studio: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch movie studio: ${e.message}`, {
cause: e,
});
}
}
@@ -938,7 +981,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch TV network: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch TV network: ${e.message}`, {
cause: e,
});
}
}
@@ -989,7 +1034,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return movieGenres;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch movie genres: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch movie genres: ${e.message}`, {
cause: e,
});
}
}
@@ -1040,7 +1087,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return tvGenres;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch TV genres: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch TV genres: ${e.message}`, {
cause: e,
});
}
}
@@ -1055,7 +1104,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch movie certifications: ${e}`);
throw new Error(`[TMDB] Failed to fetch movie certifications: ${e}`, {
cause: e,
});
}
};
@@ -1069,7 +1120,10 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to fetch TV certifications: ${e.message}`);
throw new Error(
`[TMDB] Failed to fetch TV certifications: ${e.message}`,
{ cause: e }
);
}
};
@@ -1090,7 +1144,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
if (e.response?.status === 404) {
return null;
}
throw new Error(`[TMDB] Failed to fetch keyword: ${e.message}`);
throw new Error(`[TMDB] Failed to fetch keyword: ${e.message}`, {
cause: e,
});
}
}
@@ -1115,7 +1171,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to search keyword: ${e.message}`);
throw new Error(`[TMDB] Failed to search keyword: ${e.message}`, {
cause: e,
});
}
}
@@ -1140,7 +1198,9 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data;
} catch (e) {
throw new Error(`[TMDB] Failed to search companies: ${e.message}`);
throw new Error(`[TMDB] Failed to search companies: ${e.message}`, {
cause: e,
});
}
}
@@ -1163,7 +1223,8 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data.results;
} catch (e) {
throw new Error(
`[TMDB] Failed to fetch available watch regions: ${e.message}`
`[TMDB] Failed to fetch available watch regions: ${e.message}`,
{ cause: e }
);
}
}
@@ -1190,7 +1251,8 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data.results;
} catch (e) {
throw new Error(
`[TMDB] Failed to fetch movie watch providers: ${e.message}`
`[TMDB] Failed to fetch movie watch providers: ${e.message}`,
{ cause: e }
);
}
}
@@ -1217,7 +1279,8 @@ class TheMovieDb extends ExternalAPI implements TvShowProvider {
return data.results;
} catch (e) {
throw new Error(
`[TMDB] Failed to fetch TV watch providers: ${e.message}`
`[TMDB] Failed to fetch TV watch providers: ${e.message}`,
{ cause: e }
);
}
}

View File

@@ -156,7 +156,7 @@ class Tvdb extends ExternalAPI implements TvShowProvider {
}
return tmdbTvShow;
} catch (error) {
} catch {
return tmdbTvShow;
}
} catch (error) {

View File

@@ -13,7 +13,7 @@ export interface PaginatedResponse {
* Get the keys of an object that are not functions
*/
type NonFunctionPropertyNames<T> = {
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
[K in keyof T]: T[K] extends Function ? never : K;
}[keyof T];

View File

@@ -254,7 +254,7 @@ class ImageProxy {
imageBuffer: buffer,
};
}
} catch (e) {
} catch {
// No files. Treat as empty cache.
}

View File

@@ -23,7 +23,7 @@ export const hasNotificationType = (
types: Notification | Notification[],
value: number
): boolean => {
let total = 0;
let total: number;
// If we are not checking any notifications, bail out and return true
if (types === 0) {

View File

@@ -36,7 +36,7 @@ const checkOverseerrMerge = async (): Promise<boolean> => {
// We have to replace Jellyseerr migrations not working with Overseerr with a custom one
try {
// Filter out the Jellyseerr migrations and replace them with the Seerr migration
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
const newMigrations: MixedList<string | Function> = migrations
?.filter(
(migration) =>

View File

@@ -61,7 +61,7 @@ export async function checkAvatarChanged(
if (headResponse.status !== 200) {
return { changed: false };
}
} catch (error) {
} catch {
return { changed: false };
}

View File

@@ -915,7 +915,7 @@ discoverRoutes.get<Record<string, unknown>, WatchlistResponse>(
async (req, res) => {
const userRepository = getRepository(User);
const itemsPerPage = 20;
const page = Number(req.query.page) ?? 1;
const page = req.query.page ? Number(req.query.page) : 1;
const offset = (page - 1) * itemsPerPage;
const activeUser = await userRepository.findOne({

View File

@@ -48,8 +48,6 @@ mediaRoutes.get('/', async (req, res, next) => {
case 'pending':
statusFilter = MediaStatus.PENDING;
break;
default:
statusFilter = undefined;
}
let sortFilter: FindOneOptions<Media>['order'] = {

View File

@@ -269,7 +269,7 @@ router.post<
);
return res.status(204).send();
} catch (e) {
} catch {
logger.error('Failed to register user push subscription', {
label: 'API',
});
@@ -290,7 +290,7 @@ router.get<{ userId: string }>(
});
return res.status(200).json(userPushSubs);
} catch (e) {
} catch {
next({ status: 404, message: 'User subscriptions not found.' });
}
}
@@ -314,7 +314,7 @@ router.get<{ userId: string; endpoint: string }>(
});
return res.status(200).json(userPushSub);
} catch (e) {
} catch {
next({ status: 404, message: 'User subscription not found.' });
}
}
@@ -368,7 +368,7 @@ router.get<{ id: string }>('/:id', async (req, res, next) => {
const isAdmin = req.user?.hasPermission(Permission.MANAGE_USERS);
return res.status(200).json(user.filter(isOwnProfile || isAdmin));
} catch (e) {
} catch {
next({ status: 404, message: 'User not found.' });
}
});
@@ -513,7 +513,7 @@ router.put<{ id: string }>(
await userRepository.save(user);
return res.status(200).json(user.filter());
} catch (e) {
} catch {
next({ status: 404, message: 'User not found.' });
}
}
@@ -877,7 +877,7 @@ router.get<{ id: string }, WatchlistResponse>(
}
const itemsPerPage = 20;
const page = Number(req.query.page) ?? 1;
const page = req.query.page ? Number(req.query.page) : 1;
const offset = (page - 1) * itemsPerPage;
const user = await getRepository(User).findOneOrFail({

View File

@@ -1,4 +1,4 @@
declare module '@dr.pogodin/csurf' {
import csrf = require('csurf');
import csrf from 'csurf';
export = csrf;
}

View File

@@ -19,7 +19,7 @@ export const appDataPermissions = (): boolean => {
try {
accessSync(CONFIG_PATH);
return true;
} catch (err) {
} catch {
return false;
}
};

View File

@@ -6,7 +6,7 @@ const COMMIT_TAG_PATH = path.join(__dirname, '../../committag.json');
let commitTag = 'local';
if (existsSync(COMMIT_TAG_PATH)) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
commitTag = require(COMMIT_TAG_PATH).commitTag;
logger.info(`Commit Tag: ${commitTag}`);
}
@@ -16,7 +16,7 @@ export const getCommitTag = (): string => {
};
export const getAppVersion = (): string => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { version } = require('../../package.json');
let finalVersion = version;

View File

@@ -64,8 +64,8 @@ const BlocklistBlock = ({
});
}
onUpdate && onUpdate();
onDelete && onDelete();
onUpdate?.();
onDelete?.();
setIsUpdating(false);
};

View File

@@ -276,7 +276,7 @@ const BlocklistedTagImportForm = forwardRef<
label: data.name,
value: data.id,
};
} catch (err) {
} catch {
throw intl.formatMessage(messages.invalidKeyword, { keywordId });
}
})

View File

@@ -341,7 +341,7 @@ const CreateSlider = ({ onCreate, slider }: CreateSliderProps) => {
);
onCreate();
resetForm();
} catch (e) {
} catch {
addToast(
intl.formatMessage(slider ? messages.editfail : messages.addfail),
{

View File

@@ -84,7 +84,7 @@ const DiscoverSliderEdit = ({
autoDismiss: true,
});
onDelete();
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.deletefail), {
appearance: 'error',
autoDismiss: true,

View File

@@ -84,7 +84,7 @@ const Discover = () => {
});
setIsEditing(false);
mutate();
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.updatefailed), {
appearance: 'error',
autoDismiss: true,
@@ -102,7 +102,7 @@ const Discover = () => {
});
setIsEditing(false);
mutate();
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.resetfailed), {
appearance: 'error',
autoDismiss: true,
@@ -424,19 +424,21 @@ const Discover = () => {
const tempSliders = sliders.slice();
tempSliders.splice(originalPosition, 1);
hasClickedArrows
? tempSliders.splice(
position === 'Above' ? index - 1 : index + 1,
0,
originalItem
)
: tempSliders.splice(
position === 'Above' && index > originalPosition
? Math.max(index - 1, 0)
: index,
0,
originalItem
);
if (hasClickedArrows) {
tempSliders.splice(
position === 'Above' ? index - 1 : index + 1,
0,
originalItem
);
} else {
tempSliders.splice(
position === 'Above' && index > originalPosition
? Math.max(index - 1, 0)
: index,
0,
originalItem
);
}
setSliders(tempSliders);
}}

View File

@@ -51,7 +51,7 @@ const IssueComment = ({
const deleteComment = async () => {
try {
await axios.delete(`/api/v1/issueComment/${comment.id}`);
} catch (e) {
} catch {
// something went wrong deleting the comment
} finally {
if (onUpdate) {

View File

@@ -131,7 +131,7 @@ const IssueDetails = () => {
autoDismiss: true,
});
revalidateIssue();
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.toasteditdescriptionfailed), {
appearance: 'error',
autoDismiss: true,
@@ -149,7 +149,7 @@ const IssueDetails = () => {
});
revalidateIssue();
mutate('/api/v1/issue/count');
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.toaststatusupdatefailed), {
appearance: 'error',
autoDismiss: true,
@@ -167,7 +167,7 @@ const IssueDetails = () => {
autoDismiss: true,
});
router.push('/issues');
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.toastissuedeletefailed), {
appearance: 'error',
autoDismiss: true,

View File

@@ -138,7 +138,7 @@ const CreateIssueModal = ({
if (onCancel) {
onCancel();
}
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.toastFailedCreate), {
appearance: 'error',
autoDismiss: true,

View File

@@ -1,4 +1,4 @@
import Infinity from '@app/assets/infinity.svg';
import InfinityIcon from '@app/assets/infinity.svg';
import { SmallLoadingSpinner } from '@app/components/Common/LoadingSpinner';
import ProgressCircle from '@app/components/Common/ProgressCircle';
import defineMessages from '@app/utils/defineMessages';
@@ -56,7 +56,7 @@ const MiniQuotaDisplay = ({ userId }: MiniQuotaDisplayProps) => {
</>
) : (
<>
<Infinity className="w-7" />
<InfinityIcon className="w-7" />
<span className="font-bold">Unlimited</span>
</>
)}
@@ -82,7 +82,7 @@ const MiniQuotaDisplay = ({ userId }: MiniQuotaDisplayProps) => {
</>
) : (
<>
<Infinity className="w-7" />
<InfinityIcon className="w-7" />
<span className="font-bold">Unlimited</span>
</>
)}

View File

@@ -70,7 +70,7 @@ const AddEmailModal: React.FC<AddEmailModalProps> = ({
});
onSave();
} catch (e) {
} catch {
// set error here
}
}}

View File

@@ -80,7 +80,7 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
email: values.username,
});
} catch (e) {
let errorMessage = null;
let errorMessage = messages.loginerror;
switch (e?.response?.data?.message) {
case ApiErrorCode.InvalidUrl:
errorMessage = messages.invalidurlerror;
@@ -94,9 +94,6 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
case ApiErrorCode.NoAdminUser:
errorMessage = messages.noadminerror;
break;
default:
errorMessage = messages.loginerror;
break;
}
toasts.addToast(
intl.formatMessage(errorMessage, mediaServerFormatValues),

View File

@@ -61,7 +61,7 @@ const LocalLogin = ({ revalidate }: LocalLoginProps) => {
email: values.email,
password: values.password,
});
} catch (e) {
} catch {
setLoginError(intl.formatMessage(messages.loginerror));
} finally {
revalidate();

View File

@@ -344,7 +344,7 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
{ appearance: 'success', autoDismiss: true }
);
}
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.watchlistError), {
appearance: 'error',
autoDismiss: true,
@@ -371,7 +371,7 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
</span>,
{ appearance: 'info', autoDismiss: true }
);
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.watchlistError), {
appearance: 'error',
autoDismiss: true,

View File

@@ -70,7 +70,7 @@ export const hasNotificationType = (
types: Notification | Notification[],
value: number
): boolean => {
let total = 0;
let total: number;
// If we are not checking any notifications, bail out and return true
if (types === 0) {

View File

@@ -283,7 +283,7 @@ const RequestCard = ({ request, onTitleData }: RequestCardProps) => {
if (response) {
revalidate();
}
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.failedretry), {
autoDismiss: true,
appearance: 'error',

View File

@@ -355,7 +355,7 @@ const RequestItem = ({ request, revalidateList }: RequestItemProps) => {
try {
const result = await axios.post(`/api/v1/request/${request.id}/retry`);
revalidate(result.data);
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.failedretry), {
autoDismiss: true,
appearance: 'error',

View File

@@ -229,7 +229,7 @@ const CollectionRequestModal = ({
</span>,
{ appearance: 'success', autoDismiss: true }
);
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.requesterror), {
appearance: 'error',
autoDismiss: true,

View File

@@ -124,7 +124,7 @@ const MovieRequestModal = ({
{ appearance: 'success', autoDismiss: true }
);
}
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.requesterror), {
appearance: 'error',
autoDismiss: true,
@@ -167,7 +167,7 @@ const MovieRequestModal = ({
{ appearance: 'success', autoDismiss: true }
);
}
} catch (e) {
} catch {
setIsUpdating(false);
}
};
@@ -212,7 +212,7 @@ const MovieRequestModal = ({
if (onComplete) {
onComplete(MediaStatus.PENDING);
}
} catch (e) {
} catch {
addToast(<span>{intl.formatMessage(messages.errorediting)}</span>, {
appearance: 'error',
autoDismiss: true,

View File

@@ -157,7 +157,7 @@ const TvRequestModal = ({
if (onComplete) {
onComplete(MediaStatus.PENDING);
}
} catch (e) {
} catch {
addToast(<span>{intl.formatMessage(messages.errorediting)}</span>, {
appearance: 'error',
autoDismiss: true,
@@ -223,7 +223,7 @@ const TvRequestModal = ({
{ appearance: 'success', autoDismiss: true }
);
}
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.requesterror), {
appearance: 'error',
autoDismiss: true,

View File

@@ -103,7 +103,7 @@ const NotificationsDiscord = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.discordsettingsfailed), {
appearance: 'error',
autoDismiss: true,
@@ -156,7 +156,7 @@ const NotificationsDiscord = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
if (toastId) {
removeToast(toastId);
}

View File

@@ -175,7 +175,7 @@ const NotificationsEmail = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.emailsettingsfailed), {
appearance: 'error',
autoDismiss: true,
@@ -226,7 +226,7 @@ const NotificationsEmail = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
if (toastId) {
removeToast(toastId);
}

View File

@@ -109,7 +109,7 @@ const NotificationsGotify = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.gotifysettingsfailed), {
appearance: 'error',
autoDismiss: true,
@@ -159,7 +159,7 @@ const NotificationsGotify = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
if (toastId) {
removeToast(toastId);
}

View File

@@ -125,7 +125,7 @@ const NotificationsNtfy = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.ntfysettingsfailed), {
appearance: 'error',
autoDismiss: true,
@@ -180,7 +180,7 @@ const NotificationsNtfy = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
if (toastId) {
removeToast(toastId);
}

View File

@@ -80,7 +80,7 @@ const NotificationsPushbullet = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.pushbulletSettingsFailed), {
appearance: 'error',
autoDismiss: true,
@@ -129,7 +129,7 @@ const NotificationsPushbullet = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
if (toastId) {
removeToast(toastId);
}

View File

@@ -115,7 +115,7 @@ const NotificationsPushover = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.pushoversettingsfailed), {
appearance: 'error',
autoDismiss: true,
@@ -166,7 +166,7 @@ const NotificationsPushover = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
if (toastId) {
removeToast(toastId);
}

View File

@@ -79,7 +79,7 @@ const NotificationsSlack = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.slacksettingsfailed), {
appearance: 'error',
autoDismiss: true,
@@ -128,7 +128,7 @@ const NotificationsSlack = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
if (toastId) {
removeToast(toastId);
}

View File

@@ -117,7 +117,7 @@ const NotificationsTelegram = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.telegramsettingsfailed), {
appearance: 'error',
autoDismiss: true,
@@ -169,7 +169,7 @@ const NotificationsTelegram = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
if (toastId) {
removeToast(toastId);
}

View File

@@ -70,7 +70,7 @@ const NotificationsWebPush = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.webpushsettingsfailed), {
appearance: 'error',
autoDismiss: true,
@@ -108,7 +108,7 @@ const NotificationsWebPush = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
if (toastId) {
removeToast(toastId);
}

View File

@@ -194,7 +194,7 @@ const NotificationsWebhook = () => {
try {
JSON.parse(value ?? '');
return true;
} catch (e) {
} catch {
return false;
}
}
@@ -242,7 +242,7 @@ const NotificationsWebhook = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.webhooksettingsfailed), {
appearance: 'error',
autoDismiss: true,
@@ -313,7 +313,7 @@ const NotificationsWebhook = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
if (toastId) {
removeToast(toastId);
}

View File

@@ -108,7 +108,7 @@ const OverrideRuleModal = ({
setIsValidated(true);
setTestResponse(response.data);
} catch (e) {
} catch {
setIsValidated(false);
} finally {
setIsTesting(false);
@@ -191,7 +191,7 @@ const OverrideRuleModal = ({
});
}
onClose();
} catch (e) {
} catch {
// set error here
}
}}

View File

@@ -173,7 +173,7 @@ const RadarrModal = ({ onClose, radarr, onSave }: RadarrModalProps) => {
autoDismiss: true,
});
}
} catch (e) {
} catch {
setIsValidated(false);
if (initialLoad.current) {
addToast(intl.formatMessage(messages.toastRadarrTestFailure), {
@@ -268,7 +268,7 @@ const RadarrModal = ({ onClose, radarr, onSave }: RadarrModalProps) => {
}
onSave();
} catch (e) {
} catch {
// set error here
}
}}

View File

@@ -308,7 +308,7 @@ const SettingsJobs = () => {
dispatch({ type: 'close' });
revalidate();
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.jobScheduleEditFailed), {
appearance: 'error',
autoDismiss: true,

View File

@@ -130,7 +130,7 @@ const SettingsMain = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.toastApiKeyFailure), {
autoDismiss: true,
appearance: 'error',
@@ -211,7 +211,7 @@ const SettingsMain = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.toastSettingsFailure), {
autoDismiss: true,
appearance: 'error',

View File

@@ -134,7 +134,7 @@ const SettingsMetadata = () => {
}
// In case of error without usable data
throw new Error('Failed to test connection');
throw new Error('Failed to test connection', { cause: error });
}
};
@@ -203,7 +203,7 @@ const SettingsMetadata = () => {
}
}
throw new Error('Failed to save Metadata settings');
throw new Error('Failed to save Metadata settings', { cause: error });
}
};
@@ -322,7 +322,7 @@ const SettingsMetadata = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(
intl.formatMessage(messages.failedToSaveMetadataSettings),
{
@@ -428,7 +428,7 @@ const SettingsMetadata = () => {
}
);
}
} catch (e) {
} catch {
addToast(
intl.formatMessage(messages.connectionTestFailed),
{

View File

@@ -175,7 +175,7 @@ const SettingsNetwork = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.toastSettingsFailure), {
autoDismiss: true,
appearance: 'error',

View File

@@ -276,7 +276,7 @@ const SettingsPlex = ({ onComplete }: SettingsPlexProps) => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
if (toastId) {
removeToast(toastId);
}
@@ -407,7 +407,7 @@ const SettingsPlex = ({ onComplete }: SettingsPlexProps) => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
if (toastId) {
removeToast(toastId);
}
@@ -770,7 +770,7 @@ const SettingsPlex = ({ onComplete }: SettingsPlexProps) => {
appearance: 'success',
}
);
} catch (e) {
} catch {
addToast(
intl.formatMessage(messages.toastTautulliSettingsFailure),
{

View File

@@ -139,7 +139,7 @@ const SettingsUsers = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.toastSettingsFailure), {
autoDismiss: true,
appearance: 'error',

View File

@@ -183,7 +183,7 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => {
autoDismiss: true,
});
}
} catch (e) {
} catch {
setIsValidated(false);
if (initialLoad.current) {
addToast(intl.formatMessage(messages.toastSonarrTestFailure), {
@@ -304,7 +304,7 @@ const SonarrModal = ({ onClose, sonarr, onSave }: SonarrModalProps) => {
}
onSave();
} catch (e) {
} catch {
// set error here
}
}}

View File

@@ -128,7 +128,7 @@ function JellyfinSetup({
serverType: serverType,
});
} catch (e) {
let errorMessage = null;
let errorMessage = messages.loginerror;
switch (e?.response?.data?.message) {
case ApiErrorCode.InvalidUrl:
errorMessage = messages.invalidurlerror;
@@ -142,9 +142,6 @@ function JellyfinSetup({
case ApiErrorCode.NoAdminUser:
errorMessage = messages.noadminerror;
break;
default:
errorMessage = messages.loginerror;
break;
}
toasts.addToast(

View File

@@ -90,7 +90,7 @@ const Setup = () => {
);
setMediaServerSettingsComplete(hasEnabledLibraries);
} catch (e) {
} catch {
toasts.addToast(intl.formatMessage(messages.librarieserror), {
autoDismiss: true,
appearance: 'error',

View File

@@ -125,7 +125,7 @@ const TitleCard = ({
{ appearance: 'success', autoDismiss: true }
);
}
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.watchlistError), {
appearance: 'error',
autoDismiss: true,
@@ -154,7 +154,7 @@ const TitleCard = ({
{ appearance: 'info', autoDismiss: true }
);
}
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.watchlistError), {
appearance: 'error',
autoDismiss: true,

View File

@@ -57,7 +57,7 @@ const BulkEditModal = ({
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.userfail), {
appearance: 'error',
autoDismiss: true,

View File

@@ -87,7 +87,7 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
if (onComplete) {
onComplete();
}
} catch (e) {
} catch {
addToast(
intl.formatMessage(messages.importfromJellyfinerror, {
mediaServerName:

View File

@@ -71,7 +71,7 @@ const PlexImportModal = ({ onCancel, onComplete }: PlexImportProps) => {
if (onComplete) {
onComplete();
}
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.importfromplexerror), {
autoDismiss: true,
appearance: 'error',

View File

@@ -190,7 +190,7 @@ const UserList = () => {
appearance: 'success',
});
setDeleteModal({ isOpen: false, user: deleteModal.user });
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.userdeleteerror), {
autoDismiss: true,
appearance: 'error',

View File

@@ -84,7 +84,7 @@ const UserNotificationsDiscord = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.discordsettingsfailed), {
appearance: 'error',
autoDismiss: true,

View File

@@ -83,7 +83,7 @@ const UserEmailSettings = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.emailsettingsfailed), {
appearance: 'error',
autoDismiss: true,

View File

@@ -81,7 +81,7 @@ const UserPushbulletSettings = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.pushbulletsettingsfailed), {
appearance: 'error',
autoDismiss: true,

View File

@@ -113,7 +113,7 @@ const UserPushoverSettings = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.pushoversettingsfailed), {
appearance: 'error',
autoDismiss: true,

View File

@@ -108,7 +108,7 @@ const UserTelegramSettings = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.telegramsettingsfailed), {
appearance: 'error',
autoDismiss: true,

View File

@@ -95,7 +95,7 @@ const UserWebPushSettings = () => {
} else {
throw new Error('Subscription failed');
}
} catch (error) {
} catch {
addToast(intl.formatMessage(messages.enablingwebpusherror), {
appearance: 'error',
autoDismiss: true,
@@ -135,7 +135,7 @@ const UserWebPushSettings = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (error) {
} catch {
addToast(intl.formatMessage(messages.disablingwebpusherror), {
autoDismiss: true,
appearance: 'error',
@@ -157,7 +157,7 @@ const UserWebPushSettings = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (error) {
} catch {
addToast(intl.formatMessage(messages.subscriptiondeleteerror), {
autoDismiss: true,
appearance: 'error',
@@ -272,7 +272,7 @@ const UserWebPushSettings = () => {
appearance: 'success',
autoDismiss: true,
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.webpushsettingsfailed), {
appearance: 'error',
autoDismiss: true,

View File

@@ -133,7 +133,7 @@ const UserPasswordChange = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
addToast(
intl.formatMessage(
data.hasPassword && user?.id === currentUser?.id

View File

@@ -92,7 +92,7 @@ const UserPermissions = () => {
autoDismiss: true,
appearance: 'success',
});
} catch (e) {
} catch {
addToast(intl.formatMessage(messages.toastSettingsFailure), {
autoDismiss: true,
appearance: 'error',

View File

@@ -36,7 +36,7 @@ async function extractMessages(
.replace(/,$/, '');
const messagesJson = JSON.parse(`{${formattedMessages}}`);
return { namespace: namespace.trim(), messages: messagesJson };
} catch (e) {
} catch {
return null;
}
}

View File

@@ -297,7 +297,7 @@ CoreApp.getInitialProps = async (initialProps) => {
});
ctx.res.end();
}
} catch (e) {
} catch {
// If there is no user, and ctx.res is set (to check if we are on the server side)
// _AND_ we are not already on the login or setup route, redirect to /login with a 307
// before anything actually renders

View File

@@ -97,14 +97,16 @@ export const verifyAndResubscribePushSubscription = async (
oldEndpoint
)}`
);
} catch (error) {
} catch {
// Ignore errors when deleting old endpoint (it might not exist)
}
}
return true;
} catch (error) {
throw new Error(`[SW] Resubscribe failed: ${error.message}`);
throw new Error(`[SW] Resubscribe failed: ${error.message}`, {
cause: error,
});
}
}
@@ -151,7 +153,8 @@ export const subscribeToPushNotifications = async (
return false;
} catch (error) {
throw new Error(
`Issue subscribing to push notifications: ${error.message}`
`Issue subscribing to push notifications: ${error.message}`,
{ cause: error }
);
}
};
@@ -181,7 +184,8 @@ export const unsubscribeToPushNotifications = async (
return null;
} catch (error) {
throw new Error(
`Issue unsubscribing to push notifications: ${error.message}`
`Issue unsubscribing to push notifications: ${error.message}`,
{ cause: error }
);
}
};

View File

@@ -1,4 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const defaultTheme = require('tailwindcss/defaultTheme');
/** @type {import('tailwindcss').Config} */