Skip to content
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

Bug: [email protected]: Doesn't allow to use quick fix for exhaustive deps in Inteliji IDEs #18099

Closed
oziniak opened this issue Feb 21, 2020 · 4 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@oziniak
Copy link

oziniak commented Feb 21, 2020

React version: 16
eslint-plugin-react-hooks: 2.4.0

Steps To Reproduce

  1. Install yarn add -D eslint-plugin-react-hooks
  2. Run IDE (I tried WebStorm and RubyMine)
  3. Do an exhaustive deps error:
function Component(props) {
    useEffect(() => {
        console.log(props.a);
    }, []);
}
  1. Observe Webstorm quick fix hint allows only to suppress error pressing control+shift+enter with // eslint-disable-next-line react-hooks/exhaustive-deps
    image
  2. Remove yarn remove eslint-plugin-react-hooks
  3. Add yarn add -D [email protected]
  4. Restart WebStorm
  5. Objserve quick fix hint is shown and error can be fixed with control+shift+enter
    image

Link to code example: unavailable

I know it's a weird issue and I have no knowledge where WebStorm or RubyMine take hints for quick fixes, but it's an extremely neat thing once you get used to it. And it looks like some changes introduced in 2.4.0 broke the contract.

@oziniak oziniak added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Feb 21, 2020
@threepointone threepointone assigned gaearon and unassigned gaearon Feb 24, 2020
@gaearon
Copy link
Collaborator

gaearon commented Feb 26, 2020

This is not a bug. We changed it from autofix to use the ESLint Suggestions API (new in ESLint 6.7) due to common complaints. So IntelliJ needs to implement support for ESLint Suggestions API for this to work again. See here: #16313 (comment).

cc @prigara Can you route this? Shouldn't be a lot of work.

@gaearon gaearon closed this as completed Feb 26, 2020
@prigara
Copy link

prigara commented Feb 27, 2020

Hi,
I've filed an issue on our tracker: WEB-44070. Please follow it for the updates. Unfortunately, at the moment I can't provide an ETA for it – we now have a feature freeze for the upcoming 2020.1 release. Most probably we'll implement the support for it only in the 2020.2 release.

@gaearon
Copy link
Collaborator

gaearon commented Mar 31, 2020

I'm adding autofix back behind an appropriately named option for people who really need it. Note: if your IDE or lint setup actually fixes it automatically, you do not want this. This is only for people who use older IDEs that don't yet support Suggestions and who don't run this as an automatic step.

#18437

@liesislukas
Copy link

IntelliJ needs to implement support for ESLint Suggestions API

they already did that, installing update atm.

WebStorm 2020.1.1
Build #WS-201.7223.93, built on April 30, 2020
Runtime version: 11.0.6+8-b765.40 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

4 participants