Skip to content

Cannot use props as function-local variables #574

@PaulRBerg

Description

@PaulRBerg

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

Metadata

Metadata

Assignees

Labels

good first issue 👋This may be a great place to get started!help wanted 🙏This could use your insight or help🐛 type/bugThis is a problem👍 phase/yesPost is accepted and can be worked on🙆 yes/confirmedThis is confirmed and ready to be worked on

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions