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

Rule proposal: forbid superfluous enclosing spaces in same-line jsx components #191

Open
giogonzo opened this issue Aug 17, 2015 · 5 comments

Comments

@giogonzo
Copy link

This would produce a warning:

<span> { tab.title } </span>

as it produces 3 <span> DOM nodes (typically not wanted)

This wouldn't:

<span>{ tab.title }</span>
@lencioni
Copy link
Collaborator

This might be less of an issue with React 15, which claims to produce fewer spans.

@DianaSuvorova
Copy link
Contributor

DianaSuvorova commented Aug 18, 2017

Oh, I like this proposal. @ljharb this doesn't seem like it has been implemented yet. How about new [jsx-content-spacing]?

@ljharb
Copy link
Member

ljharb commented Aug 19, 2017

Sure, sounds good.

@whymarrh
Copy link

It looks like newer versions of React take care of this, throwing away the extra whitespace.

That said, this would be a useful rule to have if only to enforce consistency—is a PR for this something y'all would consider?

@ljharb
Copy link
Member

ljharb commented Jan 13, 2021

Yes, i still think this would be a good rule (especially if it autofixed)for consistency’s sake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants