summaryrefslogtreecommitdiff
path: root/packages/integrations/markdoc/src/index.ts
diff options
context:
space:
mode:
authorGravatar Ben Holmes <hey@bholmes.dev> 2023-06-06 14:48:54 -0400
committerGravatar GitHub <noreply@github.com> 2023-06-06 14:48:54 -0400
commita11b62ee1f5d524b0ba942818525b623a6d6eb99 (patch)
treef1b010a172546f6f1180a1b8f89b4695fca8d4d7 /packages/integrations/markdoc/src/index.ts
parent8034edd9ecf805073395ba7f68f73cd5fc4d2c73 (diff)
downloadastro-a11b62ee1f5d524b0ba942818525b623a6d6eb99.tar.gz
astro-a11b62ee1f5d524b0ba942818525b623a6d6eb99.tar.zst
astro-a11b62ee1f5d524b0ba942818525b623a6d6eb99.zip
Fix: Markdoc type errors (#7311)
* fix: config, prism, shiki exports * fix: type error for `render` property * chore: use `.ts` files in select tests for type checks * fix: type error on shiki() promise * chore: changeset
Diffstat (limited to 'packages/integrations/markdoc/src/index.ts')
-rw-r--r--packages/integrations/markdoc/src/index.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/integrations/markdoc/src/index.ts b/packages/integrations/markdoc/src/index.ts
index c2d3e8734..781ae392e 100644
--- a/packages/integrations/markdoc/src/index.ts
+++ b/packages/integrations/markdoc/src/index.ts
@@ -1,5 +1,5 @@
/* eslint-disable no-console */
-import type { Node } from '@markdoc/markdoc';
+import type { Config as MarkdocConfig, Node } from '@markdoc/markdoc';
import Markdoc from '@markdoc/markdoc';
import type { AstroConfig, AstroIntegration, ContentEntryType, HookParameters } from 'astro';
import fs from 'node:fs';
@@ -85,7 +85,11 @@ export default function markdocIntegration(legacyConfig?: any): AstroIntegration
const filePath = fileURLToPath(fileUrl);
- const validationErrors = Markdoc.validate(ast, markdocConfig).filter((e) => {
+ const validationErrors = Markdoc.validate(
+ ast,
+ /* Raised generics issue with Markdoc core https://github.com/markdoc/markdoc/discussions/400 */
+ markdocConfig as MarkdocConfig
+ ).filter((e) => {
return (
// Ignore `variable-undefined` errors.
// Variables can be configured at runtime,