vscode 如何格式化 vue 文件以符合 eslint 规则

vscode how to format vue file to comply with eslint rules

基本上我想要的是一致性

目前我在 vscode 中格式化我的文档,然后 运行 npm run dev,eslint 检查器会引发很多警告和错误,看来他们的 foramting/linting 规则来了来自不同的来源,我还没有找到让他们使用相同规则的方法

首先,安装这些扩展:

然后将这些设置写入您的 settings.json:

{
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}