diff --git a/src/pages/DrawName.tsx b/src/pages/DrawName.tsx index 806fa69..673a246 100644 --- a/src/pages/DrawName.tsx +++ b/src/pages/DrawName.tsx @@ -29,12 +29,9 @@ const DrawName: FunctionComponent = ({ names }) => { } return <>
- {names.map(([name, _], i) => { - if (completed.includes(i)) { - return null; - } else { - return ; - } + {names.map(([name], i) => { + if (completed.includes(i)) return null; + return ; })}
diff --git a/src/pages/EnterNames.tsx b/src/pages/EnterNames.tsx index 6902b68..7c74921 100644 --- a/src/pages/EnterNames.tsx +++ b/src/pages/EnterNames.tsx @@ -22,7 +22,7 @@ const EnterNames: FunctionComponent = ({ names, start }) => { return <> diff --git a/src/util.ts b/src/util.ts index 7192cd0..a53f71a 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,6 +1,6 @@ import { useEffect } from "preact/hooks"; -export function useWindowEvent(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void { +export function useWindowEvent(type: K, listener: (this: Window, ev: WindowEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void { useEffect(() => { window.addEventListener(type, listener, options); return () => window.removeEventListener(type, listener); diff --git a/test/shuffle.test.ts b/test/shuffle.test.ts index 52bd999..352c35b 100644 --- a/test/shuffle.test.ts +++ b/test/shuffle.test.ts @@ -2,7 +2,7 @@ import { expect, test } from 'vitest'; import { buildNameMap } from '../src/shuffle'; test('shuffle does not include matching pairs', () => { - const names = Array(10).fill(null).map((_, i) => "Test " + i); + const names = Array(10).fill(null).map((_, i) => `Test ${i}`); for (let i = 0; i < 50000; i++) { const shuffled = buildNameMap(names); for (const pair of shuffled) { diff --git a/vite.config.ts b/vite.config.ts index 8bc5e43..b587c9b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -31,7 +31,7 @@ export default defineConfig({ ], server: { hmr: { - clientPort: parseInt(process.env.CLIENT_PORT || '5173'), + clientPort: parseInt(process.env.CLIENT_PORT || '5173', 10), }, }, });