Open a document that has just \n, we insert \r\n when we reformat.
Comments: I have bashed on this and it seems that c# has the same behavior. The information provided by the editor is incorrect and giving us '\r\n' as the line ending even for files with only '\n' You can try this out for both editors. Create a project, open a .cs/.js file in notepad++ and replace line endings using a quick regex. Do a format in c# and notice they also change out the file endings. The only real difference is we aren't changing them all out as we only replace whitespace where it seems 'necessary' Though, it seems python does not suffer from this issue.
Comments: I have bashed on this and it seems that c# has the same behavior. The information provided by the editor is incorrect and giving us '\r\n' as the line ending even for files with only '\n' You can try this out for both editors. Create a project, open a .cs/.js file in notepad++ and replace line endings using a quick regex. Do a format in c# and notice they also change out the file endings. The only real difference is we aren't changing them all out as we only replace whitespace where it seems 'necessary' Though, it seems python does not suffer from this issue.