eslint 编译问题 提示使用--fix解决

报错信息

5 errors and 0 warnings potentially fixable with the `--fix` option.

// 使用“——fix”选项可以修复5个错误和0个警告。

解决步骤

package.json文件:

  "scripts": {
    "dev": "vue-cli-service serve",
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "test:unit": "vue-cli-service test:unit",
    "lint": "eslint --fix --ext .js,.vue src" // 重点是修改这一句
  },

下次启动项目之前就先来修复一下代码不规范的地方:

npm run lint
npm run dev

参考:eslint报错解决方案:--fix的使用_Code_Zevin_J的博客-CSDN博客_eslint fix

你可能感兴趣的:(Vue,vue.js,前端,javascript)