eslint-mdx
eslint-mdx copied to clipboard
Cannot use props as function-local variables
trafficstars
Initial checklist
- [x] I read the support docs
- [x] I read the contributing guide
- [x] I agree to follow the code of conduct
- [x] I searched issues and discussions and couldn’t find anything (or linked relevant results below)
Affected package
Steps to reproduce
Suppose you have some code like this:
### {props.foo}
{props.foo} is a foo.
### {props.bar}
{props.bar} is a bar.
Actual behavior
ESLint will throw the following errors:
1:6 error 'props' is not defined no-undef
3:2 error 'props' is not defined no-undef
5:6 error 'props' is not defined no-undef
7:2 error 'props' is not defined no-undef
Expected behavior
The code should compile just fine or there should be a way to let ESLint know that those are props
Note: I've asked this question here, and @remcohaszing suggested that this might be a bug.
Runtime
node v22.14.0
Package manager
bun
Operating system
Build and bundle tools
Docusaurus