Prettier add additional tabs

56 views Asked by At

Prettier not adds an additional tab before the return and props declaration. Such formatting is in IntelliJ idea, how I can repeat it in vs code with prettier?

My prettier format files:

    return (     
        <Component
             Prop={123}
        /> 
    )

But I need it to be like this

    return (     
            <Component
                     Prop={123}
            /> 
    )
1

There are 1 answers

1
Behemoth On

You can always increase the --tab-width option to get larger indents. Hower, if you want to keep the line breaks exactly like that I'm afraid this is too specific for Prettier. It will wrap lines differently.

If you want to keep one particular line untouched by Prettier use a // prettier-irgnore commend. E. g.

...
  // prettier-ignore
  return (     
            <Component
                     Prop={123}
            /> 
   )
...