nursery/useTanstackQueryInfiniteQueryPropertyOrder
nursery · since 2.6.5
Unsafe autofixRecommended
biome.json
{
"linter": {
"rules": {
"nursery": {
"useTanstackQueryInfiniteQueryPropertyOrder": "error"
}
}
}
}Enforce a consistent property order in the options of TanStack Query infinite query functions.
import { useInfiniteQuery } from "@tanstack/react-query";
useInfiniteQuery({
queryKey: ["projects"],
getNextPageParam: (lastPage) => lastPage.nextId,
queryFn: ({ pageParam }) => fetchProjects(pageParam),
initialPageParam: 0,
});import { infiniteQueryOptions } from "@tanstack/react-query";
infiniteQueryOptions({
queryFn: ({ pageParam }) => fetchProjects(pageParam),
getNextPageParam: (lastPage) => lastPage.nextId,
getPreviousPageParam: (firstPage) => firstPage.previousId,
});import { useInfiniteQuery } from "@tanstack/react-query";
useInfiniteQuery({
queryKey: ["projects"],
queryFn: ({ pageParam }) => fetchProjects(pageParam),
initialPageParam: 0,
getPreviousPageParam: (firstPage) => firstPage.previousId,
getNextPageParam: (lastPage) => lastPage.nextId,
});Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
nursery/useTanstackQueryInfiniteQueryPropertyOrder
nursery · since 2.6.5
{
"linter": {
"rules": {
"nursery": {
"useTanstackQueryInfiniteQueryPropertyOrder": "error"
}
}
}
}Require query keys to include every value that the query function uses.
Enforce that onMutate comes before onError and onSettled in the options of TanStack Query mutations.
Enforce the shorthand syntax for CSS variables in Tailwind CSS classes.
Require the TanStack Query QueryClient to be created once, not on every render.
Enforce the shorthand syntax for Svelte bind:, class:, and style: directives.