Azzera errori di lint e di tipo e corregge il test sugli slot della rosa

- schema-profili: il test pretendeva che lo slot g1 fosse libero, ma in
  produzione è collegato a un giocatore vero; ora verifica che il
  tentativo anonimo non cambi il valore.
- rosa: il default dei voti MVP era fuori da useMemo e faceva ricalcolare
  la rosa a ogni render finché i voti non erano caricati.
- test dei badge, profili-core, push-sw, scout-stato: tipi allineati al
  codice (MappaPresenze, nascita da M18, renotify, narrowing di deepEqual).
- vite.config: tipizzato come UserConfig e rimosso esbuild.keepNames,
  ignorato da Vite 8 che non usa più esbuild.
- formattazione Prettier in BarraSottosezioni e classifica.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
davideandClaude Opus 5.5 committed 2026-09-24 12:14:37 +02:00
1 parent 61d4dacb3a
commit 431530af2a
13 files changed
+56 -44

No files matched your search

+3 -7
View File
@@ -1,5 +1,5 @@
import { useEffect, useRef, useState, type ReactNode } from "react";
import { motion } from "motion/react";
import { motion, type Transition } from "motion/react";
import { cn } from "@/lib/utils";
import { proietta } from "@/lib/molla";
import { useMotoRidotto } from "@/lib/motion";
@@ -13,7 +13,7 @@ export type VoceSottosezione = {
};
/** Tween breve: evita molle + exit che tengono due pannelli in DOM insieme. */
const transizioneTab = { type: "tween" as const, duration: 0.16, ease: [0.25, 0.1, 0.25, 1] };
const transizioneTab: Transition = { type: "tween", duration: 0.16, ease: [0.25, 0.1, 0.25, 1] };
/**
* Barra di sottosezioni in un'unica fila e pannello che mostra una sola sezione
@@ -116,11 +116,7 @@ export function BarraSottosezioni({
}}
className={cn(
"min-h-11 touch-manipulation whitespace-nowrap text-sm font-bold uppercase tracking-wide transition-colors",
riempiLarghezza
? "min-w-0 flex-1"
: sottolineatura
? "shrink-0"
: "w-full",
riempiLarghezza ? "min-w-0 flex-1" : sottolineatura ? "shrink-0" : "w-full",
sottolineatura
? cn(
"rounded-xl px-1 py-2.5 text-center",
+2 -2
View File
@@ -67,7 +67,7 @@ export function useRosa(): Giocatore[] {
const { eventi } = useEventi();
const { presenze: mappaPresenze, tempi } = useRispostePresenze();
const votiMvp = voti.data ?? [];
const votiMvp = voti.data;
return useMemo(() => {
const medie = mediePagelle(pagelle);
@@ -76,7 +76,7 @@ export function useRosa(): Giocatore[] {
// premiare chi ha davvero portato i palloni, non chi l'algoritmo di rotazione ha
// scelto per un evento passato senza che nessuno confermasse nulla.
const palloni = conteggioTurni(turniSalvati, eventi);
const mvpVinti = mvpVintiPerGiocatore(votiMvp);
const mvpVinti = mvpVintiPerGiocatore(votiMvp ?? []);
return squadra
.filter((g) => g.attivo)
+3 -10
View File
@@ -26,9 +26,7 @@ function LogoPartita({
avversario: string;
}) {
if (nostro) {
return (
<TeamLogo src={LOGO_NOI} className="h-8 w-8 rounded-lg shadow-none" />
);
return <TeamLogo src={LOGO_NOI} className="h-8 w-8 rounded-lg shadow-none" />;
}
if (logoAvversario) {
return <LogoSquadra src={logoAvversario} alt={avversario} className="h-8 w-8" />;
@@ -254,10 +252,7 @@ function Classifica() {
{setCasa}-{setOspite}
</span>
{cliccabile ? (
<ChevronRight
className="h-5 w-5 shrink-0 text-muted-foreground"
aria-hidden
/>
<ChevronRight className="h-5 w-5 shrink-0 text-muted-foreground" aria-hidden />
) : null}
</div>
<div className="mt-3 flex flex-wrap items-center gap-1.5">
@@ -270,9 +265,7 @@ function Classifica() {
key={i}
className={cn(
"rounded-lg px-2 py-1 text-xs font-semibold tabular-nums",
setVintoDaNoi
? "bg-secondary"
: "bg-muted text-muted-foreground",
setVintoDaNoi ? "bg-secondary" : "bg-muted text-muted-foreground",
)}
>
{puntiCasa}-{puntiOspite}