Skip to content

📎 Break useExhaustiveDependencies into two rules #630

@crutchcorn

Description

@crutchcorn

Description

I was migrating to the newest version of Biome and noticed that it seems to group in two seemingly unrelated rules into one:

  • × This hook do not specify all of its dependencies.
  • × This hook specifies more dependencies than necessary.

Inside of useExhaustiveDependencies

However, there's a problem with doing so this way.

While does not specify all of its deps is a rule that's ported over from React's common ESLint rules, specifies more deps than necessary isn't a rule, as it doesn't break the React Rules of Hooks. Moreover, specifying additional deps is how you're able to get some functionality to work as-expected at times.

Because of this, we should:

  • specifies more deps than necessary should be broken into a new rule
  • This new rule should be marked as optional, not required

Metadata

Metadata

Assignees

Labels

A-LinterArea: linterS-EnhancementStatus: Improve an existing featureS-Help-wantedStatus: you're familiar with the code base and want to help the project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions