reason
Due to the end of line style configuration, endoofline configuration has the following four options:
lf
– line feed only (\n), which is common in Linux, MacOS and git repos
CRLF
– carriage return + line feed character (\r \n), and windows
CR
– carriage return character only (\r), Rarely use
auto
– keep the existing end of the line (the mixed values in a file are standardized by looking at the content used after the first line)
Solution:
Configure endOfLine: ‘auto’ in prettier.config.js:
module.exports = {
semi: false, // unterminated semicolon
singleQuote: true, // single quotes
quoteProps: 'as-needed',
trailingComma: 'none', // final comma
// The point is that this one should be configured as auto
endOfLine: 'auto'
}
Read More:
- [Solved] Vue prettier error: error Delete `␍` prettier/prettier
- Vscode save Vue format eslint check error [How to Solve]
- [Solved] Failed to load config “prettier“ to extend from.?
- [Solved] Vue Project startup error: no eslint configuration found
- [Solved] VUE eslint Error: Expected linebreaks to be ‘LF‘ but found ‘CRLF
- [Solved] ✖ 2 problem (1 error, 0 warnings) 2 error and 0 warnings potentially fixable with the`–fix`
- [Solved] ESLint: Parsing error: Unexpected token(prettier/prettier)
- How to Solve Vue cli configuration SCSS global variable error
- [Solved] Prittier format code error: JSON Error in…
- Newline required at end of file but not found eol-last [How to Solve]
- [Solved] ESLint error: Newline required at end of file but not found (eol-last)
- Vue Project Error: Expected indentation of 2 spaces but found 4,Newline required at end of file but not found
- vue.config.js build Package UglifyJsPlugin to clear console and print console.log Error: `warnings` is not a supported option
- JS to determine whether the string contains a character
- Solution to some map files in JS folder after Vue packaging (remove the map. JS file)
- How to Solve electron import page Error
- [Solved] Component name “login“ should always be multi-word.
- vue-elemnt-admin npm run dev [How to Solve]
- Javascript: Simple package localStorge operation
- How to Test whether the property value of each property in the object is not empty