Solve the problem of “error empty block statement no empty” in the console (Vue project)
This problem is caused by the code space in the page, and the specific reason is the eslint verification
Solution
The first step is to add in package. JSON
{
"name": "system",
"version": "0.1.0",
"private": true,
"eslintConfig": {
"plugins": ["example"],
"env": {
"example/custom": true
}
},
}
The second step is to add an independent configuration file. Eslintrc. JS in the root directory of the project
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'
}
}
The third step is to create vue.config.js in the project root directory
module.exports = {
devServer: {
overlay: {
warnings: false,
errors: false
}
}
}
Read More:
- Resolve Vue error empty block XXXX
- Problems with vue project installation No ESLint configuration found
- Adding project folder in SourceInsight is empty
- XML tag has empty body less… (Ctrl+F1) Reports empty tag body. The validation works in XML / JSP
- Opencv problem: opencv error: assertion failed (! Empty()) in detectmultiscale
- How to solve the cross domain problem of Axios in Vue project
- [Solved] VUE Warning: Do not use empty rulesets scss(emptyrules)
- error: (-215:Assertion failed) !ssize.empty() in function ‘resize‘
- error(-215) !empty() in function detectMultiScale solution
- Solve the problem of error running console reported by pycharm Python console
- How to empty a whole line in latex (simple and effective)
- Several methods of deleting all empty lines in text under Linux
- Solve the problem that data cannot be input in idea console
- Vue + antd writes wrong output statement, resulting in no error report and no form submission
- How to solve the problem that the console window disappears in a flash after visual studio 2017 runs
- Empty Matrices, Scalars, and Vectors
- OpenCV error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor‘
- Warning: use less storage class specifier in empty declaration
- The background object of thymeleaf is null, which solves the problem of error when the object is empty to get the property value
- error: declaration may not appear after executable statement in block