🚨 Made eslint happy

This commit is contained in:
Mawoka
2022-04-10 13:24:05 +02:00
parent 04b6f76e52
commit c9fc4ce67f
4 changed files with 9 additions and 8 deletions
+1
View File
@@ -30,6 +30,7 @@ export async function getSession(event) {
}); });
if (res.ok) { if (res.ok) {
const json = await res.json(); const json = await res.json();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore // skipcq: JS-0295 //@ts-ignore // skipcq: JS-0295
user_email = json.email; user_email = json.email;
} else { } else {
+6 -7
View File
@@ -10,10 +10,11 @@
let hcaptchaSitekey = import.meta.env.VITE_HCAPTCHA; let hcaptchaSitekey = import.meta.env.VITE_HCAPTCHA;
let hcaptcha = { let hcaptcha = {
execute: async (_a, _b) => ({ response: '' }), execute: async (_a, _b) => ({ response: '' }), // eslint-disable-line @typescript-eslint/no-unused-vars
render: (_a, _b) => {} // eslint-disable-next-line @typescript-eslint/no-empty-function
render: (_a, _b) => {} // eslint-disable-line @typescript-eslint/no-unused-vars
}; };
let hcaptchaWidgetID: any; let hcaptchaWidgetID;
onMount(() => { onMount(() => {
if (browser) { if (browser) {
@@ -32,6 +33,7 @@
if (browser) { if (browser) {
hcaptcha = { hcaptcha = {
execute: async () => ({ response: '' }), execute: async () => ({ response: '' }),
// eslint-disable-next-line @typescript-eslint/no-empty-function
render: () => {} render: () => {}
}; };
} }
@@ -73,10 +75,7 @@
{#if game_pin === '' || game_pin.length <= 7} {#if game_pin === '' || game_pin.length <= 7}
<div class="flex flex-col justify-center align-center w-screen h-screen"> <div class="flex flex-col justify-center align-center w-screen h-screen">
<form <form on:submit|preventDefault class="flex-col flex justify-center align-center mx-auto">
on:submit|preventDefault={() => {}}
class="flex-col flex justify-center align-center mx-auto"
>
<h1 class="text-lg text-center">Game Pin</h1> <h1 class="text-lg text-center">Game Pin</h1>
<input <input
class="border border-amber-800 self-center text-center text-black" class="border border-amber-800 self-center text-center text-black"
+1
View File
@@ -58,6 +58,7 @@
throw new Error('Failed to start game'); throw new Error('Failed to start game');
} }
const data = await res.json(); const data = await res.json();
// eslint-disable-next-line no-undef
plausible('Started Game', { props: { quiz_id: id } }); plausible('Started Game', { props: { quiz_id: id } });
window.location.replace(`/admin?token=${data.game_id}&pin=${data.game_pin}&connect=1`); window.location.replace(`/admin?token=${data.game_id}&pin=${data.game_pin}&connect=1`);
}; };
+1 -1
View File
@@ -60,6 +60,7 @@
socket.on('joined_game', (data) => { socket.on('joined_game', (data) => {
console.log('joined_game', data); console.log('joined_game', data);
gameData = JSON.parse(data); gameData = JSON.parse(data);
// eslint-disable-next-line no-undef
plausible('Joined Game', { props: { quiz_id: gameData.quiz_id } }); plausible('Joined Game', { props: { quiz_id: gameData.quiz_id } });
}); });
@@ -86,7 +87,6 @@
final_results = data; final_results = data;
}); });
// The rest // The rest
console.log(final_results, JSON.stringify(final_results) !== JSON.stringify([null]));
</script> </script>
<svelte:head> <svelte:head>