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/no-unknown-property throws on valid properties #3380

Closed
AhmadMayo opened this issue Sep 2, 2022 · 21 comments · Fixed by #3381
Closed

react/no-unknown-property throws on valid properties #3380

AhmadMayo opened this issue Sep 2, 2022 · 21 comments · Fixed by #3381
Labels

Comments

@AhmadMayo
Copy link
Contributor

I recently upgraded eslint-plugin-react from v7.30.1 to v7.31.2, and when I tried to build, the rule started throwing on valid properties like key, viewBox, fill, d, and other SVG related properties - and none of the in kebab case, or contains a colon in their name.

eslint version: 8.23.0
nextjs version: 12.2.5

image

@mjchang
Copy link

mjchang commented Sep 2, 2022

Also getting this for other svg properties as well

  • stroke
  • strokeWidth
  • strokeLinecap
  • strokeLinejoin
  • transform
  • clipRule
  • x1
  • x2
  • y1
  • y2

@AhmedBHameed

This comment was marked as spam.

@AhmadMayo

This comment was marked as spam.

@mjchang

This comment was marked as spam.

@peter-resmed
Copy link

image
same issue

@AhmedBHameed

This comment was marked as spam.

@AhmadMayo

This comment was marked as spam.

@AhmedBHameed

This comment was marked as spam.

@AhmadMayo

This comment was marked as spam.

@grybykm
Copy link

grybykm commented Sep 2, 2022

Downgrade to version 7.31.1. This is a breaking change and regression in version 7.31.2.

npm i eslint-plugin-react@7.31.1 -D

@ljharb
Copy link
Member

ljharb commented Sep 2, 2022

Thanks all; I'm on it and will release a v7.31.3 soon.

@grybykm It's not a "breaking change" if it's not intentional, it's just a bug. Dial it back.

@ljharb
Copy link
Member

ljharb commented Sep 2, 2022

cc @sjarva; seems #3377 has an issue. If you come up with a roll-forward fix before I get to the revert, I'd prefer to do that.

@ljharb ljharb added the bug label Sep 2, 2022
@apteryxxyz
Copy link

This also happens in meta tags with the property property, breaking usage of Open Graph.
(<meta property="og:type" content="website" />)

@AhmadMayo
Copy link
Contributor Author

@ljharb I think I can do it. Give me 30 mins

@ljharb
Copy link
Member

ljharb commented Sep 2, 2022

@AhmadMayo awesome, i've already got the test cases:

test cases

in "valid":

    { code: '<svg key="lock" viewBox="box" fill={10} d="d" stroke={1} strokeWidth={2} strokeLinecap={3} strokeLinejoin={4} transform="something" clipRule="else" x1={5} x2="6" y1="7" y2="8"></svg>' },
    { code: '<meta property="og:type" content="website" />' },

if you can make modifications to the existing rule to allow these valid properties that'd be awesome :-)

@ljharb
Copy link
Member

ljharb commented Sep 2, 2022

@AhmadMayo any update?

@AhmadMayo
Copy link
Contributor Author

@ljharb added the properties and testing now

@AhmadMayo
Copy link
Contributor Author

@ljharb PR ready

@sibartlett
Copy link

I get Unknown property 'key' found on other elements other than <svg>, such as <a> and <span>

@ljharb
Copy link
Member

ljharb commented Sep 3, 2022

v7.31.1 has been set to "latest" for now, and v7.31.3 will be released within the next hour.

After it's released, and this is closed, please file new issues if you continue to see issues with v7.31.3. Thanks everyone, and sorry for the inconvenience!

@ljharb ljharb closed this as completed in 22cedd8 Sep 3, 2022
@ljharb
Copy link
Member

ljharb commented Sep 3, 2022

v7.31.3 is now released.

Please update, and file a new issue if you're still seeing problems.

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.

8 participants