Wednesday, April 7, 2021

Why does Prettier not format code in VS Code?

I was trying to set up Prettier in my VS Code and not sure why it does not format code. After googling I found the fix.

1. Goto "VS Code > View > Command Palette".

2. Search for "Format Document With".

3. Click on "Configure Default Formatter".

4. Click on "Prettier - Code Formatter".

I had recommended "Indent Rainbow" on my previous blog on "What is your first VS Code plugin?". Well, this plugin is not that useful if you have Prettier. Prettier already indent your code and I don't need indent colour.

No comments:

Post a Comment