Skip to content

Commit c849109

Browse files
ci: apply automated fixes
1 parent feeb12f commit c849109

File tree

4 files changed

+154
-141
lines changed

4 files changed

+154
-141
lines changed

e2e/solid-start/basic-cloudflare/worker-configuration.d.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22
// Generated by Wrangler by running `wrangler types` (hash: b11df627d8b3c51b1bf3230a546b0f20)
33
// Runtime types generated with [email protected] 2025-09-24 nodejs_compat
44
declare namespace Cloudflare {
5-
interface Env {
6-
MY_VAR: "Hello from Cloudflare";
7-
}
5+
interface Env {
6+
MY_VAR: 'Hello from Cloudflare'
7+
}
88
}
99
interface Env extends Cloudflare.Env {}
1010
type StringifyValues<EnvType extends Record<string, unknown>> = {
11-
[Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string;
12-
};
11+
[Binding in keyof EnvType]: EnvType[Binding] extends string
12+
? EnvType[Binding]
13+
: string
14+
}
1315
declare namespace NodeJS {
14-
interface ProcessEnv extends StringifyValues<Pick<Cloudflare.Env, "MY_VAR">> {}
16+
interface ProcessEnv
17+
extends StringifyValues<Pick<Cloudflare.Env, 'MY_VAR'>> {}
1518
}
1619

1720
// Begin runtime types

packages/react-router/src/typePrimitives.ts

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,24 @@ export type ValidateLinkOptions<
1919
TOptions = unknown,
2020
TDefaultFrom extends string = string,
2121
TComp = 'a',
22-
> = TOptions extends LinkComponentProps<
23-
TComp,
24-
TRouter,
25-
InferFrom<TOptions, TDefaultFrom>,
26-
InferTo<TOptions>,
27-
InferMaskFrom<TOptions>,
28-
InferMaskTo<TOptions>
29-
>
30-
? TOptions
31-
: LinkComponentProps<
32-
TComp,
33-
TRouter,
34-
InferFrom<TOptions, TDefaultFrom>,
35-
InferTo<TOptions>,
36-
InferMaskFrom<TOptions>,
37-
InferMaskTo<TOptions>
38-
>
22+
> =
23+
TOptions extends LinkComponentProps<
24+
TComp,
25+
TRouter,
26+
InferFrom<TOptions, TDefaultFrom>,
27+
InferTo<TOptions>,
28+
InferMaskFrom<TOptions>,
29+
InferMaskTo<TOptions>
30+
>
31+
? TOptions
32+
: LinkComponentProps<
33+
TComp,
34+
TRouter,
35+
InferFrom<TOptions, TDefaultFrom>,
36+
InferTo<TOptions>,
37+
InferMaskFrom<TOptions>,
38+
InferMaskTo<TOptions>
39+
>
3940

4041
/**
4142
* @private
@@ -49,44 +50,46 @@ export type InferStructuralSharing<TOptions> = TOptions extends {
4950
export type ValidateUseSearchOptions<
5051
TOptions,
5152
TRouter extends AnyRouter = RegisteredRouter,
52-
> = TOptions extends UseSearchOptions<
53-
TRouter,
54-
InferFrom<TOptions>,
55-
InferStrict<TOptions>,
56-
InferShouldThrow<TOptions>,
57-
InferSelected<TOptions>,
58-
InferStructuralSharing<TOptions>
59-
>
60-
? TOptions
61-
: UseSearchOptions<
62-
TRouter,
63-
InferFrom<TOptions>,
64-
InferStrict<TOptions>,
65-
InferShouldThrow<TOptions>,
66-
InferSelected<TOptions>,
67-
InferStructuralSharing<TOptions>
68-
>
53+
> =
54+
TOptions extends UseSearchOptions<
55+
TRouter,
56+
InferFrom<TOptions>,
57+
InferStrict<TOptions>,
58+
InferShouldThrow<TOptions>,
59+
InferSelected<TOptions>,
60+
InferStructuralSharing<TOptions>
61+
>
62+
? TOptions
63+
: UseSearchOptions<
64+
TRouter,
65+
InferFrom<TOptions>,
66+
InferStrict<TOptions>,
67+
InferShouldThrow<TOptions>,
68+
InferSelected<TOptions>,
69+
InferStructuralSharing<TOptions>
70+
>
6971

7072
export type ValidateUseParamsOptions<
7173
TOptions,
7274
TRouter extends AnyRouter = RegisteredRouter,
73-
> = TOptions extends UseParamsOptions<
74-
TRouter,
75-
InferFrom<TOptions>,
76-
InferStrict<TOptions>,
77-
InferShouldThrow<TOptions>,
78-
InferSelected<TOptions>,
79-
InferSelected<TOptions>
80-
>
81-
? TOptions
82-
: UseParamsOptions<
83-
TRouter,
84-
InferFrom<TOptions>,
85-
InferStrict<TOptions>,
86-
InferShouldThrow<TOptions>,
87-
InferSelected<TOptions>,
88-
InferSelected<TOptions>
89-
>
75+
> =
76+
TOptions extends UseParamsOptions<
77+
TRouter,
78+
InferFrom<TOptions>,
79+
InferStrict<TOptions>,
80+
InferShouldThrow<TOptions>,
81+
InferSelected<TOptions>,
82+
InferSelected<TOptions>
83+
>
84+
? TOptions
85+
: UseParamsOptions<
86+
TRouter,
87+
InferFrom<TOptions>,
88+
InferStrict<TOptions>,
89+
InferShouldThrow<TOptions>,
90+
InferSelected<TOptions>,
91+
InferSelected<TOptions>
92+
>
9093
export type ValidateLinkOptionsArray<
9194
TRouter extends AnyRouter = RegisteredRouter,
9295
TOptions extends ReadonlyArray<any> = ReadonlyArray<unknown>,
Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
import { describe, expect, test } from 'vitest'
22
import { createFileRoute } from '../src/fileRoute'
3-
import type {
4-
ValidateLinkOptions,
5-
ValidateUseSearchOptions,
6-
ValidateUseParamsOptions
3+
import type {
4+
ValidateLinkOptions,
5+
ValidateUseSearchOptions,
6+
ValidateUseParamsOptions,
77
} from '../src/typePrimitives'
8-
import type {
9-
ValidateNavigateOptions,
10-
ValidateRedirectOptions
8+
import type {
9+
ValidateNavigateOptions,
10+
ValidateRedirectOptions,
1111
} from '@tanstack/router-core'
1212

1313
describe('Validation types regression tests', () => {
1414
test('should not cause TypeScript circular reference error in loader return type', () => {
1515
// This test ensures that ValidateLinkOptions can be used in loader return types
1616
// without causing the TypeScript error:
1717
// 'loader' implicitly has return type 'any' because it does not have a return type annotation
18-
18+
1919
const route = createFileRoute('/user/$userId')({
2020
loader: (): { breadcrumbs: ValidateLinkOptions } => {
2121
const breadcrumbs: ValidateLinkOptions = {
2222
to: '/user/$userId',
23-
params: { userId: '123' }
23+
params: { userId: '123' },
2424
}
25-
25+
2626
return {
27-
breadcrumbs
27+
breadcrumbs,
2828
}
2929
},
30-
component: () => <div>User</div>
30+
component: () => <div>User</div>,
3131
})
3232

3333
expect(route).toBeDefined()
@@ -38,14 +38,14 @@ describe('Validation types regression tests', () => {
3838
loader: () => {
3939
const linkOptions: ValidateLinkOptions = {
4040
to: '/profile/$userId',
41-
params: { userId: '456' }
41+
params: { userId: '456' },
4242
}
43-
43+
4444
return {
45-
navigation: linkOptions
45+
navigation: linkOptions,
4646
}
4747
},
48-
component: () => <div>Profile</div>
48+
component: () => <div>Profile</div>,
4949
})
5050

5151
expect(route).toBeDefined()
@@ -56,84 +56,88 @@ describe('Validation types regression tests', () => {
5656
loader: () => {
5757
const breadcrumbs: ValidateLinkOptions[] = [
5858
{ to: '/' },
59-
{ to: '/dashboard' }
59+
{ to: '/dashboard' },
6060
]
61-
61+
6262
return {
63-
breadcrumbs
63+
breadcrumbs,
6464
}
6565
},
66-
component: () => <div>Dashboard</div>
66+
component: () => <div>Dashboard</div>,
6767
})
6868

6969
expect(route).toBeDefined()
7070
})
7171

7272
test('should work with ValidateNavigateOptions in loader', () => {
73-
const route = createFileRoute('/navigate-test')({
73+
const route = createFileRoute('/navigate-test')({
7474
loader: () => {
7575
const navOptions: ValidateNavigateOptions = {
76-
to: '/dashboard'
76+
to: '/dashboard',
7777
}
78-
78+
7979
return {
80-
navOptions
80+
navOptions,
8181
}
8282
},
83-
component: () => <div>Navigate Test</div>
83+
component: () => <div>Navigate Test</div>,
8484
})
8585

8686
expect(route).toBeDefined()
8787
})
8888

8989
test('should work with ValidateRedirectOptions in loader', () => {
90-
const route = createFileRoute('/redirect-test')({
90+
const route = createFileRoute('/redirect-test')({
9191
loader: () => {
9292
const redirectOptions: ValidateRedirectOptions = {
93-
to: '/login'
93+
to: '/login',
9494
}
95-
95+
9696
return {
97-
redirectOptions
97+
redirectOptions,
9898
}
9999
},
100-
component: () => <div>Redirect Test</div>
100+
component: () => <div>Redirect Test</div>,
101101
})
102102

103103
expect(route).toBeDefined()
104104
})
105105

106106
test('should work with ValidateUseSearchOptions in loader', () => {
107-
const route = createFileRoute('/search-test')({
107+
const route = createFileRoute('/search-test')({
108108
loader: () => {
109-
const searchOptions: ValidateUseSearchOptions<{ from: '/search-test' }> = {
109+
const searchOptions: ValidateUseSearchOptions<{
110110
from: '/search-test'
111+
}> = {
112+
from: '/search-test',
111113
}
112-
114+
113115
return {
114-
searchOptions
116+
searchOptions,
115117
}
116118
},
117-
component: () => <div>Search Test</div>
119+
component: () => <div>Search Test</div>,
118120
})
119121

120122
expect(route).toBeDefined()
121123
})
122124

123125
test('should work with ValidateUseParamsOptions in loader', () => {
124-
const route = createFileRoute('/params-test/$id')({
126+
const route = createFileRoute('/params-test/$id')({
125127
loader: () => {
126-
const paramsOptions: ValidateUseParamsOptions<{ from: '/params-test/$id' }> = {
128+
const paramsOptions: ValidateUseParamsOptions<{
127129
from: '/params-test/$id'
130+
}> = {
131+
from: '/params-test/$id',
128132
}
129-
133+
130134
return {
131-
paramsOptions
135+
paramsOptions,
132136
}
133137
},
134-
component: () => <div>Params Test</div>
138+
component: () => <div>Params Test</div>,
135139
})
136140

137141
expect(route).toBeDefined()
138142
})
139-
})
143+
})

0 commit comments

Comments
 (0)