ERROR in Plugin “react“ was conflicted .... 天坑留念-turborepo、eslint plugin

前两天项目代码拉下来,装完依赖启动的时候直接报错:

复制代码
[eslint] Plugin "react" was conflicted between ".eslintrc.js >> eslint-config-custom >> eslint-config-alloy/react" and "BaseConfig >> D:\pan\erp\test\business-service-react-apps\node_modules\.pnpm\eslint-config-react-app@7.0.1_@babel+plugin-syntax-flow@7.23.3_@babel+plugin-transform-react-_5zfkbwahtxvk25cddgh55ne33a\node_modules\eslint-config-react-app\base.js".

正常的项目啊,吓得我赶紧去问了下同事有没有这个问题,告诉我他的没有问题。。我内心。。。还是要保持围笑~~

来分析一下这个问题:

项目中使用的是pnpm安装的依赖,看报错信息实际上就是安装了两个eslint的插件包,那么就意味着这两个包都在尝试为React项目配置ESLint规则,所以产生了冲突。

可是找了半天,项目里也没装【eslint-config-react-app】这个依赖啊。。

又经过一番分析,发现eslint-config-react-app应该是基础配置,且自带eslint-plugin-react插件

而【eslint-config-alloy】里面也有eslint-plugin-react插件(eslint版本还不一样,一个8.56.0,一个8.28.0)

而自定义的eslint配置那里,package.json文件里又装了一个。。

你不冲突谁冲突哈哈。。。所以很简单,把package.json那里装的去掉就好了,问题解决。

在此之前没想动脑,打算随便查查的,都快把github上相关的解决方案试遍了,都不好使。。看来还是得动脑,谨此记录浪费的1小时,以后我的脑袋要高速运转!

附相关问题链接,可自行查看:

reactjs - Create-react-app - ERROR in Plugin "react" was conflicted between ".eslintrc.json" and "BaseConfig" - Stack Overflow

Configuration conflict with 7.27.0 · Issue #3128 · jsx-eslint/eslint-plugin-react · GitHub

ERROR in Plugin "react" was conflicted between ".eslintrc.json" and "BaseConfig" · Issue #11825 · facebook/create-react-app · GitHub

相关推荐
NiceCloud喜云4 小时前
Opus 4.8 的 Effort Control 怎么选:Low 到 Max 五档策略
android·java·大数据·前端·c++·python·spring
wordbaby5 小时前
React Native + RNOH:跨页面数据回传的最佳实践与避坑指南
前端·react native
GISer_Jing5 小时前
Three.js着色器编译机制深度解析
javascript·webgl·着色器
丷丩5 小时前
MapLibre GL JS第22课:查看本地GeoJSON
前端·javascript·map·mapbox·maplibre gl js
AI玫瑰助手5 小时前
Python函数:默认参数的定义与注意事项
开发语言·python·信息可视化
油炸自行车5 小时前
Claude Code 错误:API Error: 400 Failed to deserialize the JSON body into the
开发语言·javascript·json·trae·claude code·api error 400
肩上风骋5 小时前
C++14特性
开发语言·c++·c++14特性
Front思6 小时前
AI前端工程师需要具备能力+
前端·人工智能·ai
JAVA社区7 小时前
Java高级全套教程(十)—— SpringCloudAlibaba超详细实战详解
java·开发语言·spring cloud·面试·职场和发展
弥树子7 小时前
踩坑记录:服务器内网调用接口,真实请求URL与官方公开URL不一致问题排查
开发语言·php