-
-
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
Spaces get condensed by --fix when they are alone in a <span> #1717
Comments
Ouch, that’s a problem. The bug is with curly brace presence (they are necessary around whitespace) and maybe also with self-closing-comp (inline elements with a space inside aren’t necessarily empty). These need to be fixed soon. |
It looks like The So fixing |
We still should fix react-self-closing-comp to not treat inline HTML elements as empty when they contain whitespace (it should autofix them to a single space, perhaps) |
We often need to add spacing between two elements in JSX. For example:
Applying
--fix
turns the code into this:which is not the same thing.
I think I've traced down what's happening. The code above gives off this error:
Which, when corrected (by removing the curly braces and quotes), gives off another error:
which
--fix
happily turns into the<span />
above.Versions:
eslint@4.18.2
eslint-plugin-react@7.7.0
The text was updated successfully, but these errors were encountered: