React中jsx代码格式化插件
时间: 2023-09-09 21:10:43 浏览: 100
在React中,可以使用名为"esbenp.prettier-vscode"的插件来格式化JSX代码。你可以在Visual Studio Code的设置文件settings.json中进行配置。具体配置方法是,在"javascriptreact"这个字段下添加以下内容:
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
这样,当你保存.jsx文件时,代码会自动进行格式化。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [vscode react 代码格式化](https://blog.csdn.net/xigua3188/article/details/124248182)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [html-to-jsx:将HTML代码转换为React JSX](https://download.csdn.net/download/weixin_42150745/18856488)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [react .jsx文件无法格式化](https://blog.csdn.net/qq_48557089/article/details/122114254)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文