Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to adjust prettier in vs code for 4 spaces and tabs? [duplicate]

I have the latest version of prettier on macos with latest vs code, but I still see 2 spaces on new tabs when I Format Document. This is a React/NextJS JSX document (also does with CSS).

enter image description here

In the VS Code Prettier settings, I have the tabs set as true and the spaces set at 4. I am not sure how to adjust this as I don't want the 2 lines as they appear to close together for me to see. How do I adjust this?

EDIT [SOLVED]:

The issue was that the page in VS needed to be closed and opened again after the changes. The pages got stuck. Thanks for the tips. I also used the previous SO answer to setup the proper settings prior to this post.

like image 635
cdub Avatar asked Jan 18 '26 18:01

cdub


2 Answers

In the footer of VS Code there is an option to change your indents. It's next to the current cursor location. I don't know if that's what you're looking for.

VS Code Footer

like image 191
Julius Babies Avatar answered Jan 21 '26 07:01

Julius Babies


simple, you need change settings

File -> Preferences -> Settings -> search for: "Prettier:Tab Width" -> change value to 4
like image 23
Andrew Avatar answered Jan 21 '26 06:01

Andrew