react-doctor/tanstack-start-route-property-order
Follow the order: params/validateSearch → loaderDeps → context → beforeLoad → loader → head. See https://tanstack.com/router/latest/docs/eslint/create-route-property-order
- Category: TanStack Start
- Severity: error
- Source:
oxlint-plugin-react-doctor - Framework: tanstack-start
- Enabled when: framework=tanstack-start and capabilities=tanstack-start
Validation prompt
Use this to decide whether a fired diagnostic is real or a false positive.
Fires (error severity) when properties on a createFileRoute/createRoute/createRootRoute options object appear out of the canonical order: params, validateSearch, loaderDeps, search.middlewares, ssr, context, beforeLoad, loader, onEnter, onStay, onLeave, head, scripts, headers, remountDeps. Only those keys are compared; spreads, computed keys, and unknown keys are skipped. The first out-of-order key is reported.
Fix prompt
Use this once validation confirms the diagnostic is real.
Reorder the options object so each property appears in canonical sequence (params → loaderDeps → context → beforeLoad → loader → head). Each step contributes to the inferred context/loader-data type that later steps consume, so wrong order breaks type inference downstream. See https://tanstack.com/router/latest/docs/eslint/create-route-property-order
Related rules
More TanStack Start rules from the rules reference:
react-doctor/tanstack-start-server-fn-method-order: Chain methods in order: .middleware() → .inputValidator() → .client() → .server() → .handler() — types depend on this sequencereact-doctor/tanstack-start-server-fn-validate-input: Add `.inputValidator(schema)` before `.handler()` — data crosses a network boundary and must be validated at runtimereact-doctor/tanstack-start-missing-head-content: Add `<HeadContent />` inside `<head>` in your __root route — without it, route `head()` meta tags are silently droppedreact-doctor/tanstack-start-no-anchor-element: `import { Link } from '@tanstack/react-router'` — enables type-safe routes, preloading via `preload="intent"`, and client-side navigationreact-doctor/tanstack-start-no-direct-fetch-in-loader: Use `createServerFn()` from @tanstack/react-start — provides type-safe RPC, input validation, and proper server/client code splitting