Skip to content

Commit

Permalink
lint: use new flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
mitjans committed Apr 19, 2024
1 parent aaff7dc commit 1346e4b
Show file tree
Hide file tree
Showing 20 changed files with 427 additions and 226 deletions.
10 changes: 4 additions & 6 deletions docs/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module.exports = {
root: true,
extends: [
'@nuxt/eslint-config'
],
extends: ['@nuxt/eslint-config'],
rules: {
// Global
semi: ['error', 'never'],
Expand All @@ -11,6 +9,6 @@ module.exports = {
// Vue
'vue/multi-word-component-names': 0,
'vue/max-attributes-per-line': 'off',
'vue/no-v-html': 0
}
}
'vue/no-v-html': 0,
},
};
2 changes: 1 addition & 1 deletion docs/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ export default defineAppConfig({
],
},
},
})
});
30 changes: 13 additions & 17 deletions docs/app.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
<script setup lang="ts">
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
import type { ParsedContent } from '@nuxt/content/dist/runtime/types';
const { seo } = useAppConfig()
const { seo } = useAppConfig();
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation())
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation());
const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', {
default: () => [],
server: false
})
server: false,
});
useHead({
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
],
link: [
{ rel: 'icon', href: '/favicon.ico' }
],
meta: [{ name: 'viewport', content: 'width=device-width, initial-scale=1' }],
link: [{ rel: 'icon', href: '/favicon.ico' }],
htmlAttrs: {
lang: 'en'
}
})
lang: 'en',
},
});
useSeoMeta({
ogSiteName: seo?.siteName,
twitterCard: 'summary_large_image'
})
twitterCard: 'summary_large_image',
});
provide('navigation', navigation)
provide('navigation', navigation);
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/Footer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
const { footer } = useAppConfig()
const { footer } = useAppConfig();
</script>

<template>
Expand Down
6 changes: 3 additions & 3 deletions docs/components/Header.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import type { NavItem } from '@nuxt/content/dist/runtime/types'
import type { NavItem } from '@nuxt/content/dist/runtime/types';
const navigation = inject<NavItem[]>('navigation', [])
const navigation = inject<NavItem[]>('navigation', []);
const { header } = useAppConfig()
const { header } = useAppConfig();
</script>

<template>
Expand Down
12 changes: 6 additions & 6 deletions docs/components/OgImage/OgImageDocs.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<script lang="ts" setup>
defineOptions({
inheritAttrs: false
})
inheritAttrs: false,
});
defineProps({
title: {
type: String,
required: true
required: true,
},
description: {
type: String,
required: true
}
})
required: true,
},
});
</script>

<template>
Expand Down
24 changes: 12 additions & 12 deletions docs/error.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<script setup lang="ts">
import type { NuxtError } from '#app'
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
import type { NuxtError } from '#app';
import type { ParsedContent } from '@nuxt/content/dist/runtime/types';
useSeoMeta({
title: 'Page not found',
description: 'We are sorry but this page could not be found.'
})
description: 'We are sorry but this page could not be found.',
});
defineProps<{
error: NuxtError
}>()
error: NuxtError;
}>();
useHead({
htmlAttrs: {
lang: 'en'
}
})
lang: 'en',
},
});
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation())
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation());
const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', {
default: () => [],
server: false,
})
});
provide('navigation', navigation)
provide('navigation', navigation);
</script>

<template>
Expand Down
4 changes: 2 additions & 2 deletions docs/layouts/docs.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { NavItem } from '@nuxt/content/dist/runtime/types'
import type { NavItem } from '@nuxt/content/dist/runtime/types';
const navigation = inject<Ref<NavItem[]>>('navigation')
const navigation = inject<Ref<NavItem[]>>('navigation');
</script>

<template>
Expand Down
26 changes: 13 additions & 13 deletions docs/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,40 @@ export default defineNuxtConfig({
'@nuxtjs/fontaine',
'@nuxtjs/google-fonts',
'nuxt-og-image',
'../src/module'
'../src/module',
],
hooks: {
// Define `@nuxt/ui` components as global to use them in `.md` (feel free to add those you need)
'components:extend': (components) => {
const globals = components.filter((c) => ['UButton', 'UIcon'].includes(c.pascalName))
const globals = components.filter((c) => ['UButton', 'UIcon'].includes(c.pascalName));

globals.forEach((c) => c.global = true)
}
globals.forEach((c) => (c.global = true));
},
},
ui: {
icons: ['heroicons', 'simple-icons']
icons: ['heroicons', 'simple-icons'],
},
// Fonts
fontMetrics: {
fonts: ['DM Sans']
fonts: ['DM Sans'],
},
googleFonts: {
display: 'swap',
download: true,
families: {
'DM+Sans': [400, 500, 600, 700]
}
'DM+Sans': [400, 500, 600, 700],
},
},
routeRules: {
'/api/search.json': { prerender: true },
},
devtools: {
enabled: true
enabled: true,
},
typescript: {
strict: false
strict: false,
},
uiPro: {
license: 'oss'
}
})
license: 'oss',
},
});
Loading

0 comments on commit 1346e4b

Please sign in to comment.