Skip to content

Use pre-existing line endings in tsconfig.json #224

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

Closed
msssk opened this issue Apr 1, 2015 · 3 comments
Closed

Use pre-existing line endings in tsconfig.json #224

msssk opened this issue Apr 1, 2015 · 3 comments

Comments

@msssk
Copy link

msssk commented Apr 1, 2015

Commit 075ebfa introduced the behavior of using the OS default for line endings in tsconfig.json. This is undesirable behavior for people who use a line ending different from the OS default. Until Atom supports configurable line endings, atom-typescript should read the line endings from the existing tsconfig.json file and use those.

@yoav-zibin
Copy link

Any updates on this?
I need to be able to use both atom-typescript and tsc (the regular compiler),
and I can't get them to produce the same results because of the line ending difference :)
I wish to have just newlines:
"newLineCharacter": "\n",
but if I look at the output I see atom-typescript adds "^M" :
var langCodeToName = {};^M

@yoav-zibin
Copy link

I think newLineCharacter was the old way of setting it in the formatCodeOptions

"formatCodeOptions": {
    "newLineCharacter": "\r\n", 

I tried newLine compiler option:
"compilerOptions": {
"newLine": "CRLF"

http://json.schemastore.org/tsconfig
"newLine": {
"description": "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix).",
"enum": [ "CRLF", "LF" ]
},

https://github.com/Microsoft/TypeScript/wiki/Compiler-Options
--newLine Use the specified end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."

But it doesn't work for me even with "tsc" so I opened:
microsoft/TypeScript#5968

Nothing I do can make tsc and atom-typescript produce the same line endings...
Any ideas?

@yoav-zibin
Copy link

Ok, solved it by upgrading my tsc compiler to latest version, and now newLine: CRLF works,
and the two compilers produce the same output (they still have some minor discrepancies, but nothing some typecasts can't fix).
Still would be nice to support newLine in atom-typescript :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants