From 5ca0137c4e69cfe65b48538cc88f2cba4171b3d4 Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Sat, 20 Apr 2024 01:33:40 +0200 Subject: [PATCH] Lint code Signed-off-by: Arthur DANJOU --- app.config.ts | 56 +-- app/router.options.ts | 74 ++-- auth.d.ts | 16 +- components/Announcement.vue | 44 +-- components/Background.vue | 30 +- components/Footer.vue | 66 ++-- components/content/GridSection.vue | 44 +-- components/content/GridSlot.vue | 24 +- components/content/ProseA.vue | 34 +- components/content/ProseH2.vue | 20 +- components/header/Header.vue | 24 +- components/header/Logo.vue | 36 +- components/header/MobileNavBar.vue | 310 ++++++++--------- components/header/NavBar.vue | 310 ++++++++--------- components/header/ThemePicker.vue | 146 ++++---- components/main/MainActivity.vue | 170 ++++----- components/main/MainBanner.vue | 84 ++--- components/main/MainStats.vue | 148 ++++---- components/resume/DateTag.vue | 42 +-- components/resume/Education.vue | 40 +-- components/resume/Experience.vue | 96 ++--- components/resume/Skill.vue | 44 +-- composables/useContent.ts | 48 +-- drizzle.config.ts | 16 +- error.vue | 82 ++--- eslint.config.js | 6 +- layouts/default.vue | 36 +- layouts/maintenance.vue | 30 +- middleware/maintenance.global.ts | 40 +-- middleware/redirect.global.ts | 10 +- modules/drizzle-studio.ts | 30 +- nuxt.config.ts | 134 +++---- pages/about.vue | 194 +++++------ pages/bookmarks.vue | 316 ++++++++--------- pages/guestbook.vue | 366 +++++++++---------- pages/index.vue | 18 +- pages/maintenance.vue | 120 +++---- pages/talents.vue | 542 ++++++++++++++--------------- pages/uses.vue | 38 +- pages/work.vue | 112 +++--- pages/writing/[slug].vue | 270 +++++++------- pages/writing/index.vue | 112 +++--- plugins/vercel.ts | 4 +- server/api/activity.get.ts | 4 +- server/api/announcement.get.ts | 6 +- server/api/article.post.ts | 18 +- server/api/bookmarks.get.ts | 32 +- server/api/categories.get.ts | 4 +- server/api/like.put.ts | 12 +- server/api/maintenance.get.ts | 36 +- server/api/message.delete.ts | 12 +- server/api/message.post.ts | 44 +-- server/api/messages.get.ts | 2 +- server/api/stats.get.ts | 24 +- server/api/suggestion.post.ts | 46 +-- server/api/talents.get.ts | 32 +- server/api/view.put.ts | 14 +- server/database/schema.ts | 146 ++++---- server/routes/auth/github.get.ts | 34 +- server/routes/auth/google.get.ts | 28 +- server/utils/db.ts | 2 +- server/utils/discord.ts | 42 +-- store/bookmarks.ts | 44 +-- store/color.ts | 38 +- store/talents.ts | 44 +-- tailwind.config.ts | 18 +- types.ts | 278 +++++++-------- 67 files changed, 2671 insertions(+), 2671 deletions(-) diff --git a/app.config.ts b/app.config.ts index 1eb28fb..47aa0be 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,30 +1,30 @@ export default defineAppConfig({ - ui: { - icons: { - dynamic: true, - }, - gray: 'neutral', - primary: 'cyan', - notifications: { - position: 'bottom-0 right-0', - }, - container: { - base: 'mx-auto', - padding: 'px-4 sm:px-6 lg:px-8', - constrained: 'max-w-9xl', - }, - dropdown: { - container: 'z-50', - background: 'bg-white dark:bg-zinc-900/90', - item: { - base: 'duration-300 group flex items-center gap-2 w-full', - }, - }, - button: { - base: 'duration-300 focus:outline-none focus-visible:outline-0 disabled:cursor-not-allowed disabled:opacity-75', - }, - popover: { - container: 'z-50', - }, - }, + ui: { + icons: { + dynamic: true, + }, + gray: 'neutral', + primary: 'cyan', + notifications: { + position: 'bottom-0 right-0', + }, + container: { + base: 'mx-auto', + padding: 'px-4 sm:px-6 lg:px-8', + constrained: 'max-w-9xl', + }, + dropdown: { + container: 'z-50', + background: 'bg-white dark:bg-zinc-900/90', + item: { + base: 'duration-300 group flex items-center gap-2 w-full', + }, + }, + button: { + base: 'duration-300 focus:outline-none focus-visible:outline-0 disabled:cursor-not-allowed disabled:opacity-75', + }, + popover: { + container: 'z-50', + }, + }, }) diff --git a/app/router.options.ts b/app/router.options.ts index 35153e0..3b634f7 100644 --- a/app/router.options.ts +++ b/app/router.options.ts @@ -1,49 +1,49 @@ import type {RouterConfig} from '@nuxt/schema' function findHashPosition(hash: string): { el: string, behavior: ScrollBehavior, top: number } | undefined { - const el = document.querySelector(hash) - // vue-router does not incorporate scroll-margin-top on its own. - if (el) { - const top = Number.parseFloat(getComputedStyle(el).scrollMarginTop) + const el = document.querySelector(hash) + // vue-router does not incorporate scroll-margin-top on its own. + if (el) { + const top = Number.parseFloat(getComputedStyle(el).scrollMarginTop) - return { - el: hash, - behavior: 'smooth', - top, - } - } + return { + el: hash, + behavior: 'smooth', + top, + } + } } // https://router.vuejs.org/api/#routeroptions export default { - scrollBehavior(to, from, savedPosition) { - const nuxtApp = useNuxtApp() + scrollBehavior(to, from, savedPosition) { + const nuxtApp = useNuxtApp() - // If history back - if (savedPosition) { - // Handle Suspense resolution - return new Promise((resolve) => { - nuxtApp.hooks.hookOnce('page:finish', () => { - setTimeout(() => resolve(savedPosition), 50) - }) - }) - } + // If history back + if (savedPosition) { + // Handle Suspense resolution + return new Promise((resolve) => { + nuxtApp.hooks.hookOnce('page:finish', () => { + setTimeout(() => resolve(savedPosition), 50) + }) + }) + } - // Scroll to heading on click - if (to.hash) { - return new Promise((resolve) => { - if (to.path === from.path) { - setTimeout(() => resolve(findHashPosition(to.hash)), 50) - } - else { - nuxtApp.hooks.hookOnce('page:finish', () => { - setTimeout(() => resolve(findHashPosition(to.hash)), 50) - }) - } - }) - } + // Scroll to heading on click + if (to.hash) { + return new Promise((resolve) => { + if (to.path === from.path) { + setTimeout(() => resolve(findHashPosition(to.hash)), 50) + } + else { + nuxtApp.hooks.hookOnce('page:finish', () => { + setTimeout(() => resolve(findHashPosition(to.hash)), 50) + }) + } + }) + } - // Scroll to top of window - return { top: 0 } - }, + // Scroll to top of window + return { top: 0 } + }, } diff --git a/auth.d.ts b/auth.d.ts index 131b5ba..e7435ac 100644 --- a/auth.d.ts +++ b/auth.d.ts @@ -1,10 +1,10 @@ declare module '#auth-utils' { - interface UserSession { - user: { - email: string - username: string - picture: string - admin: boolean - } - } + interface UserSession { + user: { + email: string + username: string + picture: string + admin: boolean + } + } } diff --git a/components/Announcement.vue b/components/Announcement.vue index 966e9bf..c9eb08e 100644 --- a/components/Announcement.vue +++ b/components/Announcement.vue @@ -3,32 +3,32 @@ const { data: announce } = await useFetch('/api/announcement') const appConfig = useAppConfig() function getColor() { - return `bg-${appConfig.ui.primary}-500` + return `bg-${appConfig.ui.primary}-500` }