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 rule should handle preact #2043

Closed
1 task done
ssssota opened this issue Mar 11, 2024 · 3 comments · Fixed by #2105
Closed
1 task done

🐛 useExhaustiveDependencies rule should handle preact #2043

ssssota opened this issue Mar 11, 2024 · 3 comments · Fixed by #2105
Assignees
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Enhancement Status: Improve an existing feature S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@ssssota
Copy link
Contributor

ssssota commented Mar 11, 2024

Environment information

❯ pnpm exec biome rage
CLI:
  Version:                      1.6.0
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         unset
  JS_RUNTIME_VERSION:           "v18.17.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.15.4"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

What happened?

No diagnostics report like importing from react.

#3 (comment)

import {useEffect} from 'preact/hooks';
// import {useEffect} from 'react';
function Component() {
  let a = 0;
  useEffect(() => {
    console.log(a);
  }, []);
  return null;
}

Playground

Expected result

Diagnostics report from useExhaustiveDependencies.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@arendjr arendjr self-assigned this Mar 11, 2024
@arendjr
Copy link
Contributor

arendjr commented Mar 11, 2024

Thanks for reporting! As a workaround, you should be able to configure the hooks in the rule's configuration in the meantime.

@Conaclos Conaclos added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Mar 11, 2024
@ematipico
Copy link
Member

I am going to change the labels on this one.

I deem this as an enhancement. We have built those rules with React in mind, and I'm not sure of preact hooks work the same.

Even so, our logic didn't take preact in mind.

@ematipico ematipico added S-Help-wanted Status: you're familiar with the code base and want to help the project S-Enhancement Status: Improve an existing feature and removed S-Bug-confirmed Status: report has been confirmed as a valid bug labels Mar 15, 2024
@arendjr
Copy link
Contributor

arendjr commented Mar 15, 2024

Implemented here: #2105

I think this covers the places where React/Preact compatibility is relevant for us, but please let me know if I missed something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Enhancement Status: Improve an existing feature S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants