将eslint升级到8版本后,每个测试模块都报以下错误:
error Definition for rule 'jest/valid-describe' was not found jest/valid-describe
eslintrc.json
的一部分:{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:jest/recommended"
],
"plugins": ["@typescript-eslint", "import", "jest"],
"env": {
"jest/globals": true
},
"parser": "@typescript-eslint/parser",
// ...
}
软件包版本如下:
"@types/jest": "^27.0.3",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/experimental-utils": "^4.28.4",
"@typescript-eslint/parser": "^5.4.0",
"eslint": "^8.3.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jest": "^25.3.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-testing-library": "^5.0.0",
"jest": "^27.0.6",
"ts-jest": "^27.0.4",
有什么想法吗?