Skip to content
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

Every file gets added a \n even when line endings are set to \r\n. #26

Closed
jvanoostveen opened this issue Oct 13, 2015 · 0 comments
Closed
Assignees

Comments

@jvanoostveen
Copy link

The problem seems to be in:

let formattedCode = formatter(fileName, content, formatOptions);
if ((<any>formattedCode).trimRight) {
    formattedCode = (<any>formattedCode).trimRight();
    formattedCode += formatOptions.NewLineCharacter;
}

( https://github.com/vvakame/typescript-formatter/blob/master/lib/index.ts#L110 )

When I change it to use formatOptions.NewLineCharacter, the tests fail as it looks like all expected results are in \n and not honouring the formatter settings (the json files) accompanying the test files.

I also notice some more replaces solely on \n. Are you internally converting everything to \n and when writing the result file convert it to the wanted line ending?

@jvanoostveen jvanoostveen changed the title Currently, every file gets added a \n even when line endings are set to \r\n. Every file gets added a \n even when line endings are set to \r\n. Oct 13, 2015
@vvakame vvakame self-assigned this Oct 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants