From 1c9176d44c381fb09ae0321a9fb2709fdf5a5e4e Mon Sep 17 00:00:00 2001 From: saberzero1 Date: Sat, 7 Feb 2026 06:22:07 +0100 Subject: [PATCH] fix: use any for Quartz types to avoid conflicts with Quartz internals --- src/components/ExampleComponent.tsx | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/components/ExampleComponent.tsx b/src/components/ExampleComponent.tsx index 27b0595..9f1155c 100644 --- a/src/components/ExampleComponent.tsx +++ b/src/components/ExampleComponent.tsx @@ -1,4 +1,4 @@ -import type { VNode } from "preact"; +import type { VNode, JSX } from "preact"; export interface ExampleComponentOptions { prefix?: string; @@ -6,21 +6,18 @@ export interface ExampleComponentOptions { className?: string; } -export interface QuartzComponentProps { - ctx: { - cfg: { - configuration: Record; - }; - allFiles: string[]; +export type QuartzComponentProps = { + ctx: any; // eslint-disable-line @typescript-eslint/no-explicit-any + externalResources: any; // eslint-disable-line @typescript-eslint/no-explicit-any + fileData: any; // eslint-disable-line @typescript-eslint/no-explicit-any + cfg: any; // eslint-disable-line @typescript-eslint/no-explicit-any + children: any; // eslint-disable-line @typescript-eslint/no-explicit-any + tree: any; // eslint-disable-line @typescript-eslint/no-explicit-any + allFiles: any[]; // eslint-disable-line @typescript-eslint/no-explicit-any + displayClass?: "mobile-only" | "desktop-only"; +} & JSX.IntrinsicAttributes & { + [key: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any }; - fileData: { - slug?: string; - frontmatter?: { - title?: string; - description?: string; - }; - }; -} export interface QuartzComponent { (props: QuartzComponentProps): VNode; @@ -33,7 +30,7 @@ export const ExampleComponent = (opts?: ExampleComponentOptions) => { const { prefix = "", suffix = "", className = "example-component" } = opts ?? {}; const Component: QuartzComponent = (props: QuartzComponentProps) => { - const title = props.fileData.frontmatter?.title ?? "Untitled"; + const title = props.fileData?.frontmatter?.title ?? "Untitled"; const fullText = `${prefix}${title}${suffix}`; return
{fullText}
;