![mac end of line mac end of line](https://i2.wp.com/osxdaily.com/wp-content/uploads/2012/09/keystroke-to-speak-text.jpg)
editorconfig file in our code base as it requires every contributor to have a plugin in their editors. editorconfig – that's interesting! If so, I agree that the value for eol can be grabbed from it (it's called end_of_line there). I think it is bit difference issue and offer to touch her I did not know that Prettier reads stuff from. Anyway it is sound as breaking chage for CLI and we can do this only in 2.0. use **/* for prettier (he skips unknown extension, only fix CRLF/ CR/ LF), by the way it increases zero configuration, just add command prettier.gitignore, but perhaps there's scope for a null-plugin that would help prettier swallow those thinking cc solution would not cover unknown files like. Probably this is the case when a new option is justified.
MAC END OF LINE WINDOWS
There are some guys in our team works on windows and sometimes it is pain, sometimes CRLF falls into our code base (in some cases, I don’t even understand how this happens as we have linters everywhere and checks, seems somebody love push with -force and skip hooks). On the other hand it is prettier and i just want to run and forgot about spaces, newlines, and other stuff.
![mac end of line mac end of line](https://images.indianexpress.com/2022/03/apple-to-showcase-ext-display-high-end-mac-mini-featured.jpg)
Not sure, looks like a war LF vs CRLF and someone who want CR. Or maybe it's something that's needed often enough to become a part of Prettier core? sweat_smile Otherwise, it's a bit like if we had tabWith: "whateverTabWithIsFoundInTheGivenFile" with no option to enforce a specific value.
![mac end of line mac end of line](https://eclecticlightdotcom.files.wordpress.com/2018/01/macosserver02.png)
Given that Prettier does change line endings today already (by bringing all newlines to a single format in a given file), I still feel that it's reasonable to introduce an eol option to this tool. This would be fine if git's CRLF to LF mapping always worked perfectly on commits, but unfortunately this is not the case. Prettier's current choice for line endings resides on the presence of CRLF/LF after the first line in a given file. Without #472 merged, this hidden inconsistency in the formatting of the shared code would not be the case. I won't be surprised if the maintainers are assured that they've got LF everywhere.Įven Prettier's repo itself has got quite a few files with CRLF, and far not all of them have this on purpose to test Windows behaviour: Note that the files with CRLF are covered by their linting scripts or hooks, which involve Prettier. Just out of curiosity, I cloned a couple of public projects that use Prettier and noticed that even in those experienced communities people still end up with CRLFs in the committed code (likely contributed by Windows users who have issues with local git config). Fixing CRLFs with LFs for the whole repo in a separate PRs breaks git blame, yet does not prevent this from happening again. When this happens, things remain unnoticed for quite a while until something breaks (e.g. I do understand the benefits of resolving that issue for Windows users who have git config -global tocrlf true, but it does come at a cost of squeezing CRLFs into the central repo by accident. Interestingly, this eol: "lf", is exactly what prettier was doing before #92 (this proposal to keep CRLFs got rather controversial reactions, but still went through). The only thing that comes to my mind is to tweak our package.json somewhat like this: I know that new options are not welcomed in general, but I can't really see a good workaround. Prettier could really help us here if it had an option to enforce a certain flavour of line endings. Not setting git config -global tocrlf false moves the issue to another place: now a Windows user can check out the files in cmd.exe or SourceTree (LF → CRLF on checkout) and commit them via Ubuntu terminal (CRLF are preserved).
![mac end of line mac end of line](https://cdn.osxdaily.com/wp-content/uploads/2014/02/terminal-icon.png)
vscode/settings.json that includes "files.eol": "\n" (not everyone uses vscode)