From 921c24af8032416101f532e148e6a382d28e28c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20Hild=C3=A9n?= Date: Mon, 17 May 2021 21:38:43 +0300 Subject: [PATCH] Make Prettier preserve line ending type (#2244) 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 --- .pre-commit-config.yaml | 1 - .prettierrc.yaml | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .prettierrc.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e461aa3..2527c4d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,4 +28,3 @@ repos: rev: v2.2.1 hooks: - id: prettier - args: [--prose-wrap=always, --print-width=88] diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000..beda5ba --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,3 @@ +proseWrap: always +printWidth: 88 +endOfLine: auto -- 2.39.5