在“eslint-plugin-react-settings”中收到警告;运行 eslint 时
得到:
警告:eslint-plugin-react-settings 中指定的 React 版本必须是有效的 semver 版本,或“检测”;运行 eslint 时获得“最新”。
这背后的原因是什么以及如何解决?
Getting the:
warning: React version specified in eslint-plugin-react-settings must be a valid semver version, or "detect"; got “latest”' while running eslint.
What is the reason behind this and how to resolve it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的 .eslintrc 文件中将定义一个对象作为设置。而这个错误是说其中定义的react版本不是你机器上安装的版本。请将设置对象替换为以下代码,以便 es lint 可以在运行时自动检测到它。
There will be an Object defined in your .eslintrc file as settings. And this error is saying that the version of react defined in it is not the version installed in your machine. Please replace settings object with following code so that es lint can detect it automatically on runtime.
只需在 .eslintrc 文件中添加代码(js,json)
因为这个 eslint 会自动检测 React 版本
Just add the code in the .eslintrc file (js,json)
as this eslint will automatically detect the react version ????
将其添加到我的 .eslintrc 文件中解决了问题。
adding this in my
.eslintrc
file fixed the problem.