-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[7.31.4] no-unknown-property
throwing on valid props
#3384
Comments
Might be worth checking this: https://github.com/tcodes0/react-known-props cc @tcodes0 |
Same thing for |
I am also getting this error on
|
Also this should work, but complains that type Props = {
fill?: string
}
export const Example = ({
fill,
}: Props) => (
<svg fill={fill}>
</svg>
) |
I'm having the same problem with
See https://developer.mozilla.org/en-US/docs/Web/SVG/Element/rect?retiredLocale=de |
@diegohaz Please upgrade to v7.31.4. Are you still seeing these issues? @Meemaw @christian98 @Primajin @dermoumi a fix for these will be out later today. @peter-resmed custom attributes that don’t start with data- are invalid - is there an issue filed on emotion for this? |
no-unknown-property
throwing on valid propsno-unknown-property
throwing on valid props
Yes |
React does allow custom attributes without |
Also getting an issue with the |
I upgraded to 7.31.4 and I'm still seeing this with Good news is that 7.31.4 fixed all the other false positives. |
@ljharb @peter-resmed I opened a ticket in the emotion js repository: emotion-js/emotion#2878 also I confirm @guyellis message about |
7.31.4 "error: Invalid property 'fill' found on tag 'g', but it is only allowed on: svg react/no-unknown-property" |
It also fails when explicitly passing |
I also get |
I think #3385 now covers everything here except:
If there's anything I missed, please comment here while the issue remains open - or, file a new issue if this one is closed. v7.31.5 will be released shortly after CI passes. |
As above, I got three errors on div element, which should be supported by react. |
First of all a big thank you for the quick turn around ❤️ Regarding emotion css - I guess the cleanest way would be to feed an ignore pattern or list of things to ignore. |
Hello, I am using the latest version of eslint-plugin-react (^7.31.5), and that one is still to correct Cheers for the rapid fix :) |
Getting an unknown property "controls" error as well, on a video element |
(Like @diegohaz already said in the modified issue comment) The rule is already configurable with ...
"react/no-unknown-property": ['error', { ignore: ['css'] }]
... @ljharb I made a commit that adds this to the rule documentation in #3390 |
I'm getting the same error in v7.31.9 on iframe with the allowFullScreen attribute:
|
@AMI3GOLtd yes, that's fixed by #3455 in v7.31.10. Please file new issues in the future for these things. |
This requires ignoring a new rule added since the last version. More information at the following links: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md jsx-eslint/eslint-plugin-react#3384 (comment)
Related to #3380
I'm seeing the following errors in my project:
<details>
supportsonToggle
.<path>
supportsfill
.<link>
supportsas
.Edit: It looks like there are even more valid use cases that this rule is not covering. I'd suggest reverting the changes to the
no-unknown-property
rule for v7 and releasing it under a new major version. React Known Props can be used to get all the known props, and users can use theignore
option on the rule to add other props likecss
.The text was updated successfully, but these errors were encountered: