Fix pre-commit script to properly handle multiple files and resolve ESLint warnings
This commit is contained in:
@@ -97,7 +97,7 @@ const AuthPage: React.FC = () => {
|
||||
if (!success) {
|
||||
setError(`${provider} authentication failed. Please try again.`);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
setError(`${provider} authentication failed. Please try again.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -52,8 +52,10 @@ const ChangePasswordModal: React.FC<ChangePasswordModalProps> = ({
|
||||
await authService.changePassword(user!._id, currentPassword, newPassword);
|
||||
onSuccess();
|
||||
onClose();
|
||||
} catch (error: any) {
|
||||
setError(error.message || 'Failed to change password');
|
||||
} catch (error: unknown) {
|
||||
setError(
|
||||
error instanceof Error ? error.message : 'Failed to change password'
|
||||
);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ const AccountModal: React.FC<AccountModalProps> = ({
|
||||
await onUpdateUser({ ...user, username: username.trim() });
|
||||
setSuccessMessage('Username updated successfully!');
|
||||
setTimeout(() => setSuccessMessage(''), 3000);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
alert('Failed to update username.');
|
||||
} finally {
|
||||
setIsSaving(false);
|
||||
@@ -77,6 +77,7 @@ const AccountModal: React.FC<AccountModalProps> = ({
|
||||
};
|
||||
|
||||
const handleRemoveAvatar = async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { avatar, ...userWithoutAvatar } = user;
|
||||
setIsSaving(true);
|
||||
try {
|
||||
@@ -90,7 +91,7 @@ const AccountModal: React.FC<AccountModalProps> = ({
|
||||
setIsDeleting(true);
|
||||
try {
|
||||
await onDeleteAllData();
|
||||
} catch (error) {
|
||||
} catch {
|
||||
alert('Failed to delete data.');
|
||||
} finally {
|
||||
setIsDeleting(false);
|
||||
|
||||
Reference in New Issue
Block a user