From 16956d12f4e25e1f85bcc96803e0d361dd8dabd9 Mon Sep 17 00:00:00 2001 From: Pascal Syma Date: Wed, 20 Aug 2025 23:40:00 +0200 Subject: [PATCH] Add eslint --- .dockerignore | 3 +- .github/workflows/docker.yml | 2 + app/components/ClickableImage.vue | 3 +- app/components/QuestTags.vue | 2 +- app/components/TeamAddModal.vue | 8 +- app/components/TeamJoinModal.vue | 8 +- app/components/admin/Team.vue | 6 +- app/components/showcase/NumberCard.vue | 2 +- app/composables/useI18nKey.ts | 2 +- app/composables/useValidation.ts | 11 +- .../hunt/[huntSlug]/[questSlug]/admin.vue | 80 ++-- .../hunt/[huntSlug]/[questSlug]/index.vue | 352 ++++++++--------- app/pages/hunt/[huntSlug]/admin.vue | 293 +++++++------- app/pages/hunt/[huntSlug]/diashow.vue | 4 +- app/pages/hunt/[huntSlug]/index.vue | 358 +++++++++--------- app/pages/hunt/[huntSlug]/pictures.vue | 4 +- app/pages/hunt/[huntSlug]/showcase.vue | 21 +- app/pages/hunt/[huntSlug]/teams.vue | 28 +- app/pages/index.vue | 208 +++++----- app/pages/login.vue | 148 ++++---- app/pages/profile.vue | 4 +- app/pages/register.vue | 196 +++++----- app/plugins/matomo.client.ts | 4 +- bun.lock | 356 ++++++++++++++--- eslint.config.mjs | 6 + nuxt.config.ts | 5 +- package.json | 4 + server/api/auth/login.post.ts | 2 +- server/api/auth/profile.post.ts | 3 +- server/api/auth/register.post.ts | 2 +- shared/auth.d.ts | 2 +- 31 files changed, 1214 insertions(+), 913 deletions(-) create mode 100644 eslint.config.mjs diff --git a/.dockerignore b/.dockerignore index f0031ac..b4b9c7a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -9,4 +9,5 @@ .prettierrc.json docker-compose.* Dockerfile -*.md \ No newline at end of file +*.md +eslint.config.mjs \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7468245..5c7ba8a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,6 +17,8 @@ jobs: run: bun install --include=dev - name: Check formatting run: bun run check + - name: ESLint + run: bun run lint - name: Run tests run: bun run test deploy: diff --git a/app/components/ClickableImage.vue b/app/components/ClickableImage.vue index f42288f..8a4f82b 100644 --- a/app/components/ClickableImage.vue +++ b/app/components/ClickableImage.vue @@ -6,6 +6,7 @@ const props = withDefaults( class?: string; }>(), { + title: '', class: 'h-32' } ); @@ -18,7 +19,7 @@ const isOpen = ref(false); :src="src" class="cursor-pointer" :class="props.class" - :title="title || ''" + :title="title" fit="cover" lazy @click.prevent="isOpen = true" diff --git a/app/components/QuestTags.vue b/app/components/QuestTags.vue index 5a2cbbd..10b1c6e 100644 --- a/app/components/QuestTags.vue +++ b/app/components/QuestTags.vue @@ -1,7 +1,7 @@ diff --git a/app/pages/hunt/[huntSlug]/[questSlug]/index.vue b/app/pages/hunt/[huntSlug]/[questSlug]/index.vue index 535b6b9..cf27f05 100644 --- a/app/pages/hunt/[huntSlug]/[questSlug]/index.vue +++ b/app/pages/hunt/[huntSlug]/[questSlug]/index.vue @@ -105,187 +105,189 @@ const createImageURL = (file: File) => URL.createObjectURL(file); diff --git a/app/pages/hunt/[huntSlug]/admin.vue b/app/pages/hunt/[huntSlug]/admin.vue index 81f406b..e80f9e1 100644 --- a/app/pages/hunt/[huntSlug]/admin.vue +++ b/app/pages/hunt/[huntSlug]/admin.vue @@ -21,16 +21,13 @@ const { init } = useToast(); const { name, id } = app.$slugData.huntSlug!; const titleStore = useTitleStore(); -const { data, pending, refresh, error } = await useFetch( - `/api/admin/hunt/${id}`, - { - transform: (value) => { - return superjson.deserialize( - value as unknown as SuperJSONResult - ) as unknown as typeof value; - } +const { data, pending, refresh } = await useFetch(`/api/admin/hunt/${id}`, { + transform: (value) => { + return superjson.deserialize( + value as unknown as SuperJSONResult + ) as unknown as typeof value; } -); +}); const formData = useCloned(data, { clone: (source) => superjson.deserialize(superjson.serialize(source)) @@ -158,148 +155,156 @@ async function addUser() { diff --git a/app/pages/hunt/[huntSlug]/diashow.vue b/app/pages/hunt/[huntSlug]/diashow.vue index 8200dd3..068ff0f 100644 --- a/app/pages/hunt/[huntSlug]/diashow.vue +++ b/app/pages/hunt/[huntSlug]/diashow.vue @@ -71,7 +71,7 @@ titleStore.title = data.value?.name; height="100dvh" autoscroll :indicators="false" - fallbackIcon="broken_image" + fallback-icon="broken_image" infinite color="secondary" :items="data.pictures" @@ -95,7 +95,7 @@ titleStore.title = data.value?.name; Answers are not revealed yet, please wait until the end! - {{ + {{ error }} diff --git a/app/pages/hunt/[huntSlug]/pictures.vue b/app/pages/hunt/[huntSlug]/pictures.vue index ea80f91..61b9bce 100644 --- a/app/pages/hunt/[huntSlug]/pictures.vue +++ b/app/pages/hunt/[huntSlug]/pictures.vue @@ -86,8 +86,8 @@ titleStore.title = data.value ? tKey(data.value, 'name').value : undefined; /> No pictures has been submitted yet :( @@ -99,7 +99,7 @@ titleStore.title = data.value ? tKey(data.value, 'name').value : undefined; Answers are not revealed yet, please wait until the end! - {{ + {{ error }} @click="toggle" /> +

{{ tKey(quest, 'title') }}

-

+

{{ tKey(quest, 'question') }}

@@ -137,7 +138,7 @@ const columns = leaderboardColumns.map((c) => >

-
+

{{ t('page.showcase.leaderboard') }} @@ -150,7 +151,7 @@ const columns = leaderboardColumns.map((c) => :items="data.leaderboard.slice(3)" :columns="leaderboardColumns" > -