Compiler flag to specify line ending#2921
Conversation
|
Hi @kmashint, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
src/compiler/diagnosticMessages.json
Outdated
There was a problem hiding this comment.
'--newLine' in single quotes.
|
Adjusted for comments thus far. I'll look into test cases tomorrow. |
src/compiler/program.ts
Outdated
There was a problem hiding this comment.
formatting, and use const.
|
Thanks @kmashint for the change. We will need a test for the new flag. to add a test,
|
|
I found and started to make the harness.ts adjustments; the runtests is taking forever so I'll check in the morning. |
Yeah, there's been some perf drop in recent versions of Node that will make it...worse. I've been on 0.10.33. I've recently been working to parallelize the tests. |
|
Stalled this week catching up on paid work ... should have some time on the weekend to work on unit tests. |
|
I thought I had this working locally, but I'll try to find other examples of an expected failure in unit test cases.
|
src/harness/harness.ts
Outdated
|
I've introduced a @ normalizenewline option to work as the old one did in contextualTyping.js. I'll adjust for merge conflicts tomorrow. |
|
OK, I've rebased my changes on top of microsoft/TypeScript. I tried using @ newline for both the new arguments and the old usage in contextualTyping.js but there were side-effects since the old usage affects not only the JS file but other debugging output files so I adjusted contextualTyping.js to use @ normalizenewline and all tests pass without further special treatment. |
|
Thanks @kmashint! |
|
Happy to contribute in a small way, I hope others find it useful as well. |
This is a first pass, unit tests still TODO, of adding a compiler flag to specify the line ending:
#1693
--newLine NEWLINE Emit newline: 'CRLF' (dos) or 'LF' (unix).
I'll next add unit tests as noted in this follow-up issue but please note any comments on code thus far:
#2918
i've signed the contributor agreement.