1 Commits

Author SHA1 Message Date
Mistral Vibe
48a73246a1 fix(lint): resolve eslint errors and warnings
- audioService: replace 'as any' with 'as unknown as AudioService' in
  resetInstance() to satisfy @typescript-eslint/no-explicit-any
- SongPage: add isReady to spacebar useEffect deps so the handler always
  sees the current readiness state
- useWaveform: add containerRef to deps (stable ref, safe to include);
  suppress exhaustive-deps for options.onReady with explanation — adding
  an un-memoized callback would cause initialization on every render

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 21:52:44 +02:00
3 changed files with 8 additions and 3 deletions

View File

@@ -77,7 +77,12 @@ export function useWaveform(
};
initializeAudio();
}, [options.url, options.songId, options.bandId]);
// containerRef is a stable ref object — safe to include.
// options.onReady is intentionally omitted: it's a callback that callers
// may not memoize, and re-running initialization on every render would be
// worse than stale-closing over it for the brief window after mount.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [options.url, options.songId, options.bandId, containerRef]);
const play = () => {
audioService.play(options.songId ?? null, options.bandId ?? null)

View File

@@ -392,7 +392,7 @@ export function SongPage() {
};
window.addEventListener("keydown", handleKeyDown);
return () => window.removeEventListener("keydown", handleKeyDown);
}, [isPlaying, play, pause]);
}, [isPlaying, isReady, play, pause]);
// ── Comments ─────────────────────────────────────────────────────────────

View File

@@ -26,7 +26,7 @@ class AudioService {
// For use in tests only
public static resetInstance(): void {
this.instance?.cleanup();
this.instance = undefined as any;
this.instance = undefined as unknown as AudioService;
}
private createMediaElement(): HTMLAudioElement {