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

useExhaustiveDependencies: add option for automatically #1

Closed
vanch3d opened this issue Dec 15, 2023 · 3 comments
Closed

useExhaustiveDependencies: add option for automatically #1

vanch3d opened this issue Dec 15, 2023 · 3 comments

Comments

@vanch3d
Copy link

vanch3d commented Dec 15, 2023

Great beginning with the plugin. Looking forward to definitely switching to biome

One issue I found a little bit annoying, compared to the ESLint plugin.
In the context of a React useEffect (I haven't tried it in any other cases), the plugin easily finds any missing dependencies on the hook:

  useEffect(() => {
    if ((state) {
      setOtherState(state)    
   }
  }, [])

But the plugin offers me only one option: suppress the rule:

Screenshot 2023-12-15 at 11 18 14

What is missing is at least another option to automatically update the dependency array:

Screenshot 2023-12-15 at 12 57 36

Running biome check indicates in the console the vars that are missing so the information is already there.

Note

  • Webstorm version 2023.3
  • biome plugin version 0.0.7
@ematipico
Copy link
Member

Hi @vanch3d , I would suggest to open a discussion in the main repo biomejs/biome, maybe here: biomejs/biome#3

We control code actions via LSP, not the plugin. If a code action is implemented in core, the plugin will automatically display it. That's the beauty of supporting LSP :)

@srosato
Copy link

srosato commented May 10, 2024

@ematipico How can I determine if the code action is implemented? I went on biomejs/biome#3 and saw green checks for useExhaustiveDependencies

image

But when I enable the rule like this:

  "linter": {
    "enabled": true,
    "rules": {
      "recommended": false,
      "correctness": {
        "useExhaustiveDependencies": "warn"
      }
    },

and restart the LSP server, I do not get suggestions to fix dependencies from IntelliJ.

image

I would assume its not yet implemented in the core, but I wonder where I can validate if its implemented or not?

Thanks!

@ematipico
Copy link
Member

You're actually correct. If the website doesn't show the emoji for the autofix, it means it doesn't have it

@biomejs biomejs locked and limited conversation to collaborators May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants