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 gives false-positives on data-* attributes, but React gives warnings on them #3643
Comments
OK, so to clarify, even though browsers allow almost anything after Changing the sandbox to a few other react versions indicates this warning exists in at least React 16+ (changing it to v15 or lower got annoying, so i gave up). We'll need to add this as a new option to warn on. |
Do you think this should hide behind an option to |
Is there an existing issue for this?
Description Overview
There was an #3395 issue raised, which resulted in the rule being updated to support passing data-* attributes with any casing, but even the sandbox the reporter provided included a warning from react: "Warning: React does not recognize the
data-testID
prop on a DOM element.". This is still an issue right now with react 18, as seen in this sandbox.https://codesandbox.io/s/adoring-robinson-2z75gh
Expected Behavior
Expected behaviour: data-* attributes are reported, when they have any capital letters.
Actual behaviour: data-* attributes with uppercase letters are not reported by rule, react dumps warnings into console.
eslint-plugin-react version
v7.33.2
eslint version
v8.51.0
node version
v20
The text was updated successfully, but these errors were encountered: