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

JSX +- toggles like LiveScript object literals #135

Merged
merged 1 commit into from
Jan 7, 2023
Merged

JSX +- toggles like LiveScript object literals #135

merged 1 commit into from
Jan 7, 2023

Conversation

edemaine
Copy link
Collaborator

@edemaine edemaine commented Jan 6, 2023

Inspired by facebook/jsx#134 but with both a true and false version matching LiveScript

@STRd6
Copy link
Contributor

STRd6 commented Jan 6, 2023

We might want to add ! as a synonym for - in both JSX and object literal contexts.

@edemaine
Copy link
Collaborator Author

edemaine commented Jan 6, 2023

I did notice an issue with + and -: because - is a valid part of an identifier, you can't write +foo-bar (it's treated as a single +). Still, I like the symmetry of + and -... Should we leave the possibility of ! for a future PR?

@STRd6
Copy link
Contributor

STRd6 commented Jan 7, 2023

I think it is correct that +foo-bar is a single attribute. The correct way for someone to work around it would be to add a space. We already have several other places where whitespace around operators is significant.

@STRd6 STRd6 merged commit 5d81e00 into master Jan 7, 2023
@edemaine edemaine deleted the jsx-bool branch January 8, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants