eslint-mdx icon indicating copy to clipboard operation
eslint-mdx copied to clipboard

Cannot use props as function-local variables

Open PaulRBerg opened this issue 6 months ago • 3 comments
trafficstars

Initial checklist

Affected package

[email protected]

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

[email protected]

Build and bundle tools

Docusaurus

PaulRBerg avatar Apr 28 '25 08:04 PaulRBerg