Search code examples
visual-studio-codeprettier

How to put tap space in my code while using prettier in vscode


Prettier is useful in most times. But, sometimes I want to put tap space in my code for enhanced reading of the code. Is there any way for put tap space in my code intentionally while using Prettier?


Solution

  • I think you mean tab spaces with a b not a p. if that's correct, then no, in general prettier does not allow for discretionary tabs, because it is what is known as an opinionated formatter, meaning that it has its own opinions about the way code should look.

    If you want more control over your formatting, you can uninstall prettier and choose a different formatting extension instead, like beautify - or even just use the built-in VS code language features, which provide formatting and are fairly customizable.

    In the settings section of VS code, you can search for terms like tab and white space to customize the behavior.