Skip to content

Commit 4014d64

Browse files
committed
chore: migrate to eslint v9
1 parent f903ace commit 4014d64

16 files changed

+7607
-5882
lines changed

.eslintignore

-4
This file was deleted.

.eslintrc.cjs

-16
This file was deleted.

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"eslint.experimental.useFlatConfig": true
3+
}

app.config.ts

+19-19
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default defineAppConfig({
1010
}
1111
},
1212
seo: {
13-
siteName: 'Nuxt UI Pro - Docs template',
13+
siteName: 'Nuxt UI Pro - Docs template'
1414
},
1515
header: {
1616
logo: {
@@ -21,34 +21,34 @@ export default defineAppConfig({
2121
search: true,
2222
colorMode: true,
2323
links: [{
24-
icon: 'i-simple-icons-github',
25-
to: 'https://github.com/nuxt-ui-pro/docs',
26-
target: '_blank',
24+
'icon': 'i-simple-icons-github',
25+
'to': 'https://github.com/nuxt-ui-pro/docs',
26+
'target': '_blank',
2727
'aria-label': 'Docs template on GitHub'
2828
}]
2929
},
3030
footer: {
3131
credits: 'Copyright © 2023',
3232
colorMode: false,
3333
links: [{
34-
icon: 'i-simple-icons-nuxtdotjs',
35-
to: 'https://nuxt.com',
36-
target: '_blank',
34+
'icon': 'i-simple-icons-nuxtdotjs',
35+
'to': 'https://nuxt.com',
36+
'target': '_blank',
3737
'aria-label': 'Nuxt Website'
3838
}, {
39-
icon: 'i-simple-icons-discord',
40-
to: 'https://discord.com/invite/ps2h6QT',
41-
target: '_blank',
39+
'icon': 'i-simple-icons-discord',
40+
'to': 'https://discord.com/invite/ps2h6QT',
41+
'target': '_blank',
4242
'aria-label': 'Nuxt UI on Discord'
4343
}, {
44-
icon: 'i-simple-icons-x',
45-
to: 'https://x.com/nuxt_js',
46-
target: '_blank',
44+
'icon': 'i-simple-icons-x',
45+
'to': 'https://x.com/nuxt_js',
46+
'target': '_blank',
4747
'aria-label': 'Nuxt on X'
4848
}, {
49-
icon: 'i-simple-icons-github',
50-
to: 'https://github.com/nuxt/ui',
51-
target: '_blank',
49+
'icon': 'i-simple-icons-github',
50+
'to': 'https://github.com/nuxt/ui',
51+
'target': '_blank',
5252
'aria-label': 'Nuxt UI on GitHub'
5353
}]
5454
},
@@ -61,17 +61,17 @@ export default defineAppConfig({
6161
icon: 'i-heroicons-star',
6262
label: 'Star on GitHub',
6363
to: 'https://github.com/nuxt/ui',
64-
target: '_blank',
64+
target: '_blank'
6565
}, {
6666
icon: 'i-heroicons-book-open',
6767
label: 'Nuxt UI Pro docs',
6868
to: 'https://ui.nuxt.com/pro/guide',
69-
target: '_blank',
69+
target: '_blank'
7070
}, {
7171
icon: 'i-simple-icons-nuxtdotjs',
7272
label: 'Purchase a license',
7373
to: 'https://ui.nuxt.com/pro/purchase',
74-
target: '_blank',
74+
target: '_blank'
7575
}]
7676
}
7777
}

app.vue

+6-3
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,21 @@ provide('navigation', navigation)
3636
<div>
3737
<NuxtLoadingIndicator />
3838

39-
<Header />
39+
<AppHeader />
4040

4141
<UMain>
4242
<NuxtLayout>
4343
<NuxtPage />
4444
</NuxtLayout>
4545
</UMain>
4646

47-
<Footer />
47+
<AppFooter />
4848

4949
<ClientOnly>
50-
<LazyUContentSearch :files="files" :navigation="navigation" />
50+
<LazyUContentSearch
51+
:files="files"
52+
:navigation="navigation"
53+
/>
5154
</ClientOnly>
5255

5356
<UNotifications />
File renamed without changes.

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

+14-3
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,27 @@ const { header } = useAppConfig()
1313
<UColorModeImage v-bind="{ class: 'h-6 w-auto', ...header?.logo }" />
1414
</template>
1515
<template v-else>
16-
Nuxt UI Pro <UBadge label="Docs" variant="subtle" class="mb-0.5" />
16+
Nuxt UI Pro <UBadge
17+
label="Docs"
18+
variant="subtle"
19+
class="mb-0.5"
20+
/>
1721
</template>
1822
</template>
1923

20-
<template v-if="header?.search" #center>
24+
<template
25+
v-if="header?.search"
26+
#center
27+
>
2128
<UContentSearchButton class="hidden lg:flex" />
2229
</template>
2330

2431
<template #right>
25-
<UContentSearchButton v-if="header?.search" :label="null" class="lg:hidden" />
32+
<UContentSearchButton
33+
v-if="header?.search"
34+
:label="null"
35+
class="lg:hidden"
36+
/>
2637

2738
<UColorModeButton v-if="header?.colorMode" />
2839

error.vue

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import type { NuxtError } from '#app'
32
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
3+
import type { NuxtError } from '#app'
44
55
useSeoMeta({
66
title: 'Page not found',
@@ -23,15 +23,15 @@ useHead({
2323
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation())
2424
const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', {
2525
default: () => [],
26-
server: false,
26+
server: false
2727
})
2828
2929
provide('navigation', navigation)
3030
</script>
3131

3232
<template>
3333
<div>
34-
<Header />
34+
<AppHeader />
3535

3636
<UMain>
3737
<UContainer>
@@ -41,10 +41,13 @@ provide('navigation', navigation)
4141
</UContainer>
4242
</UMain>
4343

44-
<Footer />
44+
<AppFooter />
4545

4646
<ClientOnly>
47-
<LazyUContentSearch :files="files" :navigation="navigation" />
47+
<LazyUContentSearch
48+
:files="files"
49+
:navigation="navigation"
50+
/>
4851
</ClientOnly>
4952

5053
<UNotifications />

eslint.config.mjs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @ts-check
2+
import withNuxt from './.nuxt/eslint.config.mjs'
3+
4+
export default withNuxt(
5+
// Your custom configs here
6+
)

nuxt.config.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export default defineNuxtConfig({
33
extends: ['@nuxt/ui-pro'],
44
modules: [
55
'@nuxt/content',
6+
'@nuxt/eslint',
67
'@nuxt/ui',
78
'@nuxt/fonts',
89
'@nuxthq/studio',
@@ -11,21 +12,29 @@ export default defineNuxtConfig({
1112
hooks: {
1213
// Define `@nuxt/ui` components as global to use them in `.md` (feel free to add those you need)
1314
'components:extend': (components) => {
14-
const globals = components.filter((c) => ['UButton', 'UIcon'].includes(c.pascalName))
15+
const globals = components.filter(c => ['UButton', 'UIcon'].includes(c.pascalName))
1516

16-
globals.forEach((c) => c.global = true)
17+
globals.forEach(c => c.global = true)
1718
}
1819
},
1920
ui: {
2021
icons: ['heroicons', 'simple-icons']
2122
},
2223
routeRules: {
23-
'/api/search.json': { prerender: true },
24+
'/api/search.json': { prerender: true }
2425
},
2526
devtools: {
2627
enabled: true
2728
},
2829
typescript: {
2930
strict: false
31+
},
32+
eslint: {
33+
config: {
34+
stylistic: {
35+
commaDangle: 'never',
36+
braceStyle: '1tbs'
37+
}
38+
}
3039
}
3140
})

nuxt.schema.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default defineNuxtSchema({
8686
icon: 'i-mdi-web',
8787
default: []
8888
})
89-
},
89+
}
9090
}),
9191
header: group({
9292
title: 'Header',
@@ -142,7 +142,7 @@ export default defineNuxtSchema({
142142
icon: 'i-mdi-link-variant',
143143
default: []
144144
})
145-
},
145+
}
146146
}),
147147
footer: group({
148148
title: 'Footer',

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"nuxt-og-image": "^2.2.4"
2222
},
2323
"devDependencies": {
24-
"@nuxt/eslint-config": "^0.3.9",
24+
"@nuxt/eslint": "^0.3.9",
2525
"@nuxthq/studio": "^1.0.13",
26-
"eslint": "^8.57.0",
26+
"eslint": "^9.1.1",
2727
"vue-tsc": "^2.0.14"
2828
}
2929
}

