Skip to content

Do not reformat the file if the newLineCharacter settings is not set #114

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

Closed
vegansk opened this issue Oct 26, 2017 · 1 comment
Closed

Comments

@vegansk
Copy link
Contributor

vegansk commented Oct 26, 2017

The problem is in the line

formattedCode = formattedCode.replace(/\r?\n/g, formatSettings.newLineCharacter || "\n");

The file is always reformatting, but what if we just want to preserve file endings? For example we have developers that works on Linux & Windows. And we are using the git setting git config core.autocrlf true. And the problem is that tsfmt --verify either fails on Windows, or fails on Linux.

vegansk added a commit to vegansk/typescript-formatter that referenced this issue Oct 26, 2017
@vvakame
Copy link
Owner

vvakame commented Oct 27, 2017

thanks!

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