You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include a space before the trailing / and > of empty elements, e.g. <br />, <hr /> and <img src="karen.jpg" alt="Karen" />. Also, use the minimized tag syntax for empty elements, e.g. <br />, as the alternative syntax <br></br> allowed by XML gives uncertain results in many existing user agents.
The text was updated successfully, but these errors were encountered:
It would be nice to have the option to either enforce the presence or absence of whitespace before the closing /> (whatever your team can agree on).
I'd be happy to add this the to the #144 pull request, if you need help, @no23reason (you'd have to generalize the rule to something like jsx-self-closing-consistent-whitespace and add an option to the rule, as well as some new tests).
@j13z Thank you for the comment, however I don't really see the point of purposefully omitting the space. I know it is not needed I just don't know anyone would use the space eliminating version. The W3C recommends the space, Prettier will add it in as well, etc.
@j13z if we decide we do want to add that option, it should fit consistently with the current rule name. (The rule controls the presence of the space before the closing of the tag, the name, to me, doesn't specifically need to mean that a space must be present)
Prefer
<MyComponent />
than<MyComponent/>
XHTML species:
The text was updated successfully, but these errors were encountered: