eslint-plugin-react
eslint-plugin-react copied to clipboard
Detect line breaks in different OS
Check the following issue for reference. #1893
Hi. Adding the tests right now. Do you want me to add tests for every case that exists right now but just change the line break? Asking because there are already 800 lines of tests for this rule.
@luissmg we definitely don't need that many tests :-) one or two should probably suffice.
I thought just the same but wanted to confirm first :)
@ljharb Sorry for taking so long on this. Added the tests!
@luissmg altho it seems like the tests are failing
@ljharb I was checking and this test that I added is exactly the same as the one above that is passing, excepting for the type of line break.
Shouldn't it pass too or am I missing something?
Edit: the other test with \r is passing!
I suspect the failing test ends up with a mix of \r\n and \n, which seems like a problem. Perhaps the autofixer should detect the linebreak type most commonly used in the file, or in the node it’s looking at, and use that instead of always outputting a LF?
Hi. Would love to see this get merged :smile: Currently making me sad about my Windows machine!
It needs a rebase and fixed tests.
@ljharb @grahammcculloch Doing that this weekend!
@luissmg any news? :)
Hi guys. I will try to fix this in this weekend. Sorry for not replying any sooner.
@luissmg are you still interested in completing this PR?
Hi @ljharb! Sorry for letting this here in the air. I will try to push something this week. Will apply the suggestion from @sindresorhus and check if the tests are ok
Hey @ljharb, how are you? I took a look into this today. can you check if it is okay?
@luissmg unfortunately the tests don't fail, when your fix is removed.
@ljharb Hmmmm you are right... Could be that this problem is not a problem anymore?
It's entirely possible!