-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Vertically align (indent) values in object literals #365
Comments
It's missing. You'd need to devise some way of counting the length of a key, storing it, then expanding every previous spacing when a later key lengthens... |
I see. But don't you parse the whole code tree first? Like that it's easy to get the longest key name ... |
No, in fact, we don't parse the whole tree first. See #200. sorry We do some post reformatting already for intelligent indenting, but this would be little harder. Possible future enhancement |
Alright, I understand. Peace out. |
This is getting closer to being possible. We actually do properly detect object blocks now. Still don't have a good way for re-spacing in side of a line. |
Will you do something with that topic? I can see that this issue is still exists almost 3 years now and my ticket was closed. I don't know if I should wait or try to rewrite it and send pull request of my solution. :) |
Pull requests are always welcome. |
Possible solution (unsure how Q&D attempt is going - I'll try it out later).
Alternative setting, following .eslintrc rules:
Based on whether Array, Object, or sequential Variable declarations, parse file as per usual with multiline for each of these flagged to do so. Parser stores type and line range.
This way 3 unique formatting methods can be applied in turn. Is it still shameless code borrowing if you reference the source? ^grin^ |
Would be nice to modify from
to
but cannot find such an option. Any clues? Or is this functionality missing?
The text was updated successfully, but these errors were encountered: