vscode +eslint 保存自动按照eslint格式生成

84 阅读1分钟

前提是你需要在 package.json中安装了eslint的依赖

1.vscode 安装eslint + Vetur 插件

2.文件==》首选项==》设置

3.输入 .json, 点击setting.json文件

4.添加下面配置

"eslint.validate": [
    "javascript",
    "javascriptreact",
    {
      "language": "vue",
      "autoFix": true
    },
    "vue"
  ],
  "eslint.autoFixOnSave": true

5.