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

@@ -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',