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

[Bug]: no-unknown-property false-positive without data- prefix #3712

Closed
2 tasks done
silverwind opened this issue Mar 14, 2024 · 0 comments · Fixed by #3713
Closed
2 tasks done

[Bug]: no-unknown-property false-positive without data- prefix #3712

silverwind opened this issue Mar 14, 2024 · 0 comments · Fixed by #3713
Labels

Comments

@silverwind
Copy link
Contributor

silverwind commented Mar 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues and my issue is unique
  • My issue appears in the command-line and not only in the text editor

Description Overview

<Item dataKey="key"/>
react/no-unknown-property: [2, requireDataLowercase: true}]

Raises false positive:

React does not recognize data-* props with uppercase characters on a DOM element. Found 'dataKey', use 'datakey' instead

Expected Behavior

No error because dataKey doesn't start with data-. The rule docs specifically mentions that it's only checking data-* attributes, e.g. with the -.

eslint-plugin-react version

v7.34.0

eslint version

v8.57.0

node version

v21.7.1

@silverwind silverwind added the bug label Mar 14, 2024
@silverwind silverwind changed the title [Bug]: no-unknown-property false-positive with camel case [Bug]: no-unknown-property false-positive without data- prefix Mar 14, 2024
silverwind added a commit to silverwind/eslint-plugin-react that referenced this issue Mar 15, 2024
silverwind added a commit to silverwind/eslint-plugin-react that referenced this issue Mar 15, 2024
silverwind added a commit to silverwind/eslint-plugin-react that referenced this issue Mar 15, 2024
silverwind added a commit to silverwind/eslint-plugin-react that referenced this issue Mar 15, 2024
silverwind added a commit to silverwind/eslint-plugin-react that referenced this issue Mar 15, 2024
silverwind added a commit to silverwind/eslint-plugin-react that referenced this issue Mar 15, 2024
@ljharb ljharb closed this as completed in 69de42e Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant