Skip to content

Commit 0451f0d

Browse files
ci: apply automated fixes
1 parent fc49018 commit 0451f0d

3 files changed

Lines changed: 12 additions & 18 deletions

File tree

docs/router/how-to/setup-basic-search-params.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,7 @@ function PostsPage() {
206206
```tsx
207207
const catalogSchema = z.object({
208208
sort: z.enum(['name', 'date', 'price']).default('name'),
209-
category:
210-
z.enum(['electronics', 'clothing', 'books', 'all'])
211-
.default('all'),
209+
category: z.enum(['electronics', 'clothing', 'books', 'all']).default('all'),
212210
ascending: z.boolean().default(true),
213211
})
214212

@@ -224,9 +222,7 @@ export const Route = createFileRoute('/catalog')({
224222
const dashboardSchema = z.object({
225223
// Numbers with validation
226224
userId: z.number().positive().default(1),
227-
refreshInterval: z.number().min(1000).max(60000).default(
228-
5000,
229-
),
225+
refreshInterval: z.number().min(1000).max(60000).default(5000),
230226

231227
// Strings with validation
232228
theme: z.enum(['light', 'dark']).default('light'),
@@ -237,8 +233,8 @@ const dashboardSchema = z.object({
237233
tags: z.string().array().default([]),
238234

239235
// Objects with validation
240-
filters:
241-
z.object({
236+
filters: z
237+
.object({
242238
status: z.enum(['active', 'inactive']).optional(),
243239
type: z.string().optional(),
244240
})

packages/react-router/skills/lifecycle/migrate-from-react-router/SKILL.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,9 @@ import { createFileRoute } from '@tanstack/react-router'
245245
import { z } from 'zod'
246246

247247
export const Route = createFileRoute('/posts')({
248-
validateSearch:
249-
z.object({
250-
page: z.number().default(1).catch(1),
251-
}),
248+
validateSearch: z.object({
249+
page: z.number().default(1).catch(1),
250+
}),
252251
component: Posts,
253252
})
254253

packages/router-core/skills/router-core/search-params/SKILL.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,11 @@ export const Route = createFileRoute('/items')({
238238

239239
```tsx
240240
export const Route = createFileRoute('/search')({
241-
validateSearch:
242-
z.object({
243-
retainMe: z.string().optional(),
244-
arrayWithDefaults: z.string().array().default(['foo', 'bar']),
245-
required: z.string(),
246-
}),
241+
validateSearch: z.object({
242+
retainMe: z.string().optional(),
243+
arrayWithDefaults: z.string().array().default(['foo', 'bar']),
244+
required: z.string(),
245+
}),
247246
search: {
248247
middlewares: [
249248
retainSearchParams(['retainMe']),

0 commit comments

Comments
 (0)