-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
tsc compiler option for --newLine NEWLINE Use newline: 'CRLF' (dos) or 'LF' (unix). #2918
Comments
Hey @kmashint, thanks for checking in with us. Here's some steps you might want to check:
For this feature specifically, ~2-3 tests for CRLF and LF line endings each might be decent. I'd put the tests in
In general, if there's an existing issue and the reception looks positive (or you just want to show a proof-of-concept and don't mind if it doesn't get pulled in), you can send out a PR. We'll try to give feedback on it and work with you. |
i don't really like 'dos' and 'unix' as the names. Why not just be explict with things like cr, crlf, and lf ? |
Agreed, use CRLF and LF as option names (don't include CR as an option). |
The open issue that is marked as accepting Pull Requests is here: #1693 |
Thanks, I took a survey and git is the only tool that refers to crlf and lf combinations. I'll change to use --newLine CRLF (or LF, lower-case also acceptable) although git is far from the best example of command-line options (what's the opposite of push? fetch, not pull... hmm...) UNIX tools: dos2unix, unix2dos |
Git is nice, modern, and precise. For example, say that Windows moves to LF at some point. Now 'Windows' or 'Dos' is a complete misnomer. This is not speculative, look at how this happened with Apple. It used to be CR only for them, but then they moved to LF. CRLF and LF is precise and indicate exactly what you'll be getting. |
I hear you on git, but somewhere they lost track of the first part of the adage to "keep simple things simple and the complex possible". |
I have an patch to TypeScript compiler options to solve issues with different newlines as in this item:
https://typescript.codeplex.com/workitem/258
It adds this option to tsc, and uses it in program.ts / createCompilerHost() / getNewline():
--newLine NEWLINE Use newline: 'dos' or 'unix'.
I've signed the Contributor License Agreement (CLA) and I'm working on test cases but what is the next step to be allowed to push a branch and/or create a pull request?
Thanks to all for TypeScript, and I hoping to eliminate the newline conflicts at the source for mixed development environments of Mac, Linux/UNIX, Windows.
The text was updated successfully, but these errors were encountered: