-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
jsx-one-expression-per-line with CRLF on Windows #1893
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
Comments
I wouldn't expect anyone on any platform, including Windows, to use anything but normal LF, since CRLF breaks so many things. |
Well, Git expects you, by default (at least on Windows), to use CRLF. If you don't do it, it automatically changes it. Yes, I know you can change that and add a configuration. But why? VSCode does the same. He uses the Windows CRLF. Unless you want to change that in all your files in your project, I think the rule should detect this. |
Yes, you should be changing that in all files in all projects, and also using git config to ensure that you convert everything to LF on clone/commit/etc. (I also think the rule should detect it, however) |
Yes, I am not defending that what I am doing is the right or wrong thing to do. Just saying that are other possibilities. |
I have the same problem on Windows yet my EOL is set to LF. |
I'm running into this myself, so I thought I would chime in. The default and recommended setting when installing Git on Windows is Unless I'm missing something, in that configuration, you are indeed expected to have CRLF in your files when editing on Windows. |
@dominic-p the option you want to select is the second one, imo. |
@ljharb, that's understandable. I'm just pointing out that since it's the default and the Git recommendation, we're not talking about an edge case here. It might be worth supporting. Thanks, btw, for all the work you do on this config. It's super helpful. |
A PR that handles line endings regardless of LF or CLRF throughout the plugin would be appreciated. |
I can take a stab at it, but I've never worked with eslint code before. Any pointers on where to start? |
I'd start by writing the test cases :-) |
@luissmg is there any chance this is fixed in the latest version of the plugin? |
Closing, but will be happy to reopen if there's still something actionable. |
The rule always triggers, even when I have an expression per line, as the rule expects.
Then I realized that I am on Windows and the line break is done with a
\r\n
(CRLF). What I did was to change it to what Linux and OSX do and make the line breack as\n
(LF). The plugin then works as expected.Is it supposed to work only with that type of line break?
The text was updated successfully, but these errors were encountered: