Describe the bug#
@tanstack/query/prefer-query-object-syntax rule dose not look useInfiniteQuery to a error.
Your minimal, reproducible example#
https://codesandbox.io/p/sandbox/old-microservice-g6mfwh?file=%2Fpages%2Findex.js%3A36%2C1-37%2C1
Steps to reproduce#
- install @tanstack/eslint-plugin-query
- configure
@tanstack/query/prefer-query-object-syntax rule
- run eslint fix
Expected behavior#
useInfiniteQuery should be error and can be fixed.
How often does this bug happen?#
Every time
Screenshots or Videos#
No response
Platform#
Tanstack Query adapter#
None
TanStack Query version#
v4.0.10
TypeScript version#
v5.0.4
Additional context#
I think adding useInfiniteQuery, useIsFetching, useIsMutating into QUERY_CALLS will fix this issue. Is that true, then I will fix it.
yes, it's only implemented for
useQuery. Not sure if we have plans to add anything else, because in v5, the rule is removed because the object syntax is the only valid syntax.If it's as staightforward as your analysis shows, please go ahead and make a PR with some tests to verify, and I'll happily merge it :)
@Newbie012 FYI