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
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.
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.
Git is also configures to use unix-style, so it will be commited with unix style 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.
Mads Føhns (@fMads) you want a new compiler flag to toggle line endings, correct?
Mads Føhns (@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.
LilRed You're proberbly right - that would be the best way to handle it.
We just don't have any post-processing of our code at our live systems. We commit and push to remote repo, when we do an update to our clients.
We could of course change it, so we compile the code at post-receive - but it's just easier doing it on dev-system (Before pushing)
Mads Føhns (@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.
Activity
DanielRosenwasser commentedon Jan 16, 2015
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.
fMads commentedon Jan 16, 2015
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.
Git is also configures to use unix-style, so it will be commited with unix style 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.
mhegazy commentedon Jan 16, 2015
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.
Mads Føhns (@fMads) you want a new compiler flag to toggle line endings, correct?
DanielRosenwasser commentedon Jan 16, 2015
If this is a matter of checking out something with Unix line endings, have you tried setting your git repo's
autocrlfoption?carlpaten commentedon Jan 17, 2015
Mads Føhns (@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.
fMads commentedon Jan 19, 2015
Mohamed Hegazy (@mhegazy) Yes, a compiler flag would be great :)
Daniel Rosenwasser (@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.
We just don't have any post-processing of our code at our live systems. We commit and push to remote repo, when we do an update to our clients.
We could of course change it, so we compile the code at post-receive - but it's just easier doing it on dev-system (Before pushing)
[-]Specify line ending[/-][+]Compiler flag to specify line ending [/+]mhegazy commentedon Jan 19, 2015
updating the title for the issue.
Mads Føhns (@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.
kmashint commentedon Feb 10, 2015
+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.
hranicka commentedon Feb 18, 2015
+1 for this feature of specifying a line ending.
Compiler flag to specify line ending microsoft#1693
Compiler flag to specify line ending microsoft#1693 fix whitespace
Compiler flag to specify line ending microsoft#1693 code review adjus…
4 remaining items
Compiler flag to specify line ending microsoft#1693 unit test adjustm…
Compiler flag to specify line ending microsoft#1693 unit test adjustm…
Compiler flag to specify line ending microsoft#1693
Compiler flag to specify line ending microsoft#1693 fix whitespace
Compiler flag to specify line ending microsoft#1693 code review adjus…
Compiler flag to specify line ending microsoft#1693 code review adjus…
Compiler flag to specify line ending microsoft#1693 code review adjus…
Compiler flag to specify line ending microsoft#1693 unit tests
Compiler flag to specify line ending microsoft#1693 unit test adjustm…
Compiler flag to specify line ending microsoft#1693 unit test adjustm…
Compiler flag to specify line ending microsoft#1693 unit test adjustm…
mhegazy commentedon May 4, 2015
Thanks Keith Mashinter (@kmashint)!