-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Allow empty/blank lines in object initializers #1110
Comments
I don't see a good reason to not allow it, it does keep things consistent with other places that allow new lines. Your example was for an anonymous object, which is a different node than a regular object initializer. But I made changes to allow it in either place + other types of initializers (dictionaries, arrays, etc). |
I take that last part back. Dictionaries and arrays are a bit trickier. This will just be for objects (anonymous or not) for now. |
Great, thanks! And as you pointed out it would be nice with same behaviour in dictionaries and arrays too. A small possibly related issue with object initializers that I don't really care about that maybe you'd like you know of: When formatting this (in 0.26.7):
You get this:
Would prefer/expect:
Or at least that empty lines after comments are treated the same as before. |
The empty lines sticking around after a comment is a known issue I have somewhere in the backlog. I believe it happens with comments anywhere. No one has complained so it hasn't been prioritized yet. Thanks for letting me know! |
In larger object initializers it is helpful to group properties into logical groups/blocks separated by an empty line and/or a blank line followed by a comment.
Input:
Output:
Expected behavior:
Allow single empty lines in object initializers: between initialized properties and/or comments.
This would be consequent with how blank lines are allowed between lines of regular code and/or comments.
Does this seem like an acceptable change to you?
The text was updated successfully, but these errors were encountered: