Closed
Description
React version:
17.0.2
eslint-plugin-react-hooks version:
4.2.0
Steps To Reproduce
- import useEfect from react library
- type
useEfect(
Link to code example:
https://github.com/LeonardoRick/podcastr
The current behavior
output:
[Error - 16:40:28] ESLint stack trace:
[Error - 16:40:28] TypeError: Cannot read property 'type' of undefined
Occurred while linting D:\GIT\podcastr\src\Components\Player\index.tsx:16
at visitCallExpression (D:\GIT\podcastr\node_modules\eslint-plugin-react-hooks\cjs\eslint-plugin-react-hooks.development.js:1736:24)
at D:\GIT\podcastr\node_modules\eslint\lib\linter\safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (D:\GIT\podcastr\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (D:\GIT\podcastr\node_modules\eslint\lib\linter\node-event-generator.js:256:26)
at NodeEventGenerator.applySelectors (D:\GIT\podcastr\node_modules\eslint\lib\linter\node-event-generator.js:285:22)
at NodeEventGenerator.enterNode (D:\GIT\podcastr\node_modules\eslint\lib\linter\node-event-generator.js:299:14)
at CodePathAnalyzer.enterNode (D:\GIT\podcastr\node_modules\eslint\lib\linter\code-path-analysis\code-path-analyzer.js:711:23)
at D:\GIT\podcastr\node_modules\eslint\lib\linter\linter.js:954:32
at Array.forEach (<anonymous>)
error line:
// eslint-plugin-react-hooks\cjs\eslint-plugin-react-hooks.development.js:1736:24:
switch (callback.type) {
The expected behavior
No errors showing, since I'm currently typing the code