-
-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
help wanted 🙏This could use your insight or helpThis could use your insight or help☂️ area/typesThis affects typingsThis affects typings👍 phase/yesPost is accepted and can be worked onPost is accepted and can be worked on🦋 type/enhancementThis is great to haveThis is great to have
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?
mattwagl, karlhorky, tihuan and PaulRBerg
Metadata
Metadata
Assignees
Labels
help wanted 🙏This could use your insight or helpThis could use your insight or help☂️ area/typesThis affects typingsThis affects typings👍 phase/yesPost is accepted and can be worked onPost is accepted and can be worked on🦋 type/enhancementThis is great to haveThis is great to have