1.下载eslint.
2.首选项->设置,然后搜索eslint,点击在setting.json中设置.设置内容如下:
"editor.codeActionsOnSave": { "source.fixAll.eslint": true, }
接着在保存时就能按照eslint的标准格式化代码