antfu / eslint-config

Anthony's ESLint config preset
https://eslint-config.antfu.me/
MIT License
3.72k stars 419 forks source link

format/prettier error on windows #398

Open Daydreamer-riri opened 7 months ago

Daydreamer-riri commented 7 months ago

Describe the bug

image

It's OK on Linux.

Reproduction

https://github.com/Daydreamer-riri/vite-react-ssg README file

System Info

windows 11

Used Package Manager

pnpm

Validations

antfu commented 4 months ago

I don't use Windows and couldn't test out - can you help verify if it's still an issue with the latest version?

Daydreamer-riri commented 4 months ago

I've just upgraded to the latest version, but the issue still persists.

https://github.com/antfu/eslint-config/assets/70067449/3c22bd12-28b3-409c-97b3-761cbf2abc98

Daydreamer-riri commented 4 months ago

This seems to be a problem with 'CRLF' when I switch 'CRLF' to 'LF' in vscode, the error disappears...

Daydreamer-riri commented 4 months ago

Hi @antfu , I made a minimum repo: https://github.com/daydreamer-riri/exlint-prettier-crf-error

https://github.com/antfu/eslint-config/assets/70067449/2508fb79-9eff-4791-9aa7-1e3763c0b7c2

This is a problem that may be upstream.

pauliesnug commented 1 month ago

This seems to be a problem with 'CRLF' when I switch 'CRLF' to 'LF' in vscode, the error disappears...

@Daydreamer-riri I think if you just set VSCode, Prettier options, and Gitattributes to use LF, the error won't exist. This is probably just a mismatch between ESLint rules' EOL and Prettier's EOL.