From 12a56f7567eb15568a2560e35495e009262e9074 Mon Sep 17 00:00:00 2001 From: "ecospark[bot]" <128108030+ecospark[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 16:05:56 +0200 Subject: [PATCH] =?UTF-8?q?chore(prettier):=20=F0=9F=A4=96=20=E2=9C=A8=20(?= =?UTF-8?q?#338)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- components/BlogHeader.tsx | 2 +- components/HeroPost.tsx | 2 +- components/PostHeader.tsx | 2 +- components/PreviewIndexPage.tsx | 2 +- components/PreviewPostPage.tsx | 4 ++-- intro-template/index.tsx | 2 +- lib/sanity.client.ts | 4 ++-- pages/api/disable-draft.ts | 2 +- pages/api/og.tsx | 4 ++-- pages/api/revalidate.ts | 20 ++++++++++---------- plugins/previewPane/index.tsx | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/components/BlogHeader.tsx b/components/BlogHeader.tsx index 777ebcc03..3381ef0fc 100644 --- a/components/BlogHeader.tsx +++ b/components/BlogHeader.tsx @@ -42,7 +42,7 @@ export default function BlogHeader({ throw new Error( `Invalid level: ${ JSON.stringify(level) || typeof level - }, only 1 or 2 are allowed` + }, only 1 or 2 are allowed`, ) } } diff --git a/components/HeroPost.tsx b/components/HeroPost.tsx index 9644675a8..33d3bb164 100644 --- a/components/HeroPost.tsx +++ b/components/HeroPost.tsx @@ -8,7 +8,7 @@ export default function HeroPost( props: Pick< Post, 'title' | 'coverImage' | 'date' | 'excerpt' | 'author' | 'slug' - > + >, ) { const { title, coverImage, date, excerpt, author, slug } = props return ( diff --git a/components/PostHeader.tsx b/components/PostHeader.tsx index 23a720d7b..ef1a45e7a 100644 --- a/components/PostHeader.tsx +++ b/components/PostHeader.tsx @@ -5,7 +5,7 @@ import PostTitle from 'components/PostTitle' import type { Post } from 'lib/sanity.queries' export default function PostHeader( - props: Pick + props: Pick, ) { const { title, coverImage, date, author, slug } = props return ( diff --git a/components/PreviewIndexPage.tsx b/components/PreviewIndexPage.tsx index e9cae0999..0c5d04389 100644 --- a/components/PreviewIndexPage.tsx +++ b/components/PreviewIndexPage.tsx @@ -11,7 +11,7 @@ export default function PreviewIndexPage(props: IndexPageProps) { const [posts, loadingPosts] = useLiveQuery(props.posts, indexQuery) const [settings, loadingSettings] = useLiveQuery( props.settings, - settingsQuery + settingsQuery, ) return ( diff --git a/components/PreviewPostPage.tsx b/components/PreviewPostPage.tsx index ae2f0f3e5..03e232852 100644 --- a/components/PreviewPostPage.tsx +++ b/components/PreviewPostPage.tsx @@ -16,11 +16,11 @@ export default function PreviewPostPage(props: PostPageProps) { postAndMoreStoriesQuery, { slug: props.post.slug, - } + }, ) const [settings, loadingSettings] = useLiveQuery( props.settings, - settingsQuery + settingsQuery, ) return ( diff --git a/intro-template/index.tsx b/intro-template/index.tsx index 0953f725b..41247862b 100644 --- a/intro-template/index.tsx +++ b/intro-template/index.tsx @@ -25,7 +25,7 @@ export default memo(function IntroTemplate() { if (typeof window !== 'undefined') { setStudioURL(`${window.location.origin}/studio`) setCreatePostURL( - `${window.location.origin}/studio/intent/create/template=post;type=post/` + `${window.location.origin}/studio/intent/create/template=post;type=post/`, ) setIsLocalhost(window.location.hostname === 'localhost') setHasUTMtags(window.location.search.includes('utm')) diff --git a/lib/sanity.client.ts b/lib/sanity.client.ts index 6781edad0..a6650124d 100644 --- a/lib/sanity.client.ts +++ b/lib/sanity.client.ts @@ -50,14 +50,14 @@ export async function getAllPostsSlugs(): Promise[]> { export async function getPostBySlug( client: SanityClient, - slug: string + slug: string, ): Promise { return (await client.fetch(postBySlugQuery, { slug })) || ({} as any) } export async function getPostAndMoreStories( client: SanityClient, - slug: string + slug: string, ): Promise<{ post: Post; morePosts: Post[] }> { return await client.fetch(postAndMoreStoriesQuery, { slug }) } diff --git a/pages/api/disable-draft.ts b/pages/api/disable-draft.ts index e070fb3f6..a9fe88018 100644 --- a/pages/api/disable-draft.ts +++ b/pages/api/disable-draft.ts @@ -2,7 +2,7 @@ import type { NextApiRequest, NextApiResponse } from 'next' export default function exit( _req: NextApiRequest, - res: NextApiResponse + res: NextApiResponse, ): void { // Exit the current user from "Draft Mode". res.setDraftMode({ enable: false }) diff --git a/pages/api/og.tsx b/pages/api/og.tsx index 459b50ce9..b5f454bc4 100644 --- a/pages/api/og.tsx +++ b/pages/api/og.tsx @@ -12,7 +12,7 @@ import { Settings, settingsQuery } from 'lib/sanity.queries' export default async function og(req: NextRequest, res: NextResponse) { const font = fetch(new URL('public/Inter-Bold.woff', import.meta.url)).then( - (res) => res.arrayBuffer() + (res) => res.arrayBuffer(), ) const { searchParams } = new URL(req.url) @@ -41,6 +41,6 @@ export default async function og(req: NextRequest, res: NextResponse) { weight: 700, }, ], - } + }, ) } diff --git a/pages/api/revalidate.ts b/pages/api/revalidate.ts index 8e12f03e8..78070a621 100644 --- a/pages/api/revalidate.ts +++ b/pages/api/revalidate.ts @@ -31,12 +31,12 @@ export { config } from 'next-sanity/webhook' export default async function revalidate( req: NextApiRequest, - res: NextApiResponse + res: NextApiResponse, ) { try { const { body, isValidSignature } = await parseBody( req, - process.env.SANITY_REVALIDATE_SECRET + process.env.SANITY_REVALIDATE_SECRET, ) if (isValidSignature === false) { const message = 'Invalid signature' @@ -65,7 +65,7 @@ export default async function revalidate( type StaleRoute = '/' | `/posts/${string}` async function queryStaleRoutes( - body: Pick + body: Pick, ): Promise { const client = createClient({ projectId, dataset, apiVersion, useCdn: false }) @@ -82,7 +82,7 @@ async function queryStaleRoutes( groq`count( *[_type == "post"] | order(date desc, _updatedAt desc) [0...3] [dateTime(date) > dateTime($date)] )`, - { date: body.date } + { date: body.date }, ) // If there's less than 3 posts with a newer date, we need to revalidate everything if (moreStories < 3) { @@ -116,10 +116,10 @@ async function queryAllRoutes(client: SanityClient): Promise { async function mergeWithMoreStories( client, - slugs: string[] + slugs: string[], ): Promise { const moreStories = await client.fetch( - groq`*[_type == "post"] | order(date desc, _updatedAt desc) [0...3].slug.current` + groq`*[_type == "post"] | order(date desc, _updatedAt desc) [0...3].slug.current`, ) if (slugs.some((slug) => moreStories.includes(slug))) { const allSlugs = await _queryAllRoutes(client) @@ -131,13 +131,13 @@ async function mergeWithMoreStories( async function queryStaleAuthorRoutes( client: SanityClient, - id: string + id: string, ): Promise { let slugs = await client.fetch( groq`*[_type == "author" && _id == $id] { "slug": *[_type == "post" && references(^._id)].slug.current }["slug"][]`, - { id } + { id }, ) if (slugs.length > 0) { @@ -150,11 +150,11 @@ async function queryStaleAuthorRoutes( async function queryStalePostRoutes( client: SanityClient, - id: string + id: string, ): Promise { let slugs = await client.fetch( groq`*[_type == "post" && _id == $id].slug.current`, - { id } + { id }, ) slugs = await mergeWithMoreStories(client, slugs) diff --git a/plugins/previewPane/index.tsx b/plugins/previewPane/index.tsx index cbfa3235e..5f18d89c7 100644 --- a/plugins/previewPane/index.tsx +++ b/plugins/previewPane/index.tsx @@ -23,7 +23,7 @@ const urlResolver = defineUrlResolver({ const iframeOptions = { url: urlResolver, urlSecretId: previewSecretId, - reload: {button: true}, + reload: { button: true }, } satisfies IframeOptions export const previewDocumentNode = (): DefaultDocumentNodeResolver => {