Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/react_hooks/exhaustive_deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl Rule for ExhaustiveDeps {
Argument::SpreadElement(_) => {
ctx.diagnostic(unknown_dependencies_diagnostic(
hook_name.as_str(),
callback_node.span(),
call_expr.callee.span(),
));
None
}
Expand Down Expand Up @@ -312,7 +312,7 @@ impl Rule for ExhaustiveDeps {
_ => {
ctx.diagnostic(unknown_dependencies_diagnostic(
hook_name.as_str(),
callback_node.span(),
call_expr.callee.span(),
));
None
}
Expand Down
11 changes: 5 additions & 6 deletions crates/oxc_linter/src/snapshots/exhaustive_deps.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1953,12 +1953,11 @@ source: crates/oxc_linter/src/tester.rs
help: Either include it or remove the dependency array.

⚠ react_hooks(exhaustive-deps): React Hook useEffect received a function whose dependencies are unknown.
╭─[exhaustive_deps.tsx:3:21]
2 │ const local = {};
3 │ ╭─▶ useEffect(debounce(() => {
4 │ │ console.log(local);
5 │ ╰─▶ }, delay), []);
6 │ }
╭─[exhaustive_deps.tsx:3:11]
2 │ const local = {};
3 │ useEffect(debounce(() => {
· ─────────
4 │ console.log(local);
╰────
help: Pass an inline function instead.

Expand Down