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

+8 -3
View File
@@ -4,11 +4,16 @@ import { readFileSync } from "node:fs";
import { runInNewContext } from "node:vm";
const codice = readFileSync(new URL("../../public/push-sw.js", import.meta.url), "utf8");
type Evento = { data?: { json: () => unknown } | null; waitUntil: (p: Promise<unknown>) => void };
type Evento = {
data?: { json: () => unknown } | null | undefined;
waitUntil: (p: Promise<unknown>) => void;
};
// `renotify` è supportato da Chromium ma manca dai tipi DOM di TypeScript.
type OpzioniNotifica = NotificationOptions & { renotify?: boolean };
function avviaWorker() {
const listener = new Map<string, (event: Evento) => void>();
const notifiche: Array<{ titolo: string; opzioni: NotificationOptions }> = [];
const notifiche: Array<{ titolo: string; opzioni: OpzioniNotifica }> = [];
let completa: (() => void) | undefined;
const mostrata = new Promise<void>((resolve) => (completa = resolve));
const installata = Promise.resolve();
@@ -23,7 +28,7 @@ function avviaWorker() {
matchAll: () => assert.fail("la push deve funzionare senza consultare finestre aperte"),
},
registration: {
showNotification(titolo: string, opzioni: NotificationOptions) {
showNotification(titolo: string, opzioni: OpzioniNotifica) {
notifiche.push({ titolo, opzioni });
return mostrata;
},