gpt4 book ai didi

javascript - ESLint: 8.0.0 加载插件失败 '@typescript-eslint'

转载 作者:行者123 更新时间:2023-12-05 00:23:58 28 4
gpt4 key购买 nike

你能帮我吗,我在尝试构建项目时遇到了这个错误?

Oops! Something went wrong! :(


ESLint: 8.0.0


TypeError: Failed to load plugin '@typescript-eslint' declared in 'src.eslintrc': Class extends value undefined is not a constructor or nullReferenced from: src.eslintrc


包.json
    "devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"browserslist": "^4.17.3",
"eslint": "^8.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.26.1",
"prettier": "^2.3.2",
}
.eslintrc
    "parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
],
"plugins": ["@typescript-eslint"],

最佳答案

我这样做了,它对我来说很好用

"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.1.0",
更新这三个包
然后在项目的根目录中运行此命令以更新包
npm i
它会正常工作

关于javascript - ESLint: 8.0.0 加载插件失败 '@typescript-eslint',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69513869/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com