Skip to content

Commit cf32f67

Browse files
committed
Migrate to eslint 9
1 parent ae152b4 commit cf32f67

26 files changed

+1570
-2898
lines changed

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 16 deletions
This file was deleted.
File renamed without changes.

components/Header.vue renamed to components/AppHeader.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import type {NavItem} from '@nuxt/content/dist/runtime/types'
3-
import {NuxtImg} from "#components";
2+
import type {NavItem} from '@nuxt/content'
3+
import {NuxtImg} from '#components'
44
55
const navigation = inject<Ref<NavItem[]>>('navigation', ref([]))
66

components/ContactForm.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const submitJsonApiKey = config.public.submitJsonApiKey
2424
const sj = new SubmitJSON({ apiKey: submitJsonApiKey, endpoint: '3blcoDHQS' })
2525
const toast = useToast()
2626
async function onSubmit (event: FormSubmitEvent<Schema>) {
27-
let toastMessage = ''
2827
try {
2928
await sj.submit(event.data)
3029
toast.add({
@@ -34,7 +33,7 @@ async function onSubmit (event: FormSubmitEvent<Schema>) {
3433
})
3534
await navigateTo({ path: '/' })
3635
}
37-
catch (error) {
36+
catch {
3837
toast.add({
3938
title: 'Oops',
4039
description: 'Sorry, your message was not successfully sent, try again or contact me by message on LinkedIn/BueSky/Mastodon.',

components/Placeholder.vue renamed to components/ImagePlaceholder.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<template>
22
<div class="bg-gray-900/5 dark:bg-white/5 ring-1 ring-inset ring-gray-900/10 dark:ring-white/10 rounded-xl lg:-m-4 p-4">
33
<div class="aspect-w-16 aspect-h-9 rounded-lg relative overflow-hidden border border-dashed border-gray-900/10 dark:border-white/10">
4-
<svg class="absolute inset-0 h-full w-full stroke-gray-900/10 dark:stroke-white/10" fill="none">
4+
<svg
5+
class="absolute inset-0 h-full w-full stroke-gray-900/10 dark:stroke-white/10"
6+
fill="none"
7+
>
58
<defs>
69
<pattern
710
id="pattern-5c1e4f0e-62d5-498b-8ff0-cf77bb448c8e"
@@ -14,7 +17,12 @@
1417
<path d="M-3 13 15-5M-5 5l18-18M-1 21 17 3" />
1518
</pattern>
1619
</defs>
17-
<rect stroke="none" fill="url(#pattern-5c1e4f0e-62d5-498b-8ff0-cf77bb448c8e)" width="100%" height="100%" />
20+
<rect
21+
stroke="none"
22+
fill="url(#pattern-5c1e4f0e-62d5-498b-8ff0-cf77bb448c8e)"
23+
width="100%"
24+
height="100%"
25+
/>
1826
</svg>
1927
</div>
2028
</div>

components/Tags.vue renamed to components/PostsTags.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ defineProps<{ tags: string[] }>()
77
<template>
88
<UDivider type="dashed" label="Tags"/>
99
<div class="flex flex-wrap w-full items-center gap-3 mt-5">
10-
<UBadge v-for="(tag, index) in tags"
10+
<UBadge
11+
v-for="(tag, index) in tags"
1112
:key="index"
1213
:ui="{base: 'text-center justify-center'}">
1314
<NuxtLink :to="`/tags/${getTagSlug(tag)}`">{{tag}}</NuxtLink>

components/content/Tweet.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ const loaded = ref(false)
2828
const tweetNotFound = ref(false)
2929
3030
async function create(retries = 10) {
31-
// @ts-expect-error global
31+
// @ts-expect-error global external script injected
3232
if (!window.twttr?.widgets?.createTweet) {
3333
if (retries <= 0)
3434
return console.error('Failed to load Twitter widget after 10 retries.')
3535
setTimeout(() => create(retries - 1), 1000)
3636
return
3737
}
38-
// @ts-expect-error global
38+
// @ts-expect-error global external script injected
3939
const element = await window.twttr.widgets.createTweet(
4040
props.id.toString(),
4141
tweet.value,

error.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import type { NuxtError } from '#app'
3-
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
3+
import type { ParsedContent } from '@nuxt/content/'
44
55
useSeoMeta({
66
title: 'Page not found',

eslint.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// @ts-check
2+
import withNuxt from './.nuxt/eslint.config.mjs'
3+
export default withNuxt({
4+
rules: {
5+
'@typescript-eslint/no-explicit-any': 'off'
6+
}
7+
})

layouts/default.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
2+
import type { ParsedContent } from '@nuxt/content/'
33
44
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation(), { default: () => [] })
55
const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', { default: () => [], server: false })
@@ -9,13 +9,13 @@ provide('navigation', navigation)
99

1010
<template>
1111
<div>
12-
<Header />
12+
<AppHeader />
1313

1414
<UMain>
1515
<slot />
1616
</UMain>
1717

18-
<Footer />
18+
<AppFooter />
1919

2020
<ClientOnly>
2121
<LazyUContentSearch :files="files" :navigation="navigation" />

nuxt.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export default defineNuxtConfig({
1414
'nuxt-og-image',
1515
"@stefanobartoletti/nuxt-social-share",
1616
"@nuxtjs/seo",
17-
"@nuxtjs/mdc"
17+
"@nuxtjs/mdc",
18+
'@nuxt/eslint'
1819
],
1920
content: {
2021
highlight: {
@@ -72,4 +73,4 @@ export default defineNuxtConfig({
7273
}
7374
},
7475
compatibilityDate: '2024-09-05'
75-
})
76+
})

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"preview": "nuxt preview",
1010
"postinstall": "nuxt prepare",
1111
"lint": "eslint .",
12+
"lint:fix": "eslint . --fix",
1213
"typecheck": "nuxt typecheck"
1314
},
1415
"dependencies": {
@@ -32,13 +33,14 @@
3233
"zod": "^3.23.8"
3334
},
3435
"devDependencies": {
35-
"@iconify-json/vscode-icons": "^1.2.2",
36-
"@nuxt/eslint-config": "^0.6.0",
36+
"@nuxt/eslint": "^0.7.2",
3737
"@nuxthq/studio": "^2.2.1",
3838
"@nuxtjs/seo": "2.0.2",
3939
"@stefanobartoletti/nuxt-social-share": "^1.2.0",
40-
"eslint": "^8.57.1",
40+
"eslint": "^9.15.0",
4141
"nuxt": "^3.14.1592",
42+
"typescript": "^5.7.2",
4243
"vue-tsc": "^2.1.10"
43-
}
44+
},
45+
"packageManager": "pnpm@9.12.0"
4446
}

pages/about.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ useSeoMeta({
2828
<img
2929
src="/images/bordeaux_1.jpg"
3030
class="w-full rounded-md shadow-xl ring-1 ring-gray-300 dark:ring-gray-700"
31-
alt="Picture of Place de la Bourse (Bordeaux) at night."/>
31+
alt="Picture of Place de la Bourse (Bordeaux) at night.">
3232
</UPageHero>
3333
<UPage>
3434
<UPageBody prose>

pages/goodies/[slug].vue

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script setup lang="ts">
22
import { withoutTrailingSlash, joinURL } from 'ufo'
33
import type { BlogPost } from '~/types'
4-
import Giscus from '@giscus/vue'
54
65
const route = useRoute()
76
@@ -35,16 +34,10 @@ if (post.value.image?.src) {
3534
twitterImage: joinURL(site.url, post.value.image.src)
3635
})
3736
} else {
38-
defineOgImage({
39-
component: 'Saas',
40-
title,
41-
description,
42-
headline: 'Blog'
43-
})
37+
defineOgImageComponent('Saas', {
38+
headline: 'Blog'})
4439
}
4540
46-
const colorMode = useColorMode()
47-
const theme = computed(() => colorMode.value == "dark" ? "" : "light")
4841
</script>
4942

5043
<template>

pages/goodies/index.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const activeArticle = useState()
2424
<UPageHeader :title="title" :description="description"/>
2525
<UPageBody>
2626
<UBlogList>
27-
<UBlogPost @click="activeArticle = index"
28-
v-for="(article, index) in articles"
27+
<UBlogPost
28+
v-for="(article, index) in articles"
2929
:key="index"
3030
:to="article._path"
3131
:title="article.title"
@@ -35,8 +35,8 @@ const activeArticle = useState()
3535
class="col-span-full"
3636
:class="activeArticle === index && 'active'"
3737
:ui="{ title: 'text-3xl', description: 'text-xl'}"
38-
>
39-
</UBlogPost>
38+
@click="activeArticle = index"
39+
/>
4040
</UBlogList>
4141
</UPageBody>
4242
</UContainer>

pages/index.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ useSeoMeta({
1717

1818
<template>
1919
<div v-if="page">
20-
<ULandingHero :title="page.hero.title" :description="page.hero.description" :links="page.hero.links"
20+
<ULandingHero
21+
:title="page.hero.title" :description="page.hero.description" :links="page.hero.links"
2122
:ui="{description: 'text-primary dark:text-primary'}">
2223
<template #headline>
2324
<UAvatar
@@ -30,10 +31,12 @@ useSeoMeta({
3031
</template>
3132
</ULandingHero>
3233

33-
<ULandingSection :title="page.roles.title" :description="page.roles.description"
34+
<ULandingSection
35+
:title="page.roles.title" :description="page.roles.description"
3436
:ui="{description: 'text-primary dark:text-primary'}">
3537
<UPageGrid>
36-
<ULandingCard v-for="(item, index) in page.roles.items" :key="index" v-bind="item"
38+
<ULandingCard
39+
v-for="(item, index) in page.roles.items" :key="index" v-bind="item"
3740
:ui="{ icon: { base: 'text-primary dark:text-primary' } }"/>
3841
</UPageGrid>
3942
</ULandingSection>

pages/posts/[slug].vue

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { withoutTrailingSlash, joinURL } from 'ufo'
33
import type { BlogPost } from '~/types'
44
import Giscus from '@giscus/vue'
55
import {NuxtImg} from "#components";
6+
import PostsTags from "~/components/PostsTags.vue";
67
78
const route = useRoute()
89
@@ -44,10 +45,7 @@ if (post.value.image?.src) {
4445
twitterImage: joinURL(site.url, post.value.image.src)
4546
})
4647
} else {
47-
defineOgImage({
48-
component: 'Saas',
49-
title,
50-
description,
48+
defineOgImageComponent('Saas', {
5149
headline: 'Blog'
5250
})
5351
}
@@ -87,7 +85,7 @@ const theme = computed(() => colorMode.value == "dark" ? "" : "light")
8785
<ContentRenderer v-if="post && post.body" :value="post" class="prose prose-primary dark:prose-invert max-w-none" />
8886

8987
<div class="block sm:hidden">
90-
<Tags :tags="post.tags"></Tags>
88+
<PostsTags :tags="post.tags"/>
9189
<SocialsShare/>
9290
</div>
9391

@@ -100,7 +98,7 @@ const theme = computed(() => colorMode.value == "dark" ? "" : "light")
10098
<template #right>
10199
<UContentToc v-if="post.body && post.body.toc" :links="post.body.toc.links" :ui="{ wrapper: ''}"/>
102100
<div class="hidden sm:block">
103-
<Tags :tags="post.tags"></Tags>
101+
<PostsTags :tags="post.tags"/>
104102
<SocialsShare/>
105103
</div>
106104
</template>
@@ -117,8 +115,7 @@ const theme = computed(() => colorMode.value == "dark" ? "" : "light")
117115
input-position="top"
118116
:theme="theme"
119117
loading="lazy"
120-
crossorigin="anonymous">
121-
</Giscus>
118+
crossorigin="anonymous"/>
122119
</UContainer>
123120
</template>
124121

pages/posts/index.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ useSeoMeta({
1818
ogDescription: page.value.description
1919
})
2020
21-
defineOgImage({
22-
component: 'Saas',
23-
title: page.value.title,
24-
description: page.value.description
25-
})
21+
defineOgImageComponent('Saas')
2622
const activePost = useState()
2723
</script>
2824

@@ -34,8 +30,8 @@ const activePost = useState()
3430

3531
<UPageBody>
3632
<UBlogList>
37-
<UBlogPost @click="activePost = index"
38-
v-for="(post, index) in posts"
33+
<UBlogPost
34+
v-for="(post, index) in posts"
3935
:key="index"
4036
:to="post._path"
4137
:title="post.title"
@@ -49,6 +45,7 @@ const activePost = useState()
4945
:ui="{
5046
description: 'line-clamp-2'
5147
}"
48+
@click="activePost = index"
5249
>
5350
<!-- <template #date>
5451
<time :datetime="post.date" class="ext-sm text-gray-500 dark:text-gray-400 font-medium pointer-events-none">

pages/tags/[tag].vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ useSeoMeta({
4646
:ui="{
4747
description: 'line-clamp-2'
4848
}"
49-
>
50-
</UBlogPost>
49+
/>
5150
</UBlogList>
5251
</UPageBody>
5352
</UContainer>

pages/tags/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const tagOccurences = computed(() => {
1919
return acc;
2020
}, new Map<string, number>()) ?? new Map<string, number>()
2121
return [...occurences.entries()]
22-
.sort(([tagA, occurenceA], [tagB, occurenceB]) => occurenceB - occurenceA)
22+
.sort(([_tagA, occurenceA], [_tagB, occurenceB]) => occurenceB - occurenceA)
2323
});
2424
2525
const title = 'Tags'
@@ -40,7 +40,7 @@ useSeoMeta({
4040
<UPageHeader :title="title" :description="description"/>
4141
<UPageBody>
4242
<div class="flex flex-wrap place-content-evenly gap-5 mt-4">
43-
<UChip size="2xl" v-for="[tag, occurence] in tagOccurences" :key="tag" :text="occurence">
43+
<UChip v-for="[tag, occurence] in tagOccurences" :key="tag" size="2xl" :text="occurence">
4444
<UButton color="white" :to="getTagRoute(tag)">{{tag}}</UButton>
4545
</UChip>
4646
</div>

plugins/posthog.client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineNuxtPlugin } from '#app'
22
import posthog from 'posthog-js'
3-
export default defineNuxtPlugin(nuxtApp => {
3+
export default defineNuxtPlugin(_nuxtApp => {
44
const runtimeConfig = useRuntimeConfig();
55
const posthogPublicKey = runtimeConfig.public.posthogPublicKey
66
const posthogHost = runtimeConfig.public.posthogHost

0 commit comments

Comments
 (0)