chore: fix eslint warnings
This commit is contained in:
parent
1543f0ac79
commit
3e4434c0bc
5 changed files with 7 additions and 10 deletions
|
@ -29,12 +29,9 @@ const DrawName: FunctionComponent<Props> = ({ names }) => {
|
|||
}
|
||||
return <>
|
||||
<div class="button-group">
|
||||
{names.map(([name, _], i) => {
|
||||
if (completed.includes(i)) {
|
||||
return null;
|
||||
} else {
|
||||
return <button key={i + "-" + name} class="primary" onClick={() => setCurrentPerson(i)}>{name}</button>;
|
||||
}
|
||||
{names.map(([name], i) => {
|
||||
if (completed.includes(i)) return null;
|
||||
return <button key={`${i}-${name}`} class="primary" onClick={() => setCurrentPerson(i)}>{name}</button>;
|
||||
})}
|
||||
</div>
|
||||
</>
|
||||
|
|
|
@ -22,7 +22,7 @@ const EnterNames: FunctionComponent<Props> = ({ names, start }) => {
|
|||
|
||||
return <>
|
||||
<ul>
|
||||
{names.value.map((name, i) => <li key={i + "-" + name}>
|
||||
{names.value.map((name, i) => <li key={`${i}-${name}`}>
|
||||
{name}
|
||||
</li>)}
|
||||
</ul>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { useEffect } from "preact/hooks";
|
||||
|
||||
export function useWindowEvent<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void {
|
||||
export function useWindowEvent<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void {
|
||||
useEffect(() => {
|
||||
window.addEventListener(type, listener, options);
|
||||
return () => window.removeEventListener(type, listener);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -31,7 +31,7 @@ export default defineConfig({
|
|||
],
|
||||
server: {
|
||||
hmr: {
|
||||
clientPort: parseInt(process.env.CLIENT_PORT || '5173'),
|
||||
clientPort: parseInt(process.env.CLIENT_PORT || '5173', 10),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue