chore: resolve lint warnings with targeted type and rule fixes

This commit is contained in:
2026-02-28 11:59:30 +01:00
parent 1a88efc46b
commit 612a70ffbe
35 changed files with 107 additions and 63 deletions

View File

@@ -6,7 +6,6 @@ import { RefreshButton } from "@/components/library/RefreshButton";
import { PullToRefreshIndicator } from "@/components/common/PullToRefreshIndicator";
import { usePullToRefresh } from "@/hooks/usePullToRefresh";
import { useTranslate } from "@/hooks/useTranslate";
import logger from "@/lib/logger";
interface HomeClientWrapperProps {
children: ReactNode;
@@ -20,22 +19,10 @@ export function HomeClientWrapper({ children }: HomeClientWrapperProps) {
const handleRefresh = async () => {
try {
setIsRefreshing(true);
// Fetch fresh data from network with cache bypass
const response = await fetch("/api/komga/home", {
cache: "no-store",
headers: { "Cache-Control": "no-cache" },
});
if (!response.ok) {
throw new Error("Failed to refresh home");
}
// Trigger Next.js revalidation to update the UI
// Re-fetch server-side data
router.refresh();
return { success: true };
} catch (error) {
logger.error({ err: error }, "Erreur lors du rafraîchissement:");
} catch (_error) {
return { success: false, error: "Erreur lors du rafraîchissement de la page d'accueil" };
} finally {
setIsRefreshing(false);

View File

@@ -12,7 +12,10 @@ interface SeriesGridProps {
}
// Utility function to get reading status info
const getReadingStatusInfo = (series: KomgaSeries, t: (key: string, options?: any) => string) => {
const getReadingStatusInfo = (
series: KomgaSeries,
t: (key: string, options?: { [key: string]: string | number }) => string
) => {
if (series.booksCount === 0) {
return {
label: t("series.status.noBooks"),

View File

@@ -20,7 +20,10 @@ interface SeriesListItemProps {
}
// Utility function to get reading status info
const getReadingStatusInfo = (series: KomgaSeries, t: (key: string, options?: any) => string) => {
const getReadingStatusInfo = (
series: KomgaSeries,
t: (key: string, options?: { [key: string]: string | number }) => string
) => {
if (series.booksCount === 0) {
return {
label: t("series.status.noBooks"),

View File

@@ -1,4 +1,4 @@
/* eslint-disable @next/next/no-img-element */
"use client";
import { useEffect, useState, useCallback, useRef } from "react";

View File

@@ -4,7 +4,7 @@ import { useReadingDirection } from "./useReadingDirection";
interface UseTouchNavigationProps {
onPreviousPage: () => void;
onNextPage: () => void;
pswpRef: React.MutableRefObject<any>;
pswpRef: React.MutableRefObject<unknown>;
}
export function useTouchNavigation({

View File

@@ -9,6 +9,10 @@ interface BeforeInstallPromptEvent extends Event {
userChoice: Promise<{ outcome: "accepted" | "dismissed" }>;
}
interface NavigatorStandalone extends Navigator {
standalone?: boolean;
}
const DISMISS_KEY = "pwa-install-dismissed";
const DISMISS_DURATION = 7 * 24 * 60 * 60 * 1000; // 7 jours en millisecondes
@@ -24,7 +28,7 @@ export function InstallPWA() {
const checkStandalone = () => {
return (
window.matchMedia("(display-mode: standalone)").matches ||
(window.navigator as any).standalone ||
(window.navigator as NavigatorStandalone).standalone ||
document.referrer.includes("android-app://")
);
};

View File

@@ -15,7 +15,10 @@ import { useBookOfflineStatus } from "@/hooks/useBookOfflineStatus";
import { WifiOff } from "lucide-react";
// Fonction utilitaire pour obtenir les informations de statut de lecture
const getReadingStatusInfo = (book: KomgaBook, t: (key: string, options?: any) => string) => {
const getReadingStatusInfo = (
book: KomgaBook,
t: (key: string, options?: { [key: string]: string | number }) => string
) => {
if (!book.readProgress) {
return {
label: t("books.status.unread"),

View File

@@ -1,7 +1,7 @@
import * as React from "react";
import { cn } from "@/lib/utils";
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => {

View File

@@ -9,7 +9,7 @@ interface TabsProps extends React.HTMLAttributes<HTMLDivElement> {
onValueChange?: (value: string) => void;
}
interface TabsListProps extends React.HTMLAttributes<HTMLDivElement> {}
type TabsListProps = React.HTMLAttributes<HTMLDivElement>;
interface TabsTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
value: string;