Refactor ESLint configuration and update code formatting: Standardize quotes in eslint.config.mjs, next.config.js, and various TypeScript files for consistency. Add Prettier as a dependency and include formatting scripts in package.json. Clean up unnecessary whitespace in multiple files to enhance code readability.

This commit is contained in:
Julien Froidefond
2025-12-10 11:30:00 +01:00
parent 66237458ec
commit d11059dac2
52 changed files with 9075 additions and 6140 deletions

View File

@@ -45,4 +45,3 @@ export async function GET() {
);
}
}

View File

@@ -17,7 +17,10 @@ export async function POST(request: Request) {
const file = formData.get("file") as File;
if (!file) {
return NextResponse.json({ error: "Aucun fichier fourni" }, { status: 400 });
return NextResponse.json(
{ error: "Aucun fichier fourni" },
{ status: 400 }
);
}
// Vérifier le type de fichier
@@ -55,4 +58,3 @@ export async function POST(request: Request) {
);
}
}

View File

@@ -53,21 +53,21 @@ export async function PUT(request: Request) {
where: { id: "global" },
update: {
homeBackground:
homeBackground === "" ? null : homeBackground ?? undefined,
homeBackground === "" ? null : (homeBackground ?? undefined),
eventsBackground:
eventsBackground === "" ? null : eventsBackground ?? undefined,
eventsBackground === "" ? null : (eventsBackground ?? undefined),
leaderboardBackground:
leaderboardBackground === ""
? null
: leaderboardBackground ?? undefined,
: (leaderboardBackground ?? undefined),
},
create: {
id: "global",
homeBackground: homeBackground === "" ? null : homeBackground ?? null,
homeBackground: homeBackground === "" ? null : (homeBackground ?? null),
eventsBackground:
eventsBackground === "" ? null : eventsBackground ?? null,
eventsBackground === "" ? null : (eventsBackground ?? null),
leaderboardBackground:
leaderboardBackground === "" ? null : leaderboardBackground ?? null,
leaderboardBackground === "" ? null : (leaderboardBackground ?? null),
},
});

View File

@@ -99,7 +99,7 @@ export async function PUT(
// Si le niveau est modifié directement, utiliser cette valeur
const targetLevel = Math.max(1, level);
updateData.level = targetLevel;
// Recalculer le maxXp pour le nouveau niveau
// Formule: maxXp = 5000 * (1.2 ^ (level - 1))
let calculatedMaxXp = 5000;
@@ -107,7 +107,7 @@ export async function PUT(
calculatedMaxXp = Math.floor(calculatedMaxXp * 1.2);
}
updateData.maxXp = calculatedMaxXp;
// Réinitialiser l'XP si le niveau change directement (sauf si on modifie aussi l'XP)
if (targetLevel !== user.level && xpDelta === undefined) {
updateData.xp = 0;
@@ -196,4 +196,3 @@ export async function DELETE(
);
}
}

View File

@@ -41,4 +41,3 @@ export async function GET() {
);
}
}