Skip to content

docs: fix syntax error in create-route-property-order.md#6699

Merged
schiller-manuel merged 2 commits intoTanStack:mainfrom
ulrichstark:fix-syntax-error-in-create-route-property-order
Feb 19, 2026
Merged

docs: fix syntax error in create-route-property-order.md#6699
schiller-manuel merged 2 commits intoTanStack:mainfrom
ulrichstark:fix-syntax-error-in-create-route-property-order

Conversation

@ulrichstark
Copy link
Contributor

@ulrichstark ulrichstark commented Feb 19, 2026

The comma inside the loader caused a syntax error in both examples.

@github-actions github-actions bot added the documentation Everything documentation related label Feb 19, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

📝 Walkthrough

Walkthrough

Documentation examples are reformatted with consistent spacing around object literals and destructured parameters. A trailing comma is added to the loader property example. No behavioral or semantic changes are introduced.

Changes

Cohort / File(s) Summary
Documentation Formatting
docs/router/eslint/create-route-property-order.md
Code examples updated with consistent spacing: object literals and destructured parameters now include surrounding whitespace (e.g., { hello: 'world' }, ({ context })). Trailing comma added after loader property example.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

✨ With spaces so neat and commas aligned,
Our docs now sparkle, refined and designed!
Formatting flourishes, small but precise—
A rabbit's delight in code paradise! 🐰

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: fixing syntax errors in the documentation file by adjusting spacing and formatting in code examples.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Feb 19, 2026

View your CI Pipeline Execution ↗ for commit a4c9017

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded <1s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-19 07:41:12 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 19, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@6699

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@6699

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@6699

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@6699

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@6699

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@6699

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@6699

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@6699

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@6699

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@6699

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@6699

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@6699

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@6699

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@6699

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@6699

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@6699

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@6699

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@6699

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@6699

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@6699

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@6699

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@6699

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@6699

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@6699

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@6699

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@6699

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-fn-stubs@6699

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@6699

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@6699

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@6699

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@6699

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@6699

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@6699

@tanstack/vue-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router@6699

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router-devtools@6699

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router-ssr-query@6699

@tanstack/vue-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start@6699

@tanstack/vue-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-client@6699

@tanstack/vue-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-server@6699

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@6699

commit: a4c9017

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/router/eslint/create-route-property-order.md (1)

38-43: ⚠️ Potential issue | 🟡 Minor

Residual syntax error in the "incorrect" examples.

Lines 40 and 58 still carry the same trailing-comma syntax error that was just fixed in the "correct" examples:

await context.queryClient.ensureQueryData(getQueryOptions(context.hello)),
//                                                                        ^ invalid

A comma is not a valid statement terminator inside a block body in TypeScript/JavaScript. These examples are intended to illustrate only the property-order violation (loader before beforeLoad), so an unrelated syntax error is misleading and should be removed here too.

📝 Proposed fix for both incorrect examples
- loader: async ({context}) => {
-   await context.queryClient.ensureQueryData(getQueryOptions(context.hello)),
- },
- beforeLoad: () => ({hello: 'world'})
+ loader: async ({context}) => {
+   await context.queryClient.ensureQueryData(getQueryOptions(context.hello))
+ },
+ beforeLoad: () => ({hello: 'world'})

Also applies to: 56-61

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/router/eslint/create-route-property-order.md` around lines 38 - 43, The
"incorrect" examples for Route using createFileRoute contain a stray trailing
comma after the await
context.queryClient.ensureQueryData(getQueryOptions(context.hello)) call which
produces a syntax error; edit the examples (the Route declaration with loader
and beforeLoad) to remove the trailing comma after ensureQueryData(...) in both
occurrences (the loader async body lines) so the examples only illustrate the
loader-before-beforeLoad property-order issue without introducing an unrelated
syntax error.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/router/eslint/create-route-property-order.md`:
- Around line 38-43: The "incorrect" examples for Route using createFileRoute
contain a stray trailing comma after the await
context.queryClient.ensureQueryData(getQueryOptions(context.hello)) call which
produces a syntax error; edit the examples (the Route declaration with loader
and beforeLoad) to remove the trailing comma after ensureQueryData(...) in both
occurrences (the loader async body lines) so the examples only illustrate the
loader-before-beforeLoad property-order issue without introducing an unrelated
syntax error.

@schiller-manuel schiller-manuel merged commit c87d848 into TanStack:main Feb 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Everything documentation related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants