TanStack Query
TanStack Query rules from @tanstack/eslint-plugin-query. Guards the ergonomic and correctness contracts of TanStack Query (useQuery, useMutation, query-options factories) inside React TypeScript sources.
Source: @tanstack/eslint-plugin-query (MIT).
tanstack-query/exhaustive-deps: Require TanStack QueryqueryKeyarrays to include every variable read by thequeryFnbody, mirroring React Hooks dependency tracking.tanstack-query/infinite-query-property-order: RequirequeryFn,getPreviousPageParam, andgetNextPageParaminsideuseInfiniteQueryto appear in the order TanStack Query documents.tanstack-query/mutation-property-order: RequireuseMutationcallbacks to declareonMutatebeforeonErrorandonSettled.tanstack-query/no-rest-destructuring: Reject...restdestructuring on TanStack Query hook results.tanstack-query/no-unstable-deps: Reject passing entire TanStack Query hook results into React dependency arrays.tanstack-query/no-void-query-fn: RejectqueryFncallbacks that resolve tovoid.tanstack-query/prefer-query-options: Prefer wrapping query options in thequeryOptions()helper over inline{ queryKey, queryFn }literals.tanstack-query/stable-query-client: Reject creating aQueryClientinside a React component or hook body. The client must be stable across renders.
Last updated on