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

@@ -7,6 +7,8 @@ import type { KomgaBookWithPages } from "@/types/komga";
import type { NextRequest } from "next/server";
import logger from "@/lib/logger";
type ErrorWithStatusParams = AppError & { params?: { status?: number } };
// Cache handled in service via fetchFromApi options
export async function GET(
@@ -25,7 +27,8 @@ export async function GET(
if (error instanceof AppError) {
const isNotFound =
error.code === ERROR_CODES.BOOK.NOT_FOUND ||
(error.code === ERROR_CODES.KOMGA.HTTP_ERROR && (error as any).params?.status === 404);
(error.code === ERROR_CODES.KOMGA.HTTP_ERROR &&
(error as ErrorWithStatusParams).params?.status === 404);
return NextResponse.json(
{
error: {

View File

@@ -26,7 +26,7 @@ export async function GET(
if (httpStatus === 404) {
const { bookId, pageNumber } = await params;
// eslint-disable-next-line no-console
logger.info(`📷 Page ${pageNumber} not found for book: ${bookId}`);
return NextResponse.json(
{

View File

@@ -41,7 +41,7 @@ export async function GET(
if (httpStatus === 404) {
const { bookId, pageNumber: pageNumberParam } = await params;
const pageNumber: number = parseInt(pageNumberParam);
// eslint-disable-next-line no-console
logger.info(`📷 Page ${pageNumber} thumbnail not found for book: ${bookId}`);
return NextResponse.json(
{

View File

@@ -24,7 +24,7 @@ export async function GET(
if (httpStatus === 404) {
const bookId: string = (await params).bookId;
// eslint-disable-next-line no-console
logger.info(`📷 Thumbnail not found for book: ${bookId}`);
return NextResponse.json(
{

View File

@@ -26,7 +26,7 @@ export async function GET(
if (httpStatus === 404) {
const seriesId: string = (await params).seriesId;
// eslint-disable-next-line no-console
logger.info(`📷 First page image not found for series: ${seriesId}`);
return NextResponse.json(
{