mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
fix(linter): false positive in exhaustive-deps (#7626)
This commit is contained in:
parent
8a68ef4c3b
commit
e824501a21
1 changed files with 19 additions and 1 deletions
|
|
@ -407,7 +407,10 @@ impl Rule for ExhaustiveDeps {
|
|||
})
|
||||
});
|
||||
|
||||
if has_write_reference {
|
||||
if has_write_reference
|
||||
|| get_declaration_from_reference_id(ident.reference_id(), ctx.semantic())
|
||||
.is_some_and(|decl| decl.scope_id() != component_scope_id)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
@ -2107,6 +2110,21 @@ fn test() {
|
|||
});
|
||||
}, [options]);
|
||||
}",
|
||||
"export function useCanvasZoomOrScroll() {
|
||||
useEffect(() => {
|
||||
let wheelStopTimeoutId: { current: number | undefined } = { current: undefined };
|
||||
|
||||
wheelStopTimeoutId = requestAnimationFrameTimeout(() => {
|
||||
setLastInteraction?.(null);
|
||||
}, 300);
|
||||
|
||||
return () => {
|
||||
if (wheelStopTimeoutId.current !== undefined) {
|
||||
console.log('h1');
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
}",
|
||||
];
|
||||
|
||||
let fail = vec![
|
||||
|
|
|
|||
Loading…
Reference in a new issue