Fixing Prettier CRLF Issues in VS Code After Cloning Repository from Git

If you’ve ever cloned a project from Git and faced Prettier errors like Delete CR in VS Code, you’re not alone. In this article, we’ll go through how to fix this issue step by step.

This issue happens due to line-ending differences (CRLF vs. LF) between Windows and Unix-based systems.

Why Does This Happen?

  • Windows uses CRLF (Carriage Return + Line Feed) as the default line ending.

  • Linux/macOS use LF (Line Feed).

  • If your repository enforces LF, but Git converts files to CRLF on Windows, Prettier flags every line as an error.

Check Your Git Configuration

Before making any changes, it’s important to check your current Git settings. Run the following command in command prompt.

This will list all Git configurations, including the core.autocrlf setting, which controls how Git handles line endings. You might see something like this:

How to fix it?

If core.autocrlf is true, follow the below steps to solve this issue.

  • Disable Git’s Auto Line Ending Conversion
    Run this git command in command prompt. This prevents Git from modifying line endings when checking out files.
 
After run the above command, check the git configuration again. 
 

This means that core.autocrlf is set in multiple places, and the last one takes effect.

  • Delete the Cloned Project
    If you had already cloned the project and faced errors, then delete the entire project folder.
  • Clone the Repository Again
    After setting core.autocrlf false, clone the repository from scratch again from git.
  • Run the Project Again
    After cloning and running the Vue.js app, the Prettier errors will be gone😊! 
Follow Us On

Registered Office

CHG IT CONSULTANCY PVT LTD

STPI Technology Incubation Centre,
2nd Floor, No.5, Rajiv Gandhi Salai,
Taramani, Chennai – 600113,
Tamil Nadu, INDIA

Parent Office

CIC Corporation

2-16-4 Dogenzaka, Shibuya-ku,
Nomura Real Estate,
Shibuya Dogenzaka Building,
Tokyo 150-0043, JAPAN

  +81 03-3496-1571
AboutUs

CHG IT Consultancy Pvt. Ltd. is a subsidiary of CIC Holdings Co. Ltd. Japan. Our company is focused on IT related solutions to reap the benefits of global popularity of Software Industry.

Registered Office
CHG IT CONSULTANCY PVT LTD

STPI Technology Incubation Centre,
2nd Floor, No.5, Rajiv Gandhi Salai,
Taramani, Chennai – 600113,
Tamil Nadu, INDIA

CIC Corporation

2-16-4 Dogenzaka, Shibuya-ku,
Nomura Real Estate,
Shibuya Dogenzaka Building,
Tokyo 150-0043, JAPAN

+81 03-3496-1571