You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tsc compiler option for --newLine NEWLINE Use newline: 'CRLF' (dos) or 'LF' (unix). #2918
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.
As described in the above, make sure you follow the Coding Guidelines and in general try to stay canonical with our codebase.
In your PR body (not title), clearly specify what issue you're aiming to resolve/fix (i.e. Compiler flag to specify line ending #1693), and potentially link to this issue for reference as well.
For this feature specifically, ~2-3 tests for CRLF and LF line endings each might be decent. I'd put the tests in tests/cases/compiler and I'd name the tests something like newlineFlagWith[BlahBlah]CRLF.ts/newlineFlagWith[BlahBlah]LF.ts. For instance, one set of tests might be:
newLineFlagWithTemplateStringsCRLF.ts
newLineFlagWithTemplateStringsLF.ts.
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.
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
vi, vim: set ff=dos, set ff=unix
Eclipse: workspace line delimiter Windows or UNIX
Notepad++ (Win): EOL: UNIX Format, Windows Format, Mac Format (old CR-only)
WinMerge: carriage return differences (DOS/UNIX/MAC)
git: options refer to crlf, lf, cr combinations
changed the title [-]tsc compiler option for --newLine NEWLINE Use newline: 'dos' or 'unix'.[/-][+]tsc compiler option for --newLine NEWLINE Use newline: 'CRLF' (dos) or 'LF' (unix).[/+]on Apr 26, 2015
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.
Activity
DanielRosenwasser commentedon Apr 25, 2015
Hey Keith Mashinter (@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
tests/cases/compilerand I'd name the tests something likenewlineFlagWith[BlahBlah]CRLF.ts/newlineFlagWith[BlahBlah]LF.ts. For instance, one set of tests might be:newLineFlagWithTemplateStringsCRLF.tsnewLineFlagWithTemplateStringsLF.ts.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.
CyrusNajmabadi commentedon Apr 25, 2015
i don't really like 'dos' and 'unix' as the names. Why not just be explict with things like cr, crlf, and lf ?
DanielRosenwasser commentedon Apr 26, 2015
Agreed, use CRLF and LF as option names (don't include CR as an option).
nycdotnet commentedon Apr 26, 2015
The open issue that is marked as accepting Pull Requests is here: #1693
kmashint commentedon Apr 26, 2015
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
vi, vim: set ff=dos, set ff=unix
Eclipse: workspace line delimiter Windows or UNIX
Notepad++ (Win): EOL: UNIX Format, Windows Format, Mac Format (old CR-only)
WinMerge: carriage return differences (DOS/UNIX/MAC)
git: options refer to crlf, lf, cr combinations
[-]tsc compiler option for --newLine NEWLINE Use newline: 'dos' or 'unix'.[/-][+]tsc compiler option for --newLine NEWLINE Use newline: 'CRLF' (dos) or 'LF' (unix).[/+]CyrusNajmabadi commentedon Apr 27, 2015
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.
kmashint commentedon Apr 27, 2015
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".