简体   繁体   中英

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM