-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Compiler flag to specify line ending #1693
Comments
I don't know if you'd get different results if the line endings were the same - but you could also configure your editor's line ending options to make sure this is the case. |
I have configured the editor - but I think the difference is, that this is an external change to the files and the editor therefor isn't updating the line endings. The main problem is, when we're changing branches, and the .ts files are changed in the new branch. The TSC will se the .ts file change and recompile the file and thus overwriting the .js file (which was committed with unix style line endings) with windows style line endings. It marks as a change in PhpStorm. |
The line endings of the generated .js, .d.ts, and .sourcemap files are currently only dependent on the underlying system. so if you are running on windows you will always get /r/n if you are on macOS you would get /n. @fMads you want a new compiler flag to toggle line endings, correct? |
If this is a matter of checking out something with Unix line endings, have you tried setting your git repo's |
@fMads: any particular reason you're committing the generated js files? I feel like they should be left out of the repo, just like binaries. Not being snarky, just curious. |
@mhegazy Yes, a compiler flag would be great :) @DanielRosenwasser Yes - it only converts the file, when the repo is committed. That's a step to late. @LilRed You're proberbly right - that would be the best way to handle it. |
updating the title for the issue. @fMads, a PR would definitely be welcomed. The system now is wired to get the sys.newline, (see program.ts L72) the change would be to pass options.newLine instead. |
+1 for this feature of specifying a line ending. GIT doesn't have quite the right mix of options for dealing with cross-platform line endings and the best I've found on a mixed team that deploys to UNIX-style systems is to just force those common line endings everywhere. Yes, having JS files in version control may not be ideal but it's pragmatic. |
+1 for this feature of specifying a line ending. |
Thanks @kmashint! |
All generated js-files have windows-style line endings.
It would be great, if we could specify the line endings - windows, unix etc.
We use PhpStorm as editor, and it keeps marking generated js, d.ts etc files as changed, even though the code is the same. The only difference is \n -> \r\n.
Relates to https://typescript.codeplex.com/workitem/258
The text was updated successfully, but these errors were encountered: