From 4574a7dccd225db6921ae77628b1cefef6434f2d Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Sat, 20 Apr 2024 01:12:41 +0200 Subject: [PATCH] lint code Signed-off-by: Arthur DANJOU --- app.config.ts | 56 +-- app/router.options.ts | 78 +-- auth.d.ts | 16 +- components/Announcement.vue | 32 +- 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 | 22 +- components/header/Header.vue | 24 +- components/header/Logo.vue | 36 +- components/header/MobileNavBar.vue | 312 ++++++------ components/header/NavBar.vue | 312 ++++++------ 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 | 42 +- composables/useContent.ts | 46 +- drizzle.config.ts | 16 +- error.vue | 76 +-- eslint.config.js | 10 +- layouts/default.vue | 38 +- layouts/maintenance.vue | 30 +- middleware/maintenance.global.ts | 40 +- middleware/redirect.global.ts | 10 +- modules/drizzle-studio.ts | 30 +- nuxt.config.ts | 125 ++--- package.json | 7 +- 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 | 2 +- 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 | 46 +- store/color.ts | 42 +- store/talents.ts | 46 +- tailwind.config.ts | 22 +- types.ts | 278 +++++----- yarn.lock | 779 ++++++++++++++++------------- 69 files changed, 3110 insertions(+), 3013 deletions(-) diff --git a/app.config.ts b/app.config.ts index 47aa0be..1eb28fb 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 3d175c7..35153e0 100644 --- a/app/router.options.ts +++ b/app/router.options.ts @@ -1,49 +1,49 @@ -import type { RouterConfig } from '@nuxt/schema' +import type {RouterConfig} from '@nuxt/schema' -function findHashPosition(hash: any): { el: any, 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) +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) - 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 e7435ac..131b5ba 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 0aae754..966e9bf 100644 --- a/components/Announcement.vue +++ b/components/Announcement.vue @@ -3,20 +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` }