vue项目报 “error Empty block statement no-empty“ 不规则空格引起报错 解决方案

一、在 package.json中添加

{
  "name": "system",
  "version": "0.1.0",
  "private": true,
  "eslintConfig": {
    "plugins": ["example"],
    "env": {
        "example/custom": true
    }
   },
}

二、 在项目根目录添加独立的配置文件.eslintrc.js 内容如下:

module.exports = {
  root: true,
  env: {
    node: true
  },
  'extends': [
    'plugin:vue/essential',
    'eslint:recommended'
  ],
  parserOptions: {
    parser: 'babel-eslint'
  },
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
  }
}

三、 在项目根目录创建vue.config.js,有此文件添加内容即可

module.exports = {
    devServer: {
        overlay: {
            warnings: false,
            errors: false
        }
    }
}

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