You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Foo barBaz() => new Quux({
'alpha.beta.gamma': [
new Zuul({'yarrr': Abracadabra.OPEN_SESAME,}, {
'toil': {'trouble': {'fireBurn': {'cauldronBubble': EYE_OF_NEWT,}}}
})
]
});
The nested structure is much more difficult to discern in the result.
Yes, the original probably does not have style-guide compliant indentation, but indentation correction should not be removing so much visual structure from the code.
The text was updated successfully, but these errors were encountered:
Hmm, I agree the result is hard to read. But I'm not sure what the rule should be here. If a nested collection does all fit on one line, when do you think the formatter should decide to expand it anyway?
I personally would advocate for only compressing the single leaf-node collections (that is, collections that do not themselves contain another collection). Nested collections seem to most of the time exist because they represent some sort of structure to the data. Flattening it hides the captured structure.
dartfmt collapsed this:
into the very-compacted:
The nested structure is much more difficult to discern in the result.
Yes, the original probably does not have style-guide compliant indentation, but indentation correction should not be removing so much visual structure from the code.
The text was updated successfully, but these errors were encountered: