[Solved] Failed to load config “prettier“ to extend from.?

In the project root directory

npm i eslint prettier-eslint eslint-config-prettier --save-dev

This error will appear after installation:


the culprit is a git configuration attribute: core.autocrlf

Due to historical reasons, the line breaks of text files under windows and Linux are inconsistent.

Windows uses both carriage return character Cr (carriage-return character) and line break LF (linefeed character) when wrapping a line

Mac and Linux systems only use the line break: LF

The old MAC system used the carriage return character CR

If it is a Windows system, the file code is UTF-8 and contains Chinese, it is best to set autocrlf to false globally

git config --global core.autocrlf false

Read More: