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 项目报 “error Empty block statement no-empty“ 不规则空格引起报错的解决办法,希望对你有帮助,感谢阅读。