Skip to content

Commit

Permalink
Make Prettier preserve line ending type (#2244)
Browse files Browse the repository at this point in the history
Why? The default in Prettier 2.0 was
[changed](https://prettier.io/docs/en/options.html#end-of-line) from
`auto` to `LF`. This makes development on Windows awkward, because
every file is marked with changes both by Prettier and then by Git
regardless of repository line ending settings, making committing harder
than it should be.

---

Aside from that: I noticed that runnin pre-commit manually seems to add
line endings to symlink files, but they disappear when actually committing.
Don't know if that's a known.. quirk..(?) or not.

---

Commit history before merge:

* Make Prettier preserve line ending type
* Move options to .prettierrc
  • Loading branch information
felix-hilden authored May 17, 2021
1 parent b8450b9 commit 921c24a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ repos:
rev: v2.2.1
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
3 changes: 3 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
proseWrap: always
printWidth: 88
endOfLine: auto

0 comments on commit 921c24a

Please sign in to comment.