question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prettier.tabWidth not working

See original GitHub issue

I have added a .prettierrc to the root of a project i am working on and have set tabWidth to be 4. When i format a document the code gets formatted but the tab width is 2 spaces wide. This happens to all types of files (.js, .scss, .css, etc).

In the VSC User Settings i have also "editor.tabSize": 4,

I am using the latest versions of VSC and Prettier on Windows 10. Can anyone tell me why i can’t change the tab width?

image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
azzcommented, Jan 20, 2018

Looks like you’ve confused the vscode settings with the Prettier settings. It should simply be "tabWidth": 4 rather than prettier.tabWidth.

2reactions
azzcommented, Jan 20, 2018

If you press ctrl-space you should get completions

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to set tab width to 4 in prettier - Stack Overflow
First, remove any .prettierrc from the working directory. Because it overrides user settings and uses the default values.
Read more >
Options - Prettier
Prettier's printWidth option does not work the same way. It is not the hard upper allowed line length limit. It is a way...
Read more >
VS Code: edits with 4-spaces, saves with 2-spaces - Super User
The default tab width used by Prettier is 2. After setting it to 4, the file is now saved with 4 spaces. The...
Read more >
VS Code Prettier Setting: prettier.tabWidth - YouTube
Want to master VS Code? Click here: https://andrecasal.com/courses/mastery-for-vs-codeWant to upgrade web dev skills?
Read more >
How to set prettier indents? - Vi and Vim Stack Exchange
To solve my issue of prettier tab spaces, I added this: "prettier.tabWidth": 4. Finally, this page gives a full list of all your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found