Tiktok: Cygwin does funny stuff with line endings, skip to the bottom and add that to .prettierrc
My personal dev setup is as follows:
- Windows 11
- Sublime Text 4 with LSP
- Cygwin
Everything was fine, until I ran the eslint command in cygwin and was faced with this output for every file in my project:
1:57 error Delete `␍` prettier/prettier
2:64 error Delete `␍` prettier/prettier
3:52 error Delete `␍` prettier/prettier
4:61 error Delete `␍` prettier/prettier
5:1 error Delete `␍` prettier/prettier
6:59 error Delete `␍` prettier/prettier
7:44 error Delete `␍` prettier/prettier
8:41 error Delete `␍` prettier/prettier
9:19 error Delete `␍` prettier/prettier
10:2 error Delete `␍` prettier/prettier
11:1 error Delete `␍` prettier/prettier
12:41 error Delete `␍` prettier/prettier
13:45 error Delete `␍` prettier/prettier
14:10 error Delete `␍` prettier/prettier
15:30 error Delete `␍` prettier/prettier
16:14 error Delete `␍` prettier/prettier
17:19 error Delete `␍` prettier/prettier
18:3 error Delete `␍` prettier/prettier
19:2 error Delete `␍` prettier/prettier
The problem is that Cygwin sees line endings differently, and was trying to conform them to the default prettier endOfLine setting of ‘lf’
Personally I don’t care enough about this issue and solved it by specifying this in my .prettierrc:
{
"endOfLine": "auto"
}