pages/[...slug].vue

+35-9
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,55 @@ const links = computed(() => [toc?.bottom?.edit && {
3838
icon: 'i-heroicons-pencil-square',
3939
label: 'Edit this page',
4040
to: `${toc.bottom.edit}/${page?.value?._file}`,
41-
target: '_blank',
41+
target: '_blank'
4242
}, ...(toc?.bottom?.links || [])].filter(Boolean))
4343
</script>
4444

4545
<template>
4646
<UPage>
47-
<UPageHeader :title="page.title" :description="page.description" :links="page.links" :headline="headline" />
47+
<UPageHeader
48+
:title="page.title"
49+
:description="page.description"
50+
:links="page.links"
51+
:headline="headline"
52+
/>
4853

4954
<UPageBody prose>
50-
<ContentRenderer v-if="page.body" :value="page" />
55+
<ContentRenderer
56+
v-if="page.body"
57+
:value="page"
58+
/>
5159

5260
<hr v-if="surround?.length">
5361

5462
<UContentSurround :surround="surround" />
5563
</UPageBody>
5664

57-
<template v-if="page.toc !== false" #right>
58-
<UContentToc :title="toc?.title" :links="page.body?.toc?.links">
59-
<template v-if="toc?.bottom" #bottom>
60-
<div class="hidden lg:block space-y-6" :class="{ '!mt-6': page.body?.toc?.links?.length }">
61-
<UDivider v-if="page.body?.toc?.links?.length" type="dashed" />
65+
<template
66+
v-if="page.toc !== false"
67+
#right
68+
>
69+
<UContentToc
70+
:title="toc?.title"
71+
:links="page.body?.toc?.links"
72+
>
73+
<template
74+
v-if="toc?.bottom"
75+
#bottom
76+
>
77+
<div
78+
class="hidden lg:block space-y-6"
79+
:class="{ '!mt-6': page.body?.toc?.links?.length }"
80+
>
81+
<UDivider
82+
v-if="page.body?.toc?.links?.length"
83+
type="dashed"
84+
/>
6285

63-
<UPageLinks :title="toc.bottom.title" :links="links" />
86+
<UPageLinks
87+
:title="toc.bottom.title"
88+
:links="links"
89+
/>
6490
</div>
6591
</template>
6692
</UContentToc>

0 commit comments

Comments
 (0)