mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-01-14 15:54:13 +01:00
Change linter config to antfu config and lint code
This commit is contained in:
@@ -3,26 +3,27 @@ const socials = [
|
||||
{
|
||||
icon: 'i-ph-x-logo-duotone',
|
||||
label: 'Twitter',
|
||||
link: 'https://twitter.com/ArthurDanj'
|
||||
link: 'https://twitter.com/ArthurDanj',
|
||||
},
|
||||
{
|
||||
icon: 'i-ph-github-logo-duotone',
|
||||
label: 'GitHub',
|
||||
link: 'https://github.com/ArthurDanjou'
|
||||
link: 'https://github.com/ArthurDanjou',
|
||||
},
|
||||
{
|
||||
icon: 'i-ph-linkedin-logo-duotone',
|
||||
label: 'LinkedIn',
|
||||
link: 'https://www.linkedin.com/in/arthurdanjou/'
|
||||
}, {
|
||||
link: 'https://www.linkedin.com/in/arthurdanjou/',
|
||||
},
|
||||
{
|
||||
icon: 'i-ph-discord-logo-duotone',
|
||||
label: 'Discord',
|
||||
link: 'https://discordapp.com/users/179635349100691456'
|
||||
}
|
||||
link: 'https://discordapp.com/users/179635349100691456',
|
||||
},
|
||||
]
|
||||
|
||||
const { t } = useI18n({
|
||||
useScope: 'local'
|
||||
useScope: 'local',
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -63,7 +64,7 @@ const { t } = useI18n({
|
||||
<div class="mt-8 w-full flex justify-center text-xs">
|
||||
{{
|
||||
t('copyright', {
|
||||
date: new Date().getFullYear()
|
||||
date: new Date().getFullYear(),
|
||||
})
|
||||
}}
|
||||
</div>
|
||||
|
||||
@@ -10,52 +10,52 @@ const navs = [
|
||||
{
|
||||
label: {
|
||||
en: 'home',
|
||||
fr: 'accueil'
|
||||
fr: 'accueil',
|
||||
},
|
||||
to: '/',
|
||||
icon: 'i-ph-house-line-duotone',
|
||||
shortcut: {
|
||||
en: 'h',
|
||||
fr: 'a'
|
||||
}
|
||||
fr: 'a',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: {
|
||||
en: 'uses',
|
||||
fr: 'usages'
|
||||
fr: 'usages',
|
||||
},
|
||||
to: '/uses',
|
||||
icon: 'i-ph-backpack-duotone',
|
||||
shortcut: {
|
||||
en: 'u',
|
||||
fr: 'u'
|
||||
}
|
||||
fr: 'u',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: {
|
||||
en: 'writings',
|
||||
fr: 'écrits'
|
||||
fr: 'écrits',
|
||||
},
|
||||
to: '/writings',
|
||||
icon: 'i-ph-books-duotone',
|
||||
shortcut: {
|
||||
en: 'w',
|
||||
fr: 'e'
|
||||
}
|
||||
fr: 'e',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: {
|
||||
en: 'resume',
|
||||
fr: 'cv'
|
||||
fr: 'cv',
|
||||
},
|
||||
to: config.public.cloud.resume,
|
||||
target: '_blank',
|
||||
icon: 'i-ph-address-book-duotone',
|
||||
shortcut: {
|
||||
en: 'r',
|
||||
fr: 'c'
|
||||
}
|
||||
}
|
||||
fr: 'c',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
async function toggleTheme() {
|
||||
@@ -69,6 +69,9 @@ async function toggleTheme() {
|
||||
document.body.style.animation = ''
|
||||
}
|
||||
|
||||
const { locale, setLocale, locales, t } = useI18n()
|
||||
const currentLocale = computed(() => locales.value.filter(l => l.code === locale.value)[0])
|
||||
|
||||
async function changeLocale() {
|
||||
document.body.style.animation = 'switch-on .2s'
|
||||
await new Promise(resolve => setTimeout(resolve, 200))
|
||||
@@ -81,8 +84,6 @@ async function changeLocale() {
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
const { locale, setLocale, locales, t } = useI18n()
|
||||
const currentLocale = computed(() => locales.value.filter(l => l.code === locale.value)[0])
|
||||
defineShortcuts({
|
||||
h: () => router.push('/'),
|
||||
a: () => router.push('/'),
|
||||
@@ -93,7 +94,7 @@ defineShortcuts({
|
||||
c: () => window.open(config.public.cloud.resume, '_blank'),
|
||||
t: () => toggleTheme(),
|
||||
l: () => changeLocale(),
|
||||
backspace: () => router.back()
|
||||
backspace: () => router.back(),
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ const { locale, locales } = useI18n()
|
||||
const currentLocale = computed(() => locales.value.find(l => l.code === locale.value))
|
||||
|
||||
const getActivity = computed(() => {
|
||||
if (!codingActivity.value) return
|
||||
if (!codingActivity.value)
|
||||
return
|
||||
|
||||
const { name, details, state, timestamps } = codingActivity.value
|
||||
const isActive = name === 'Visual Studio Code'
|
||||
@@ -44,14 +45,14 @@ const getActivity = computed(() => {
|
||||
.trim(),
|
||||
formated: {
|
||||
date: formatDate(timestamps.start, 'DD MMM YYYY'),
|
||||
time: formatDate(timestamps.start, 'HH:mm:ss')
|
||||
}
|
||||
}
|
||||
time: formatDate(timestamps.start, 'HH:mm:ss'),
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
const { t } = useI18n({
|
||||
useScope: 'local'
|
||||
useScope: 'local',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
const { width } = useWindowSize()
|
||||
const { t } = useI18n({
|
||||
useScope: 'local',
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ClientOnly>
|
||||
<div
|
||||
@@ -13,13 +20,6 @@
|
||||
</ClientOnly>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const { width } = useWindowSize()
|
||||
const { t } = useI18n({
|
||||
useScope: 'local'
|
||||
})
|
||||
</script>
|
||||
|
||||
<i18n lang="json">
|
||||
{
|
||||
"en": {
|
||||
|
||||
@@ -4,15 +4,15 @@ import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
text: {
|
||||
type: [String, Number],
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
hover: {
|
||||
type: String,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
position: {
|
||||
type: String as PropType<'top' | 'right' | 'bottom' | 'left'>
|
||||
}
|
||||
type: String as PropType<'top' | 'right' | 'bottom' | 'left'>,
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@ import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
href: {
|
||||
type: String,
|
||||
default: ''
|
||||
default: '',
|
||||
},
|
||||
target: {
|
||||
type: String as PropType<'_blank' | '_parent' | '_self' | '_top' | (string & object) | null | undefined>,
|
||||
default: undefined,
|
||||
required: false
|
||||
}
|
||||
required: false,
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, useRuntimeConfig } from '#imports'
|
||||
|
||||
const props = defineProps<{ id?: string }>()
|
||||
|
||||
const { headings } = useRuntimeConfig().public.mdc
|
||||
const generate = computed(() => props.id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h2)))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h2
|
||||
:id="id"
|
||||
@@ -12,12 +21,3 @@
|
||||
<slot v-else />
|
||||
</h2>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, useRuntimeConfig } from '#imports'
|
||||
|
||||
const props = defineProps<{ id?: string }>()
|
||||
|
||||
const { headings } = useRuntimeConfig().public.mdc
|
||||
const generate = computed(() => props.id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h2)))
|
||||
</script>
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, useRuntimeConfig } from '#imports'
|
||||
|
||||
const props = defineProps<{ id?: string }>()
|
||||
|
||||
const { headings } = useRuntimeConfig().public.mdc
|
||||
const generate = computed(() => props.id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h2)))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h2
|
||||
:id="id"
|
||||
@@ -12,12 +21,3 @@
|
||||
<slot v-else />
|
||||
</h2>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, useRuntimeConfig } from '#imports'
|
||||
|
||||
const props = defineProps<{ id?: string }>()
|
||||
|
||||
const { headings } = useRuntimeConfig().public.mdc
|
||||
const generate = computed(() => props.id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h2)))
|
||||
</script>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
defineProps({
|
||||
icon: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
const { t } = useI18n({
|
||||
useScope: 'local',
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex items-center gap-2 mt-4">
|
||||
<div class="flex items-center">
|
||||
@@ -17,12 +23,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const { t } = useI18n({
|
||||
useScope: 'local'
|
||||
})
|
||||
</script>
|
||||
|
||||
<i18n lang="json">
|
||||
{
|
||||
"en": {
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { Stats } from '~~/types'
|
||||
|
||||
const { data: stats } = await useFetch<Stats>('/api/stats')
|
||||
const { t } = useI18n({
|
||||
useScope: 'local'
|
||||
useScope: 'local',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
defineProps({
|
||||
label: {
|
||||
type: String,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
href: {
|
||||
type: String,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
icon: {
|
||||
type: String
|
||||
type: String,
|
||||
},
|
||||
blanked: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
default: false,
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import type { UsesItem } from '#components'
|
||||
defineProps({
|
||||
item: {
|
||||
type: Object as PropType<typeof UsesItem>,
|
||||
required: true
|
||||
}
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
|
||||
const { locale } = useI18n()
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
<script lang="ts" setup>
|
||||
defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="space-y-8">
|
||||
<UDivider
|
||||
@@ -9,12 +18,3 @@
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user