digitalbazaar / eslint-config-digitalbazaar

BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Make linebreak-style platform specific #72

Closed BigBlueHat closed 11 months ago

BigBlueHat commented 11 months ago

Committed style should still be unix as git config core.autocrlf is best practice on Windows.

This makes a massive difference for developers using Windows (like myself). Without that being conditional, eslint is essentially unusable. I've been setting it manually, but that's adding undue tedium...and not fixing it for others in this situation, so hopefully this PR helps more that me. 😁

Cheers! 🎩

BigBlueHat commented 11 months ago

Am I just misreading this? And this is how we indicate we always want it to be unix-style?

You're not misreading things. 😃 It does make it editing environment dependent. Using it with git config core.autocrlf means, however, that git will (and does already) rewrite the Windows-only line endings into Unix-style endings at commit time--which it also already does for me.

Essentially, without this configuration, I get no value out of eslint because all it will ever report is that the line endings are wrong.

In so far as eslint is for the developer, this change should be fine. Should someone use this linting config and not use git config core.autocrlf and commit a PR with the wrong line endings, then the fix would be for them to set git config core.autocrlf properly and resubmit the PR.

If you want Unix line endings enforced with CI/CD, then this file is also fine (as changed) assuming you run the pipeline on a *nix box of some kind.

Does that clarify? 👓

davidlehn commented 11 months ago

I don't know what any of this means in practice. I'm not understanding why it's a problem to enforce unix newlines everywhere. I thought any modern windows editors and tools could handle that since they pretty much have to be able to. I'm skeptical that this sort of change won't cause some confusing havoc later. I've also not seen this sort of thing in wide use, which seems odd if it was critical for usability.

BigBlueHat commented 11 months ago

So. @davidlehn you're likely right. My local dev setup for git is likely antique and certainly predates the existence of VS Code, Windows Terminal, etc. I've done some digging and will attempt to switch approaches to sticking with lf line endings locally also.

If (for whatever reason) that fails, I may reopen this PR...but for now (and probably forever) this is closable.

Thanks, both! And sorry for the noise. 😉