ESLint服务器抛出以下错误:
[Info - 11:43:42] 加载插件失败'@babel/plugin-proposal-class-properties',在'.eslintrc.json'中声明:找不到模块'@babel/eslint-plugin-plugin-proposal-class-properties'
我安装了@babel/plugin-proposal-class-properties
,但是ESLint服务器尝试从路径'@babel/eslint-plugin-plugin-proposal-class-properties'
加载它,而包实际安装在这里:'@babel/plugin-proposal-class-properties'
。
package.json:
{
...
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/eslint-parser": "^7.12.1",
"@babel/eslint-plugin": "^7.12.1",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"eslint": "^7.11.0",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-plugin-import": "^2.22.1"
}
}
.eslintrc.json
{
"extends": ["airbnb-base"],
"parser": "@babel/eslint-parser",
"parserOptions": {
"sourceType": "module",
"allowImportExportEverywhere": false,
"requireConfigFile": false
},
"plugins": ["@babel", "@babel/plugin-proposal-class-properties"],
"rules": {
}
}
为什么ESLint尝试从错误的路径加载插件,如何修复它?