docs: fix syntax error in create-route-property-order.md#6699
Conversation
📝 WalkthroughWalkthroughDocumentation 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
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
View your CI Pipeline Execution ↗ for commit a4c9017
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
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 | 🟡 MinorResidual 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)), // ^ invalidA 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 (
loaderbeforebeforeLoad), 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.
The comma inside the loader caused a syntax error in both examples.