From 0977765a877e47d3ce11de686c0e70da2eae847a Mon Sep 17 00:00:00 2001 From: alma Date: Fri, 16 Jan 2026 22:59:58 +0100 Subject: [PATCH] Fondation --- .eslintrc.json | 8 ++++++++ app/api/notifications/[id]/read/route.ts | 5 +++-- next.config.mjs | 6 ++---- 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..4d5fa00 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,8 @@ +{ + "extends": ["next/core-web-vitals", "next/typescript"], + "rules": { + "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }], + "@typescript-eslint/no-explicit-any": "warn", + "react-hooks/exhaustive-deps": "warn" + } +} diff --git a/app/api/notifications/[id]/read/route.ts b/app/api/notifications/[id]/read/route.ts index 5f8d90e..97ce659 100644 --- a/app/api/notifications/[id]/read/route.ts +++ b/app/api/notifications/[id]/read/route.ts @@ -7,7 +7,7 @@ import { logger } from '@/lib/logger'; // POST /api/notifications/[id]/read export async function POST( request: Request, - { params }: { params: { id: string } } + { params }: { params: Promise<{ id: string }> } ) { try { const session = await getServerSession(authOptions); @@ -15,7 +15,8 @@ export async function POST( return NextResponse.json({ error: "Not authenticated" }, { status: 401 }); } - const notificationId = params.id; + const { id } = await params; + const notificationId = id; if (!notificationId) { return NextResponse.json( { error: "Notification ID is required" }, diff --git a/next.config.mjs b/next.config.mjs index 5165e91..4d6d450 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,9 +1,7 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - eslint: { - ignoreDuringBuilds: false, // ✅ Réactivé - corriger les erreurs avant build - dirs: ['app', 'components', 'lib'], // Limiter aux dossiers pertinents - }, + // Note: ESLint configuration is now done via .eslintrc.json or next lint command + // The eslint option in next.config.mjs is deprecated in Next.js 16 typescript: { ignoreBuildErrors: false, // ✅ Réactivé - corriger les erreurs avant build },