浏览代码

types ignore

Alexandru Cambose 3 周之前
父节点
当前提交
d9dceccb2a

+ 4 - 2
apps/developer-hub/src/components/Pages/BasePage/index.tsx

@@ -12,10 +12,12 @@ import { getMDXComponents } from "../../../mdx-components";
 export function BasePage(props: { params: { slug: string[] } }) {
   const page = source.getPage(props.params.slug);
   if (!page) notFound();
-
+  // @ts-expect-error - body is a property of PageData, but not defined in the types
+  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
   const MDX = page.data.body;
-
   return (
+    // @ts-expect-error - toc and full are properties of PageData, but not defined in the types so we need to cast to any
+    // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
     <DocsPage toc={page.data.toc} full={page.data.full}>
       <DocsTitle>{page.data.title}</DocsTitle>
       <DocsDescription>{page.data.description}</DocsDescription>

+ 1 - 1
apps/developer-hub/src/lib/get-llm-text.ts

@@ -17,7 +17,7 @@ export async function getLLMText(page: InferPageType<typeof source>) {
   });
 
   // note: it doesn't escape frontmatter, it's up to you.
-  return `# ${page.data.title}
+  return `# ${page.data.title ?? ""}
 URL: ${page.url}
 
 ${String(processed.value)}`;

+ 1 - 1
apps/developer-hub/src/lib/source.ts

@@ -57,7 +57,7 @@ export const source = loader({
   source: docs.toFumadocsSource(),
   pageTree: {
     // types are very similar but not exactly the same
-    // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
+    // @ts-expect-error - some weird type issues
     transformers: [openapiPlugin()],
   },
 });