Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantgillespie committed Sep 9, 2024
1 parent 6b21579 commit 0d24733
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 60 deletions.
2 changes: 1 addition & 1 deletion components/Base/FormGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Props {
hideLabel?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
withDefaults(defineProps<Props>(), {
required: false,
hideLabel: false,
});
Expand Down
2 changes: 1 addition & 1 deletion components/Base/HsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { formId } = toRefs(props);
const { $directus, $readSingleton, $posthog } = useNuxtApp();
declare global {
var hbspt: any;
let hbspt: any;
}
const { data: globals } = useAsyncData('sales-reps', () =>
Expand Down
2 changes: 0 additions & 2 deletions components/Base/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ const inputClasses = computed(() => ({
'has-prepend-icon': !!props.prependIcon,
'has-append-icon': !!props.appendIcon,
}));
const { theme } = useTheme();
</script>

<template>
Expand Down
4 changes: 2 additions & 2 deletions components/Block/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ interface BlockCardProps extends BlockProps {
}
interface ExtendedBlockCard extends BlockCard {
page: Page | null;
resource: Resource | null;
page: Page | null;
resource: Resource | null;
}
const props = withDefaults(defineProps<BlockCardProps>(), {
Expand Down
2 changes: 1 addition & 1 deletion components/Block/CardGroupDynamic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const { data: cards, pending } = await useAsyncData(
description: start_time
? new Intl.DateTimeFormat('en-US', {
dateStyle: 'medium',
}).format(new Date(start_time))
}).format(new Date(start_time))
: '',
href: link_url ?? undefined,
badge: location?.includes('Online') ? 'Online' : 'In Person',
Expand Down
2 changes: 1 addition & 1 deletion components/Block/Media.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const { data: block } = useAsyncData(props.uuid, () =>
<BaseMedia
v-if="block"
class="block-media"
:aspect="block.type === 'arcade' ? 'auto' : block.aspect_ratio ?? undefined"
:aspect="block.type === 'arcade' ? 'auto' : (block.aspect_ratio ?? undefined)"
:border="block.border"
:radius="block.border_radius"
:caption="block.caption ?? undefined"
Expand Down
1 change: 0 additions & 1 deletion components/Block/Metric.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import type { BlockProps } from './types';
import { resourcePermalink } from '~/utils/resourcePermalink';
interface BlockMetricGroupProps extends BlockProps {
background: 'transparent' | 'pristine-white' | 'simple-gray';
}
Expand Down
1 change: 0 additions & 1 deletion components/LogoTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import type { File } from '~/types/schema';
import { resourcePermalink } from '~/utils/resourcePermalink';
export interface LogoTitleProps {
logos: {
id: string;
Expand Down
11 changes: 5 additions & 6 deletions components/Nav/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ watch(() => route.fullPath, resetNavState);
onClickOutside(headerContainer, resetNavState);
const activeSectionTitle = computed(() => {
return unref(menu)?.items?.find(
(item) =>
item.children?.some(
// @TODO remove as {}
(child) => (child.page as { permalink: string })?.permalink === route.path || child.url === route.path,
),
return unref(menu)?.items?.find((item) =>
item.children?.some(
// @TODO remove as {}
(child) => (child.page as { permalink: string })?.permalink === route.path || child.url === route.path,
),
)?.id;
});
Expand Down
14 changes: 7 additions & 7 deletions modules/posthog/runtime/plugins/posthog.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default defineNuxtPlugin({
// Make sure that pageviews are captured with each route change
const router = useRouter();

router.beforeEach((to, from) => {
router.beforeEach(() => {
posthog.capture('$pageview');
});
}
Expand All @@ -65,13 +65,13 @@ export default defineNuxtPlugin({
});

declare module '#app' {
interface NuxtApp {
$posthog: PostHog | null;
}
interface NuxtApp {
$posthog: PostHog | null;
}
}

declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$posthog: PostHog | null;
}
interface ComponentCustomProperties {
$posthog: PostHog | null;
}
}
12 changes: 6 additions & 6 deletions pages/agency-directory/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,14 @@ useSchemaOrg([
<BaseHeading tag="h3" :content="`Other Directus Agencies in ${partner?.region}`" size="medium" />
<BaseCardGroup grid="4" class="mt-4">
<BaseCard
v-for="partner in relatedPartners"
:key="partner.id"
:title="partner?.partner_name"
:image="partner?.partner_logo as string"
v-for="relatedPartner in relatedPartners"
:key="relatedPartner.id"
:title="relatedPartner?.partner_name"
:image="relatedPartner?.partner_logo as string"
media-style="image-fill-1-1"
:to="`/agency-directory/${partner?.slug as string}`"
:to="`/agency-directory/${relatedPartner?.slug as string}`"
title-size="small"
:description="partner?.country ?? undefined"
:description="relatedPartner?.country ?? undefined"
/>
</BaseCardGroup>
</section>
Expand Down
12 changes: 6 additions & 6 deletions pages/built-with-directus/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,14 @@ useSchemaOrg([
<BaseHeading tag="h3" content="Other Directus Projects" size="medium" />
<BaseCardGroup grid="3" class="mt-4">
<BaseCard
v-for="project in relatedProjects"
:key="project.id"
:title="project?.project_title"
:image="(project?.featured_image as string) ?? undefined"
v-for="relatedProject in relatedProjects"
:key="relatedProject.id"
:title="relatedProject?.project_title"
:image="(relatedProject?.featured_image as string) ?? undefined"
media-style="image-fill-16-9"
:to="`/built-with-directus/${project?.slug as string}`"
:to="`/built-with-directus/${relatedProject?.slug as string}`"
title-size="small"
:description="truncateString(project?.short_summary, 100) ?? ''"
:description="truncateString(relatedProject?.short_summary, 100) ?? ''"
/>
</BaseCardGroup>
</section>
Expand Down
1 change: 1 addition & 0 deletions pages/team/[slug].vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { dynamicAsset } from '~/utils/dynamicAsset';
const { params } = useRoute();
const slug = computed(() => params.slug as string);
Expand Down
2 changes: 1 addition & 1 deletion pages/tv/[show]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const heroButtons = latest
text: 'Play Latest Episode',
href: `/tv/${unref(show).slug}/${unref(latest).slug}`,
},
]
]
: [];
const listing = unref(seasons)
Expand Down
35 changes: 17 additions & 18 deletions plugins/directus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

const queue = new Queue({ intervalCap: 10, interval: 500, carryoverConcurrencyCount: true });


export default defineNuxtPlugin((nuxtApp) => {
const route = useRoute();
const config = useRuntimeConfig();
Expand Down Expand Up @@ -37,14 +36,14 @@ export default defineNuxtPlugin((nuxtApp) => {
});
}

return {
return {
provide: {
directus: directus as RestClient<Schema>,
readItem,
readItems,
readSingleton,
aggregate
}
aggregate,
},
};
});

Expand All @@ -64,21 +63,21 @@ async function fetchRetry(count: number, ...args: Parameters<typeof fetch>) {

// Needed for vue-tsc 2.x to work properly with Nuxt
declare module '#app' {
interface NuxtApp {
$directus: RestClient<Schema>;
$readItem: typeof readItem;
$readItems: typeof readItems;
$readSingleton: typeof readSingleton;
$aggregate: typeof aggregate;
}
interface NuxtApp {
$directus: RestClient<Schema>;
$readItem: typeof readItem;
$readItems: typeof readItems;
$readSingleton: typeof readSingleton;
$aggregate: typeof aggregate;
}
}

declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$directus: RestClient<Schema>;
$readItem: typeof readItem;
$readItems: typeof readItems;
$readSingleton: typeof readSingleton;
$aggregate: typeof aggregate;
}
interface ComponentCustomProperties {
$directus: RestClient<Schema>;
$readItem: typeof readItem;
$readItems: typeof readItems;
$readSingleton: typeof readSingleton;
$aggregate: typeof aggregate;
}
}
8 changes: 4 additions & 4 deletions server/api/code-highlighter.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ interface CodeHighlighterBody {
background: string;
}

let shiki: any
let shiki: any;

export default defineEventHandler(async (event) => {
const body = await readBody(event);

if(!shiki) {
shiki = await createHighlighter({
if (!shiki) {
shiki = await createHighlighter({
themes: [lightTheme as unknown as ThemeInput, darkTheme as unknown as ThemeInput],
langs: ['graphql', 'http', 'typescript', 'sql', 'json'],
});
}
}

const { snippet, language, background } = body as CodeHighlighterBody;

Expand Down
2 changes: 1 addition & 1 deletion server/routes/rss.xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default defineEventHandler(async (event) => {
author: [
{
name: author.name ?? 'Directus Team',
link: author.slug ? `https://directus.io/team/${author.slug}` : 'https://directus.io/',
link: author.slug ? `https://directus.io/team/${author.slug}` : 'https://directus.io/',
},
],
content: `<p>${post.summary}</p><p>-------</p><p><a href="https://directus.io/${type.slug}/${post.slug}">Read the full post on the Directus website -></a></p>`,
Expand Down
2 changes: 1 addition & 1 deletion utils/og.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function getOgProps(baseUrl: string, collection: string, item = {} as any
publishedAt: item?.date_published
? new Intl.DateTimeFormat('en-US', {
dateStyle: 'full',
}).format(new Date(item?.date_published))
}).format(new Date(item?.date_published))
: null,
};
case 'team':
Expand Down

0 comments on commit 0d24733

Please sign in to comment.