Skip to content

exhaustive-deps placed in the correct spot? #13311

@donaldpipowitch

Description

@donaldpipowitch

It looks like in the recent oxlint version ("1.13.0") the exhaustive-deps diagnostics are reported at a different place.

Previously (dependency array):

  useEffect(() => {
    emit(EVENTS.CLEAR);
    // oxlint-disable-next-line exhaustive-deps
  }, []);

Now (first usage of an unhandled dependency):

  useEffect(() => {
    // oxlint-disable-next-line exhaustive-deps
    emit(EVENTS.CLEAR);
  }, []);

Was this an intended change? I cannot find a recent discussion about it.

I feel like this is less ergonomic to use and therefor consider it a bug.

If you use other logic earlier inside the hook this comment will be placed somewhere in the middle on the first usage of an unhandled dep. I feel this is less refactoring friendly and less visible for longer hooks. (And yes I'm well aware that these comments should be avoided in the first place.)

Metadata

Metadata

Assignees

Labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions