Prettier on VS Code unfolds my code blocks on save . How to prevetn sthis?

Viewed 24

I'm using Prettier on VS Code with the editor.formatOnSave enabled. Every time I save my (js)|| (jsx) file and prettier runs it unfolds all my functions. Is there a way to prevent this from happening?

I have a large React component and would like to keep the component collapsed.

1 Answers

Setting editor.foldingStrategy to "indentation" in VScode settings will resolve your issue.

Related