Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code 使用什么更漂亮的扩展设置来格式化我的代码?_Visual Studio Code_Prettier - Fatal编程技术网

Visual studio code 使用什么更漂亮的扩展设置来格式化我的代码?

Visual studio code 使用什么更漂亮的扩展设置来格式化我的代码?,visual-studio-code,prettier,Visual Studio Code,Prettier,我使用的是VS代码编辑器,我已经安装了prettier,但是我的代码仍然粘在一起,而不是继续下一行。我试着改变了一些设置,但效果不太好。下面是一个示例代码 返回( {e.target.onerror=null;e.target.src=”https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcRlsUYbM6jWxjKND6TCCeEE5sBTwEJqyUhtLg&usqp=CAU“}}alt=”“style={{borderRadius

我使用的是VS代码编辑器,我已经安装了prettier,但是我的代码仍然粘在一起,而不是继续下一行。我试着改变了一些设置,但效果不太好。下面是一个示例代码

返回(
{e.target.onerror=null;e.target.src=”https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcRlsUYbM6jWxjKND6TCCeEE5sBTwEJqyUhtLg&usqp=CAU“}}alt=”“style={{borderRadius:“50%”,宽:30,高:30,边框:“无”}>
{comment.snippet.topLevelComment.snippet.authorDisplayName}{comment.snippet.topLevelComment.snippet.textOriginal}
{注释.回复!==未定义?回复
:null}

)
更漂亮的最新版本[3.17.0] vs代码最新版本1.41.1 保存时的格式为“打开”
默认格式化程序esbenp.prettier vscode

您为VS代码安装了“prettier-Code Formatter”扩展吗?是的,当然。您安装了“prettier”npm软件包?扩展是否足够?不,我还没有尝试过;我相信您可以在全球范围内安装,也可以在每个项目的基础上安装。我还发现在VS代码的settings.json中启用“editor.formatOnSave”也很有帮助。