Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Line Endings on Windows affect range/loc start and end CRLF/LF #93

Closed
dannyfritz opened this issue Sep 17, 2016 · 5 comments
Closed

Line Endings on Windows affect range/loc start and end CRLF/LF #93

dannyfritz opened this issue Sep 17, 2016 · 5 comments

Comments

@dannyfritz
Copy link
Contributor

dannyfritz commented Sep 17, 2016

What OS are you using?
Windows 10

What version of TypeScript are you using?
1.8.0

What version of typescript-eslint-parser are you using?
0.3.0

What code were you trying to parse?
npm test

What did you expect to happen?
Tests to pass.

What happened?
All tests with more than 1 line of code failed because \r\n is longer than \n.

Possible Fix
Add a .gitattributes file that specifies that all OS'es should pull down files as lf and not auto or crlf. (confirmed fix for running tests).

It is also possible this is a bug specific to Windows environments that needs to be addressed.

@JamesHenry
Copy link
Member

JamesHenry commented Sep 17, 2016

I have no access to a windows machine to verify this, unfortunately.

The tests setup was initially configured based on how things are done in other ESLint projects, so I am surprised that this is an issue / has not already been handled.

@nzakas is this something you have come across before in other projects?

@dannyfritz
Copy link
Contributor Author

This is what my .gitattributes file looks like:

* text=auto
*.js eol=lf
*.ts eol=lf

@nzakas
Copy link
Member

nzakas commented Sep 19, 2016

I'm on windows, but I've had my Git setup to always checkout and commit using lf, which is probably why I haven't seen an issue. I'm 👍 on adding a .gitattributes if this will solve the problems for everyone.

@JamesHenry
Copy link
Member

Sounds good to me! Are you happy to take that @dannyfritz?

@dannyfritz
Copy link
Contributor Author

That works for me. I'll try to get it in tomorrow morning.

dannyfritz added a commit to dannyfritz/typescript-eslint-parser that referenced this issue Sep 21, 2016
@nzakas nzakas closed this as completed in 68992eb Sep 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants