小编Hot*_*aka的帖子

警告:在 React 18.2.0 上运行 eslint 时,“eslint-plugin-react 设置”中未指定 React 版本

问题

Warning: React version not specified in eslint-plugin-react settings. See https://github.com/jsx-eslint/eslint-plugin-react#configuration .运行 eslint 时显示 Git bash 。

如何生产

create-react-app my-app
cd app
npm install eslint --save-dev
npx eslint --init
npx eslint .
Run Code Online (Sandbox Code Playgroud)

包.json

{
  ...
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.3.0",
    "@testing-library/user-event": "^13.5.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  ...
  "devDependencies": {
    "eslint": "^8.18.0",
    "eslint-plugin-react": "^7.30.1"
  }
}
Run Code Online (Sandbox Code Playgroud)

我试图寻找解决方案但失败了。我恳请您的帮助。

reactjs eslint

61
推荐指数
2
解决办法
4万
查看次数

标签 统计

eslint ×1

reactjs ×1