Skip to content

"tsserver" emits files with different line endings than "tsc" (always CRLF) #13183

Description

@guncha

TypeScript Version: 2.1.4 / nightly (2.2.0-dev.20161227)

Code

tsconfig.json

{
  "compileOnSave": true
}

hello.ts

console.log("hello")
console.log("world")

commands.txt

{"command":"open","arguments":{"file":"/Users/gunca/Code/typescript-emit-line-endings/hello.ts"}}
{"command":"compileOnSaveEmitFile","arguments":{"file":"/Users/gunca/Code/typescript-emit-line-endings/hello.ts"}}
$ tsc
$ file hello.js
hello.js: ASCII text
$ cat commands.txt | tsserver 
Content-Length: 224

{"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/Users/gunca/Code/typescript-emit-line-endings/hello.ts","configFile":"/Users/gunca/Code/typescript-emit-line-endings/tsconfig.json","diagnostics":[]}}
Content-Length: 105

{"seq":0,"type":"response","command":"compileOnSaveEmitFile","request_seq":0,"success":true,"body":true}
$ file hello.js
hello.js: ASCII text, with CRLF line terminators

Expected behavior:
Expected tsserver to match host's line endings style.

Actual behavior:
Files are always emitted with CRLF endings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions