eslint-plugin-react icon indicating copy to clipboard operation
eslint-plugin-react copied to clipboard

Detect line breaks in different OS

Open luissmg opened this issue 7 years ago • 18 comments

Check the following issue for reference. #1893

luissmg avatar Jul 23 '18 09:07 luissmg

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 avatar Aug 03 '18 09:08 luissmg

@luissmg we definitely don't need that many tests :-) one or two should probably suffice.

ljharb avatar Aug 03 '18 21:08 ljharb

I thought just the same but wanted to confirm first :)

luissmg avatar Aug 03 '18 21:08 luissmg

@ljharb Sorry for taking so long on this. Added the tests!

luissmg avatar Aug 06 '18 12:08 luissmg

@luissmg altho it seems like the tests are failing

ljharb avatar Aug 07 '18 00:08 ljharb

@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!

luissmg avatar Aug 07 '18 09:08 luissmg

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?

ljharb avatar Aug 07 '18 15:08 ljharb

Hi. Would love to see this get merged :smile: Currently making me sad about my Windows machine!

grahammcculloch avatar Sep 14 '18 02:09 grahammcculloch

It needs a rebase and fixed tests.

ljharb avatar Sep 14 '18 07:09 ljharb

@ljharb @grahammcculloch Doing that this weekend!

luissmg avatar Sep 14 '18 13:09 luissmg

@luissmg any news? :)

evertonfraga avatar Dec 07 '18 00:12 evertonfraga

Hi guys. I will try to fix this in this weekend. Sorry for not replying any sooner.

luissmg avatar Dec 27 '18 16:12 luissmg

@luissmg are you still interested in completing this PR?

ljharb avatar Aug 09 '21 21:08 ljharb

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

luissmg avatar Aug 10 '21 09:08 luissmg

Hey @ljharb, how are you? I took a look into this today. can you check if it is okay?

luissmg avatar Aug 16 '21 13:08 luissmg

@luissmg unfortunately the tests don't fail, when your fix is removed.

ljharb avatar Aug 16 '21 22:08 ljharb

@ljharb Hmmmm you are right... Could be that this problem is not a problem anymore?

luissmg avatar Aug 17 '21 08:08 luissmg

It's entirely possible!

ljharb avatar Aug 20 '21 05:08 ljharb