The Node.js® Website

chore: enable MDX type checking (#6368)

authored by Remco Haszing and committed by GitHub fe93dd66 ffee760d

+5
global.ts
··· 1 + import type { mdxComponents } from '@/next.mdx.use.mjs'; 2 + 3 + declare global { 4 + type MDXProvidedComponents = typeof mdxComponents; 5 + }
+1 -1
next.mdx.use.mjs
··· 32 32 /** 33 33 * A full list of React Components that we want to pass through to MDX 34 34 * 35 - * @type {import('mdx/types').MDXComponents} 35 + * @satisfies {import('mdx/types').MDXComponents} 36 36 */ 37 37 export const mdxComponents = { 38 38 // Legacy Component
+4
tsconfig.json
··· 18 18 "plugins": [{ "name": "next" }], 19 19 "baseUrl": "." 20 20 }, 21 + "mdx": { 22 + "checkMdx": true 23 + }, 21 24 "include": [ 22 25 "next-env.d.ts", 26 + "**/*.mdx", 23 27 "**/*.ts", 24 28 "**/*.tsx", 25 29 ".next/types/**/*.ts",