Change linter config to antfu config and lint code

This commit is contained in:
2024-07-24 02:01:30 +02:00
parent 45293e4982
commit 2331b01a8d
53 changed files with 1999 additions and 1556 deletions

View File

@@ -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>

View File

@@ -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": {

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -2,8 +2,8 @@
defineProps({
icon: {
type: String,
required: true
}
required: true,
},
})
</script>

View File

@@ -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": {

View File

@@ -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>