-
Notifications
You must be signed in to change notification settings - Fork 455
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
correctly print exotic JSX names #6451
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! But I'm not very familiar with the parser/printer so someone else should take a look at it too. I'll request an additional review.
@@ -6,13 +6,17 @@ let x = <Foo.bar className="container" /> | |||
let x = <Foo.baz | |||
className="multiline" | |||
/> | |||
let x = <\"custom-tag" className="container" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note, but given that this looks like a close tag (but is not), are there other issues this could cause? How can we test those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes readability suffers a bit with this, maybe we could change the parser to make it accept exotic names inside double quotes without escaping them with a \
, like polymorphic variants, but this would be more work for something that is definitely a corner case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably will be easier to make <my-custom-tag className="hello" />
compile in the case
Looks good to me. |
@tsnobip can you add an entry to the changelog? Then we're good to go. |
before this fix,
would get reformatted to:
which doesn't compile.