Skip to content

Always preserve new lines for array and object literals.#2517

Closed
CyrusNajmabadi wants to merge 1 commit into
masterfrom
preserveNewLines2
Closed

Always preserve new lines for array and object literals.#2517
CyrusNajmabadi wants to merge 1 commit into
masterfrom
preserveNewLines2

Conversation

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

Regardless of the value of 'preserveNewLines'.

Fixes: #2513

An alternative approach would be do just remove the preserveNewLines flag, and attempt to preserve in all the other places we handle this today. That would be my preference. You can see this alternate approach here: #2518

This produces output closer to the original code, and means that you don't get ugly code explosion when you write nice single-lined stuff like arrow functions, and in many cases, you don't have your complex multi-line code smushed up to a singline line.

Thoughts?

@JsonFreeman
Copy link
Copy Markdown
Contributor

I like #2518 better, but I will also sign off on this one.

@CyrusNajmabadi CyrusNajmabadi deleted the preserveNewLines2 branch March 29, 2015 06:40
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Single line preservation doesn't work for array and object literals

3 participants