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

Considering enabling react/no-unknown-property #52

Closed
raunofreiberg opened this issue Oct 18, 2022 · 7 comments
Closed

Considering enabling react/no-unknown-property #52

raunofreiberg opened this issue Oct 18, 2022 · 7 comments
Labels
enhancement New feature or request eslint
Milestone

Comments

@raunofreiberg
Copy link
Member

raunofreiberg commented Oct 18, 2022

Today, when copying SVG elements from Figma to React, many of the properties will be in snake case (stroke-width) but in React we need them to be camel case (strokeWidth)

Right now, there's no way to autofix those errors so a lot of time is spent on manually find and replacing on each SVG copied over. I've previously enabled react/no-unknown-property which will auto-fix the SVG errors:

CleanShot 2022-10-18 at 15 49 32

Thanks!

@raunofreiberg
Copy link
Member Author

It's very easy to dismiss these and end up with a console full of errors:

image

@adrianbw
Copy link

I'd be strongly in favor.

@mrmckeb mrmckeb added enhancement New feature or request eslint labels Oct 21, 2022
@mrmckeb
Copy link
Contributor

mrmckeb commented Oct 21, 2022

We initially didn't turn this on as we preference TypeScript, and obviously this should be flagged in TypeScript as invalid - but we didn't consider the auto-fix aspect, which is really great.

@raunofreiberg
Copy link
Member Author

Hi hi! Checking in to see if there's any movement or further consideration for this? Really missing this every day!

@mrmckeb
Copy link
Contributor

mrmckeb commented Nov 30, 2022

We definitely plan to enable this, but it'll be a breaking change (a change to a default) so we were hoping to group it with some other items.

I was hoping to group it with #54 which is apparently close to shipping.

@raunofreiberg
Copy link
Member Author

Hi! I'm still very bogged down by converting casing. I bet I'm not alone here, getting this in would be a tiny but mighty DX win across the Engineering org.

@mrmckeb mrmckeb added this to the v5 milestone Jul 12, 2023
mrmckeb added a commit that referenced this issue Aug 29, 2023
Resolves #52

BREAKING CHANGE: `react/no-unknown-property` has been enabled as it provides a useful auto-fix for
SVG properties.
mrmckeb added a commit that referenced this issue Aug 29, 2023
Resolves #52

BREAKING CHANGE: `react/no-unknown-property` has been enabled as it provides a useful auto-fix for
SVG properties.
mrmckeb added a commit that referenced this issue Aug 29, 2023
Resolves #52

BREAKING CHANGE: `react/no-unknown-property` has been enabled as it provides a useful auto-fix for
SVG properties.
@mrmckeb
Copy link
Contributor

mrmckeb commented Aug 29, 2023

🎉 This PR is included in version 5.0.0 🎉

The release is available on:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request eslint
Projects
None yet
Development

No branches or pull requests

3 participants