Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react/jsx-no-undef consistency #3319

Closed
passariello opened this issue May 16, 2024 · 4 comments · Fixed by #3331
Closed

react/jsx-no-undef consistency #3319

passariello opened this issue May 16, 2024 · 4 comments · Fixed by #3331
Assignees
Labels
A-linter Area - Linter C-bug Category - Bug P-high Priority - High

Comments

@passariello
Copy link

Hello, recently I move from ESlint to OXC. I figured out an issue about "react/jsx-no-undef" that not record the "0" or "off" or false
I need to stop the warning.

I have a global function (please, don't ask...) and previously works fine.... also "elem"
In substance any globals created into the project going to give me a warning is used as components.

Error:
"eslint-plugin-react(jsx-no-undef): Disallow undeclared variables in JSX
help: 'dispatch' is not defined. oxc"

I try to fix via the .d.ts but not lucky here!

Many thanks.
Dario Passariello

image

@passariello passariello added the C-bug Category - Bug label May 16, 2024
@passariello
Copy link
Author

I try also to use https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md to define the eslintrc.json but nothing.

@Boshen
Copy link
Member

Boshen commented May 17, 2024

Thank you for the feedback, I'll update the rule with these options. https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md#rule-options

@Boshen Boshen added P-high Priority - High A-linter Area - Linter labels May 17, 2024
@passariello
Copy link
Author

Many thanks, I really like the project and simplify alot of things! Thanks.

@Boshen
Copy link
Member

Boshen commented May 17, 2024

In the next version:

In your eslintrc.json:

{
  "globals": {
    "dispatcher": "readonly"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-bug Category - Bug P-high Priority - High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants