-
Notifications
You must be signed in to change notification settings - Fork 13k
Description
Search Terms
- .mdx
- mdx
- mdx support
Suggestion
Could or would it be on the road map to allow type checking in non .ts files. In my case i'm specifically wondering if TypeScript can type check React components in .mdx files
Use Cases
I've written a gatsby plugin gatsby-mdx-embed that allows users to embed media content from YouTube, Twitter, Instagram etc in their .mdx files.
The plugin is written in TypeScript and all of the components have props. It would be sweet if when these components are used in .mdx files a user could either see the prop types by hovering over the component or more importantly would get a type error (squiggly line) in their code editor if the prop name is incorrect or of incorrect type.
Examples
Here's an example .mdx file
You can below there the Gist component accepts a gistLink
prop of type string.
<Playground>
<Gist gistLink="PaulieScanlon/ca0cc9239176066492cb2aba435edbf7" />
</Playground>
If a user misspelled gistLink
or provided a number / array or object etc the editor would alert them there's been an error in the prop type used.