[英]Failed to load config "eslint-plugin-vue" to extend from
I am setting up eslint for vue in vscode.我在 vscode 中为 vue 设置 eslint。 I am getting this notification when ever I format my code.
每当我格式化我的代码时,我都会收到此通知。
ESLint stack trace:
[Error - 2:20:56 AM] Error: Failed to load config "eslint-plugin-vue" to extend from.
Referenced from: C:\Users\dell\Desktop\Web current Projects\Vue.Js\vue-eslint-truth\package.json
at configMissingError (c:\Users\dell\Desktop\Web current Projects\Vue.Js\vue-eslint-truth\node_modules\eslint\lib\cli-engine\config-array-factory.js:265:9)
at ConfigArrayFactory._loadExtendedShareableConfig (c:\Users\dell\Desktop\Web current Projects\Vue.Js\vue-eslint-truth\node_modules\eslint\lib\cli-engine\config-array-factory.js:826:23)
at ConfigArrayFactory._loadExtends (c:\Users\dell\Desktop\Web current Projects\Vue.Js\vue-eslint-truth\node_modules\eslint\lib\cli-engine\config-array-factory.js:731:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (c:\Users\dell\Desktop\Web current Projects\Vue.Js\vue-eslint-truth\node_modules\eslint\lib\cli-engine\config-array-factory.js:660:25)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigData (c:\Users\dell\Desktop\Web current Projects\Vue.Js\vue-eslint-truth\node_modules\eslint\lib\cli-engine\config-array-factory.js:596:20)
at _normalizeObjectConfigData.next (<anonymous>)
at createConfigArray (c:\Users\dell\Desktop\Web current Projects\Vue.Js\vue-eslint-truth\node_modules\eslint\lib\cli-engine\config-array-factory.js:340:25)
at ConfigArrayFactory.loadInDirectory (c:\Users\dell\Desktop\Web current Projects\Vue.Js\vue-eslint-truth\node_modules\eslint\lib\cli-engine\config-array-factory.js:433:16)
at CascadingConfigArrayFactory._loadConfigInAncestors (c:\Users\dell\Desktop\Web current Projects\Vue.Js\vue-eslint-truth\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:328:46)
my package.json file:-我的 package.json 文件:-
{
"name": "vue-eslint-truth",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-config-prettier": "^8.2.0",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/recommended",
"eslint:recommended",
"prettier",
"eslint-plugin-vue"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
I am new to vue js and I don't know what to do to make the eslint work correctly.我是 vue js 的新手,我不知道该怎么做才能使 eslint 正常工作。 When I try to run the vue app using
npm run serve
, the development server just don't start and gives me this error that当我尝试使用
npm run serve
运行 vue 应用程序时,开发服务器只是不启动并给我这个错误
Syntax Error: Error: Failed to load config "eslint-plugin-vue" to extend from.
Referenced from: C:\Users\dell\Desktop\Web current Projects\Vue.Js\vue-eslint-truth\package.json
at _normalizeObjectConfigDataBody.next (<anonymous>)
at _normalizeObjectConfigData.next (<anonymous>)
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
You don't need to extend eslint-plugin-vue on your eslintConfig of you packages.json.你不需要在你的包的 eslintConfig 上扩展 eslint-plugin-vue。json。 As you can see on documentation .
正如您在文档中看到的那样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.