-
Notifications
You must be signed in to change notification settings - Fork 47.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[eslint-plugin-react-hooks] Bug: ESLint crashes if there's a useEffect
/ useLayoutEffect
invocation without any arguments.
#20343
Comments
Thanks @ChrisRu for the fix! |
I'm currently facing that error too and the case is the same that when the hook is empty, am I doing something wrong? "eslint": "^7.27.0", |
@Alecell eslint-plugin-react-hooks did not release a new version since this PR was merged. We need to wait until a new version of it gets released (I'm waiting for the release too 😄). You can use the same workaround as me in the meantime, a code snippet for {
"React useEffect": {
"scope": "javascript,javascriptreact,typescript,typescriptreact",
"prefix": "use effect",
"body": ["useEffect(() => {$0})"]
}
} Then you can create effects by typing You can read more about how to create snippets in VS Code here: https://code.visualstudio.com/docs/editor/userdefinedsnippets |
eslint-plugin-react-hooks version: 4.2.0
Steps To Reproduce
I know it shouldn't exist in production code, but it's annoying while editing some files.
Link to code example: https://codesandbox.io/s/polished-sun-3wr27?file=/src/App.js
The current behavior
ESLint crashed.
The expected behavior
ESLint doesn't crash but reports an error instead.
The text was updated successfully, but these errors were encountered: