question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Emit does not preserve empty lines

See original GitHub issue

Hi,

TS Version: 1.1

Given

function foo() {

    var x = 10;

    var y = 11;
}

We used to get

function foo() {
    var x = 10;

    var y = 11;
}

In the new compiler the line break is missing

function foo() {
    var x = 10;
    var y = 11;
}

(Both compilers removed the first empty line, but the new compiler has gone a step further.)

This can affect the experience when debugging JavaScript in the browser.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:67
  • Comments:41 (8 by maintainers)

github_iconTop GitHub Comments

45reactions
ppsimatikascommented, Sep 14, 2017

The crowd wants preserveWhitespace: true/false @ORESoftware ++

31reactions
ghostcommented, Apr 15, 2016

I would also like this for a similar reason as @timjmartel - when developers see the emitted JS looks nice they are less resistant to adopt. Preserving (at least vertical) whitespace makes the code look less like it was generated by a machine and more like idomatic JS code written by a human.

If our team ever decided to abandon TS and instead continue with the transpiled JS it would be much easier to adopt the emitted JS sources if they had human-friendly whitespace.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Removing all blank lines but not comments in Ruamel.yaml
The earlier versions of ruamel.yaml would not preserve empty lines, it is however relatively easy to get that behaviour back by stripping ...
Read more >
Issue 17113: argparse.RawDescriptionHelpFormatter should ...
A user could preserve blank lines by including a space (or more) in each. That is, instead of ending with '\n', end with...
Read more >
Possible to preserve empty lines (whitespace) on conversion ...
Is it possible to preserve blank lines between paragraphs when converting from markdown to docx? I'd rather have an actual blank line for...
Read more >
Angular compiler options
Set to true to preserve blank text nodes. skipMetadataEmit link. When true , does not produce .metadata.json files. Default is false .
Read more >
YAML Ain't Markup Language (YAML™) revision 1.2.2
There are no normative changes from the YAML specification v1.2. ... 2.15 Folded newlines are preserved for “more indented” and blank lines
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found