-
Notifications
You must be signed in to change notification settings - Fork 48.5k
A snippet that doesn't compile down to pretty jsx #239
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
Comments
Yea, this is pretty awkward. Since we do pretty dumb string transforms and preserve line numbers, it's not going to be pretty. My long term goal is to get to AST->AST transforms with sourcemaps and pretty code generation with something like escodegen. We could at least do better with comma style in the short term. |
I made some changes a while back so now you get:
|
If somebody wants to tackle the comma part of this, then go for it but otherwise, let's close it out. |
Remove Agent addBridge: there can only be one bridge, add in constructor
Currently jsx transforms this (with the indentation):
into this:
Which fails to pass jshint because of the indentation (the temporary solution is to put
{''}
before and after the bad line). It gets worse if you prefer the style of putting the>
on a new line, it becomes:Which fails two additional tests, the comma style (that can be disabled with
laxcomma
and bad line breaking (not sure if it can be disabled).The text was updated successfully, but these errors were encountered: