question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: eslint-plugin-react-hooks optional chaining in deps

See original GitHub issue

Packages

  • "react": "^16.13.1"
  • "eslint-plugin-react-hooks": "^4.0.8"

The issue #18819 still happens with eslint-plugin-react-hooks@4.0.8.

Using the example code from the other issue gives the following errors:

image

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
gaearoncommented, Sep 10, 2020

eslint-plugin-react-hooks@4.1.1 should have the fix.

2reactions
gaearoncommented, Aug 20, 2020

Sounds good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React ESLint is still throwing no-unused-expressions with ...
I have a function call that uses optional chaining const index = [1, 2, 3, 4] media.name?.forEach((m) => { if (index.includes(m)) ...
Read more >
Rules of Hooks - React
We released an ESLint plugin called eslint-plugin-react-hooks that enforces these two rules. You can add this plugin to your project if you'd like...
Read more >
eslint/eslint - Gitter
Hey guys had some problem with updating to 8.19.0 from 7.5 here is error when using eslint command in my app ESLint couldn't...
Read more >
eslint-config-torchbox - npm
Shareable ESLint config following Torchbox's code style. ... react-hooks/exhaustive-deps · jsx-a11y/alt-text: error, elements: img, object, ...
Read more >
eslint-plugin-react | Yarn - Package Manager
Fixed ; jsx-no-literals : properly error on children with noAttributeStrings: true (#3317 @TildaDares) ; jsx-key : catch key errors inside conditional statements ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found