Cause of the problem: the project uses eslint specification code, and your code violates the specification
The first scheme (recommended): format the code through the editor and unify the indentation method
The second method: turn off the verification of spaces and tabs by eslin
Vue version 3.0:
1, find build – & gt; webpack.base.config.js。 Comment or remove the reference to eslint loader.
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter'),
emitWarning: !config.dev.showEslintErrorsInOverlay
}
}
2. Restart the project
Vue 3.0 +:
configure the rules of eslin in package.json. Eslintconfig
{
"name": "xxxx",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
xxx
},
"devDependencies": {
xxx
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {
"no-console": "off",
"no-debugger": "off",
"no-mixed-spaces-and-tabs": "off"
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
The third other method:
create a vue.config.js
module.exports = {
lintOnSave:false
}
Read More:
- [Solved] Syntax Error: Error: No ESLint configuration found & TypeError: eslint.CLIEngine is not a constructor
- VUE Error: Mixed spaces and tabs [How to Solve]
- [Solved] error: Unexpected console statement (no-console)
- [Solved] Vue3 Error: error Delete `··` prettier/prettier
- [Solved] Vue eslint Error: Component name “*****“ should always be multi-word
- [Solved] Vue3.0 Error: The component has been registered but not used vue/no-unused-components, Close eslint
- [Solved] Vue Error: error ‘xxx‘ is defined but never used no-unused-vars
- How to Solveb Vue3 defineProps Error
- Vue Error: component has been registered but not used [Two Methods to Solve]
- [Solved] Vue Compile Error: JavaScript heap out of memory
- [Solved] ERROR Error: Cannot find module ‘vue-loader-v16/package.json‘
- [Solved] ✖ 2 problem (1 error, 0 warnings) 2 error and 0 warnings potentially fixable with the`–fix`
- After Vite starts, it will prompt “network: use ` — host ` to expose”, and the service cannot be accessed through network IP
- [Solved] Vue 3 Script Setup ESLint Error: ‘defineProps‘ is not defined
- Vue Install less Error: While resolving: [email protected]
- [Solved] Vue Project Error: Arrow function should not return assignment
- [Solved] Errors: 1 http://eslint.org/docs/rules/quotes…elementUI Import Error
- [Solved] Error Rule can only have one resource source (provided resource and test + include + exclude)
- [Solved] Error Rule can only have one resource source (provided resource and test + include + exclude)
- Solution to build error in Vue project (error in static/JS)/vendor.xxxxx.js from UglifyJs)