# useTanstackQueryInfiniteQueryPropertyOrder

Rule `biome/useTanstackQueryInfiniteQueryPropertyOrder`. Enforce a consistent property order in the options of TanStack Query infinite query functions.

- Source: biome
- Technologies: React
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #615 by reach, #250 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/useTanstackQueryInfiniteQueryPropertyOrder` | yes | unsafe | group nursery, since 2.6.5 | [docs](https://biomejs.dev/linter/rules/use-tanstack-query-infinite-query-property-order/) |

## Code examples

### Incorrect: the rule reports this

```js
import { useInfiniteQuery } from "@tanstack/react-query";

useInfiniteQuery({
    queryKey: ["projects"],
    getNextPageParam: (lastPage) => lastPage.nextId,
    queryFn: ({ pageParam }) => fetchProjects(pageParam),
    initialPageParam: 0,
});
```

```js
import { infiniteQueryOptions } from "@tanstack/react-query";

infiniteQueryOptions({
    queryFn: ({ pageParam }) => fetchProjects(pageParam),
    getNextPageParam: (lastPage) => lastPage.nextId,
    getPreviousPageParam: (firstPage) => firstPage.previousId,
});
```

### Correct: the rule accepts this

```js
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.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useTanstackQueryInfiniteQueryPropertyOrder": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [biome/useTanstackQueryExhaustiveDependencies](https://lintradar.dev/rules/biome/useTanstackQueryExhaustiveDependencies.md): Require query keys to include every value that the query function uses.
- [biome/useTanstackQueryMutationPropertyOrder](https://lintradar.dev/rules/biome/useTanstackQueryMutationPropertyOrder.md): Enforce that `onMutate` comes before `onError` and `onSettled` in the options of TanStack Query mutations.
- [biome/useTailwindVariablesShorthand](https://lintradar.dev/rules/biome/useTailwindVariablesShorthand.md): Enforce the shorthand syntax for CSS variables in Tailwind CSS classes.
- [biome/useTanstackQueryQueryOptions](https://lintradar.dev/rules/biome/useTanstackQueryQueryOptions.md): Require TanStack Query options to be created with `queryOptions()`.
- [biome/useSvelteShorthandDirective](https://lintradar.dev/rules/biome/useSvelteShorthandDirective.md): Enforce the shorthand syntax for Svelte `bind:`, `class:`, and `style:` directives.
- [biome/useTanstackQueryStableQueryClient](https://lintradar.dev/rules/biome/useTanstackQueryStableQueryClient.md): Require the TanStack Query `QueryClient` to be created once, not on every render.

---

Web page: https://lintradar.dev/rules/biome/useTanstackQueryInfiniteQueryPropertyOrder. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
