You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using custom hooks for a query function, the no-rest-destructuring does not report.
Steps to reproduce
// Custom hook for queryconstuseTodos=()=>{returnuseQuery({queryKey: ['todos'],queryFn: ()=>fetch('example.com/todos'),});// NB results the same with const result = useQuery(/* */); return result;};functionTodoList(){// ✅ Normal usage - issue reportedconst{ dataA, ...restA}=useQuery({queryKey: ['todos'],queryFn: ()=>fetch('example.com/todos'),});// ❌ Custom hook - no issue reportedconst{ dataB, ...restB}=useTodos();return<></>;}
Expected behavior
Should report destructuring error when using const { ...rest } = useCustomQueryHook()
TanStack Query version
React query v5.50.1, eslint-plugin-query v5.71.5
TypeScript version
5.8.2
The text was updated successfully, but these errors were encountered:
Describe the bug
When using custom hooks for a query function, the
no-rest-destructuring
does not report.Steps to reproduce
Expected behavior
Should report destructuring error when using
const { ...rest } = useCustomQueryHook()
TanStack Query version
React query v5.50.1, eslint-plugin-query v5.71.5
TypeScript version
5.8.2
The text was updated successfully, but these errors were encountered: