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

Add jsx-closing-bracket-atomic rule (Fixes #693) #706

Closed

Conversation

Jessidhia
Copy link
Contributor

Minimal working implementation. This is probably missing things :)

I also don't really like the error message, but I couldn't think of a better one.

// Constants
// ------------------------------------------------------------------------------

var MESSAGE = 'JSX tag closing has embedded whitespace';
Copy link
Member

@ljharb ljharb Jul 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about

Self-closing JSX elements must not have whitespace between the `/` and the `>`

and

JSX closing tags must not have whitespace between the `<`, the `/`, and the tag name.

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't check the position of the tag name here, only for the presence of /> and </.

Thinking about it, checking for the tag name sounds like a job for a possible "jsx-space-after-opening" rule...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case it'd be jsx-no-space-in-closing tho.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... conceptually, at least in my head, a rule that checks for </ foo> should also check for < foo> and < foo/>.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that's true. perhaps making this rule handle all of those would be helpful?

@Jessidhia
Copy link
Contributor Author

Closed in favour of #707.

@Jessidhia Jessidhia closed this Jul 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants