问题描述
从tsx中exoprt一个interface(接口),在另一个tsx中使用,结果会报这个接口定义未使用xxx is defined but never used
,但是实际上是用了的。
解决方案如下:
"@typescript-eslint/eslint-plugin": "^2.8.0"
"eslint-config-react-app": "^5.1.0"
"eslint-plugin-flowtype": "3.13.0"
"eslint-plugin-jsx-a11y": "6.2.3"
"eslint-plugin-react-hooks": "^1.6.1"
【注意】实际上是需要安装@typescript-eslint/eslint-plugin
,剩下的几个是这个包依赖的包。
"eslint-config-react-app": "^5.1.0"
这个包是因为"extends": "react-app"
依赖。