-
-
Notifications
You must be signed in to change notification settings - Fork 949
exhaustive-deps placed in the correct spot? #13311
Copy link
Copy link
Labels
A-linterArea - LinterArea - Linter
Description
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.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-linterArea - LinterArea - Linter
Type
Fields
Give feedbackPriority
None yet
Effort
None yet