create-react-app eslint-config-react-app 应该提供 @babel/plugin-syntax-flow 和 @babel/plugin-transform-react-jsx,

n6lpvg4x  于 22天前  发布在  React
关注(0)|答案(3)|浏览(13)

描述bug

安装 eslint-config-react-app 后出现以下两个警告:

➤ YN0002: │ eslint-config-react-app@npm:7.0.1 [41989] doesn't provide @babel/plugin-syntax-flow (pc2f30), requested by eslint-plugin-flowtype
➤ YN0002: │ eslint-config-react-app@npm:7.0.1 [41989] doesn't provide @babel/plugin-transform-react-jsx (p4cc0d), requested by eslint-plugin-flowtype

环境

Yarn 3

重现步骤

  1. yarn install

预期行为

eslint-config-react-app 应该正确地依赖于 @babel/plugin-syntax-flow@babel/plugin-transform-react-jsx

实际行为

警告
修复此问题的方法是将 @babel/plugin-syntax-flow@babel/plugin-transform-react-jsx 添加到 eslint-config-react-apppackage.json 文件中 添加到其 peerDependencies。我不知道两者之间哪个是期望的(我假设是 peerDependencies,但我知道 ESLint 对于嵌套依赖可能很挑剔),所以我不想提交一个包含错误更改的 PR。

qfe3c7zg

qfe3c7zg1#

我也看到了这个问题。另外,将依赖项添加到我的项目列表中也无法解决警告,因为警告并不发生在我的工作区中。

prdp8dxp

prdp8dxp2#

是否有解决此问题的方法?

fhity93d

fhity93d3#

@doronhorwitz 有点像: #11982

相关问题