Tag Archives: Vue prettier error

[Solved] Vue prettier error: error Delete `␍` prettier/prettier

The console error message is as follows

F:\aaaaa\dice-front\store\tag.js
  1:30  error  Delete `␍`  prettier/prettier
  2:11  error  Delete `␍`  prettier/prettier
  3:3   error  Delete `␍`  prettier/prettier
  4:1   error  Delete `␍`  prettier/prettier
  5:27  error  Delete `␍`  prettier/prettier

Solution 1: automatically identify the end

Add this to the first set in the project .pretierrc file.

"endOfLine": "auto"

Solution 2:

In the project In the .editorconfig file, Change end_of_line to CRLF. (used globally if possible)

Reason: git ends with CRLF and LF on different computers

The newline characters of text files under windows and Linux are inconsistent.

During line feed
windows uses both carriage return character Cr (carriage return character) and line feed character LF (linefeed character)
Mac and Linux systems only use the line feed LF
the old MAC system used the carriage return CR.