Skip to content

Commit fe93dd6

Browse files
authored
chore: enable MDX type checking (#6368)
1 parent ffee760 commit fe93dd6

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

global.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type { mdxComponents } from '@/next.mdx.use.mjs';
2+
3+
declare global {
4+
type MDXProvidedComponents = typeof mdxComponents;
5+
}

next.mdx.use.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { ENABLE_WEBSITE_REDESIGN } from './next.constants.mjs';
3232
/**
3333
* A full list of React Components that we want to pass through to MDX
3434
*
35-
* @type {import('mdx/types').MDXComponents}
35+
* @satisfies {import('mdx/types').MDXComponents}
3636
*/
3737
export const mdxComponents = {
3838
// Legacy Component

tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
"plugins": [{ "name": "next" }],
1919
"baseUrl": "."
2020
},
21+
"mdx": {
22+
"checkMdx": true
23+
},
2124
"include": [
2225
"next-env.d.ts",
26+
"**/*.mdx",
2327
"**/*.ts",
2428
"**/*.tsx",
2529
".next/types/**/*.ts",

0 commit comments

Comments
 (0)