1.打开应用商店,搜索 prettier code formatter ,选择第一个,点击安装。

2.安装完成后,点击文件,选择首选项,选择设置。

3.在搜索框内输入 save ,勾选在保存时格式化文件。

4.随便打开一个文件,在文件中右键点击,选择使用...格式化文档。

5.点击配置默认格式化程序。

6.选择 prettier code formatter 为默认格式化程序。

现在我们把可以试着把代码格式打乱。

以后我们可以按 Ctrl + S 键保存时,代码就会自动格式化啦!

原创作者:吴小糖
创作时间:2023.10.24