Open
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Problem
I want to have a system where the author can't render a React component in mdx with the wrong props.
Example
// Component.tsx
export const Component = ({ name, age }: { name: string, age: number }) => {
return ...
}
import { Component } from './Component'
## Component
<Component name="vb" age={35} /> // ✅
<Component name="vb" /> // ❌ Missing mandatory prop
<Component name={35} age={35} /> // ❌ Wrong type for name
Solution
I'd get an eslint error when I try to render a React component in mdx with bad props
Alternatives
I guess this is done together with plugin:@typescript-eslint?