Skip to content

Commit

Permalink
chore: run linter
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Oct 26, 2023
1 parent a81a6c4 commit 7efeffc
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 36 deletions.
4 changes: 2 additions & 2 deletions docs/components/HeaderLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function isActive(item) {
<div class="flex items-center">
<div class="flex items-center mr-3 mb-1">
<div class="relative">
<icon name="lucide:triangle" class="text-black dark:text-white w-7 h-7 transition-all group-hover:opacity-30" />
<icon name="lucide:triangle" class="text-black dark:text-white w-7 h-7 transition-all absolute left-0 top-0 group-hover:-translate-x-2" />
<Icon name="lucide:triangle" class="text-black dark:text-white w-7 h-7 transition-all group-hover:opacity-30" />
<Icon name="lucide:triangle" class="text-black dark:text-white w-7 h-7 transition-all absolute left-0 top-0 group-hover:-translate-x-2" />
</div>
<div class="ml-3">
<h1 class="font-bold text-xl group-hover:drop-shadow-md">
Expand Down
4 changes: 2 additions & 2 deletions docs/components/ShowcaseCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const linkAttrs = computed(() => {

<template>
<div class="showcase-card relative h-full">
<component :is="to ? NuxtLink : 'div'" v-bind="linkAttrs" class="h-full">
<Component :is="to ? NuxtLink : 'div'" v-bind="linkAttrs" class="h-full">
<div class="group relative border hover:border-yellow-400 transition rounded-xl overflow-hidden h-full">
<div
class="h-48 relative flex items-center justify-center bg-no-repeat bg-cover border-b-2 border-gray-100/30 dark:border-gray-900/10"
Expand All @@ -41,6 +41,6 @@ const linkAttrs = computed(() => {
</p>
</div>
</div>
</component>
</Component>
</div>
</template>
4 changes: 2 additions & 2 deletions docs/components/content/Alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const NuxtLink = resolveComponent('NuxtLink')
</script>

<template>
<component
<Component
:is="to ? NuxtLink : 'div'"
:to="to"
class="block pl-4 pr-6 py-3 rounded-md !border !border-gray-200 dark:!border-gray-700 bg-gray-50 dark:bg-gray-800 text-gray-700 dark:text-gray-300 text-sm leading-6 my-5 last:mb-0 font-normal group relative prose-code:bg-white dark:prose-code:bg-gray-900"
Expand All @@ -29,5 +29,5 @@ const NuxtLink = resolveComponent('NuxtLink')
<UIcon v-if="icon" :name="icon" class="w-4 h-4 mr-2 inline-flex items-center align-text-top" :class="color" />

<ContentSlot :use="$slots.default" unwrap="p" />
</component>
</Component>
</template>
2 changes: 1 addition & 1 deletion docs/components/content/CodeGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default {
</div>

<div class="[&>div>pre]:!rounded-t-none">
<component :is="selectedTab.component" />
<Component :is="selectedTab.component" />
</div>
</div>
</template>
4 changes: 2 additions & 2 deletions docs/components/content/ComponentCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ const { data: ast } = await useAsyncData(`${name}-ast-${JSON.stringify(props)}`,
</div>

<div class="flex border border-b-0 border-gray-200 dark:border-gray-700 relative not-prose" :class="[{ 'p-4': padding }, propsToSelect.length ? 'border-t-0' : 'rounded-t-md', backgroundClass, overflowClass]">
<component :is="name" v-model="vModel" v-bind="fullProps">
<Component :is="name" v-model="vModel" v-bind="fullProps">
<ContentSlot v-if="$slots.default" :use="$slots.default" />

<template v-for="slot in Object.keys(slots || {})" :key="slot" #[slot]>
<ClientOnly>
<ContentSlot v-if="$slots[slot]" :use="$slots[slot]" />
</ClientOnly>
</template>
</component>
</Component>
</div>

<ContentRenderer v-if="!previewOnly" :value="ast" class="[&>div>pre]:!rounded-t-none" />
Expand Down
4 changes: 2 additions & 2 deletions examples/nuxt3/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ useHead({
<div>
<NuxtPage />
</div>
<nuxt-link to="/" style="margin-top: 10px;" as="div">
<NuxtLink to="/" style="margin-top: 10px;" as="div">
Home
</nuxt-link>
</NuxtLink>
<button @click="isNavActive = !isNavActive">
Nav open
</button>
Expand Down
18 changes: 9 additions & 9 deletions examples/vite-ssr-vue/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<template>
<div>
<router-link to="/">
<RouterLink to="/">
Home
</router-link>|
<router-link to="/about">
</RouterLink>|
<RouterLink to="/about">
About
</router-link>|
<router-link to="/red">
</RouterLink>|
<RouterLink to="/red">
Red
</router-link>
<router-view v-slot="{ Component }">
</RouterLink>
<RouterView v-slot="{ Component }">
<Suspense>
<div>
<component :is="Component" />
<Component :is="Component" />
</div>
</Suspense>
</router-view>
</RouterView>
</div>
</template>

Expand Down
6 changes: 2 additions & 4 deletions packages/schema/src/safeSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ import type {
export type SafeBodyAttr = Pick<BodyAttr, 'id' | 'class'> & DataKeys
export type SafeHtmlAttr = Pick<HtmlAttr, 'id' | 'class' | 'lang' | 'dir'> & DataKeys
export type SafeMeta = Pick<_Meta, 'id' | 'name' | 'property' | 'content'> & DataKeys
export type SafeLink = Pick<Link,
'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesizes' | 'imagesrcset' | 'integrity' | 'media'
| 'referrerpolicy' | 'sizes' | 'id'
> & {
export type SafeLink = Pick<Link, 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesizes' | 'imagesrcset' | 'integrity' | 'media'
| 'referrerpolicy' | 'sizes' | 'id'> & {
rel?: Omit<Link['rel'], 'stylesheet' | 'canonical' | 'modulepreload' | 'prerender' | 'preload' | 'prefetch'>
type?: 'audio/aac' | 'application/x-abiword' | 'application/x-freearc' | 'image/avif' | 'video/x-msvideo' | 'application/vnd.amazon.ebook' | 'application/octet-stream' | 'image/bmp' | 'application/x-bzip' | 'application/x-bzip2' | 'application/x-cdf' | 'application/x-csh' | 'text/csv' | 'application/msword' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' | 'application/vnd.ms-fontobject' | 'application/epub+zip' | 'application/gzip' | 'image/gif' | 'image/vnd.microsoft.icon' | 'text/calendar' | 'application/java-archive' | 'image/jpeg' | 'application/json' | 'application/ld+json' | 'audio/midi' | 'audio/x-midi' | 'audio/mpeg' | 'video/mp4' | 'video/mpeg' | 'application/vnd.apple.installer+xml' | 'application/vnd.oasis.opendocument.presentation' | 'application/vnd.oasis.opendocument.spreadsheet' | 'application/vnd.oasis.opendocument.text' | 'audio/ogg' | 'video/ogg' | 'application/ogg' | 'audio/opus' | 'font/otf' | 'image/png' | 'application/pdf' | 'application/x-httpd-php' | 'application/vnd.ms-powerpoint' | 'application/vnd.openxmlformats-officedocument.presentationml.presentation' | 'application/vnd.rar' | 'application/rtf' | 'application/x-sh' | 'image/svg+xml' | 'application/x-tar' | 'image/tiff' | 'video/mp2t' | 'font/ttf' | 'text/plain' | 'application/vnd.visio' | 'audio/wav' | 'audio/webm' | 'video/webm' | 'image/webp' | 'font/woff' | 'font/woff2' | 'application/xhtml+xml' | 'application/vnd.ms-excel' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'text/xml' | 'application/atom+xml' | 'application/xml' | 'application/vnd.mozilla.xul+xml' | 'application/zip' | 'video/3gpp' | 'audio/3gpp' | 'video/3gpp2' | 'audio/3gpp2' | (string & Record<never, never>)
} & DataKeys
Expand Down
2 changes: 1 addition & 1 deletion packages/unhead/src/composables/useScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getActiveHead } from './useActiveHead'

const UseScriptDefaults: Script = {
async: true,
fetchpriority: 'low'
fetchpriority: 'low',
}

export function useScript<T>(input: UseScriptInput, _options?: UseScriptOptions<T>): T & { $script: ScriptInstance<T> } {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/components/Head.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function vnodesToHeadObj(nodes: VNode[]) {
}

export const Head: DefineComponent = /* @__PURE__ */ defineComponent({
// eslint-disable-next-line vue/no-reserved-component-names

name: 'Head',

setup(_, { slots }) {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/composables/useScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useScript as _useScript } from 'unhead'
import type { ComputedRef, Ref } from 'vue'
import { computed, getCurrentInstance, ref } from 'vue'
import { NetworkEvents } from '@unhead/shared'
import type { MaybeComputedRefEntriesOnly } from '../types'
import { injectHead } from './injectHead'
import {MaybeComputedRefEntriesOnly} from "../types";

export interface VueScriptInstance<T> extends Omit<ScriptInstance<T>, 'loaded' | 'status'> {
loaded: ComputedRef<boolean>
Expand Down
1 change: 0 additions & 1 deletion packages/vue/src/types/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export type MaybeComputedRefEntries<T> = MaybeComputedRef<T> | {
[key in keyof T]?: MaybeComputedRefOrPromise<T[key]>
}


export type MaybeComputedRefEntriesOnly<T> = {
[key in keyof T]?: MaybeComputedRefOrPromise<T[key]>
}
4 changes: 2 additions & 2 deletions test/vue/dom-useHead.bench.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { bench, describe } from 'vitest'
import { describe } from 'vitest'
import { createHead, useHead } from '@unhead/vue'
import { ref } from 'vue'
import { renderDOMHead } from '@unhead/dom'
import { useDom } from '../fixtures'

describe('dom-useHead', () => {
bench('x1000', async () => {
it('x1000', async () => {
const head = createHead()
const page = ref({
title: 'Home',
Expand Down
1 change: 0 additions & 1 deletion test/vue/dom/keepalive.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @vitest-environment jsdom
/* eslint-disable vue/one-component-per-file */

import { describe, it } from 'vitest'
import { createHead, injectHead, useHead } from '@unhead/vue'
Expand Down
10 changes: 5 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"compilerOptions": {
"target": "esnext",
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"jsx": "preserve",
"module": "esnext",
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"baseUrl": ".",
"rootDir": ".",
"module": "esnext",
"moduleResolution": "node",
"baseUrl": ".",
"paths": {
"unhead": ["packages/unhead/src"],
"@unhead/dom": ["packages/dom/src"],
Expand All @@ -24,12 +24,12 @@
"@unhead/schema-org/*": ["packages/schema-org/*"]
},
"resolveJsonModule": true,
"declaration": true,
"esModuleInterop": true,
"strict": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"noUnusedLocals": true,
"declaration": true,
"esModuleInterop": true,
"skipDefaultLibCheck": true,
"skipLibCheck": true
}
Expand Down

0 comments on commit 7efeffc

Please sign in to comment.