Skip to content

Commit 0dad6bb

Browse files
autofix-ci[bot]birkskyum
authored andcommitted
ci: apply automated fixes
1 parent 0f7d8c3 commit 0dad6bb

File tree

3 files changed

+72
-70
lines changed

3 files changed

+72
-70
lines changed

e2e/solid-router/basic-file-based/src/routes/transition/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { Link, createFileRoute } from '@tanstack/solid-router'
32
import { Suspense, createResource } from 'solid-js'
43
import { z } from 'zod'

e2e/solid-router/basic-file-based/tests/transition.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ test('transitions should keep old values visible during navigation', async ({
1515

1616
// Poll the body text during the transition
1717
const pollInterval = setInterval(async () => {
18-
const text = await page.locator('body').textContent().catch(() => '')
18+
const text = await page
19+
.locator('body')
20+
.textContent()
21+
.catch(() => '')
1922
if (text) bodyTexts.push(text)
2023
}, 50)
2124

@@ -42,7 +45,7 @@ test('transitions should keep old values visible during navigation', async ({
4245
if (hasLoadingText) {
4346
throw new Error(
4447
'FAILED: "Loading..." appeared during navigation. ' +
45-
'Solid Router should use transitions to keep old values visible.'
48+
'Solid Router should use transitions to keep old values visible.',
4649
)
4750
}
48-
})
51+
})

packages/router-core/src/router.ts

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,22 @@ export type RegisteredConfigType<TRegister, TKey> = TRegister extends {
118118
config: infer TConfig
119119
}
120120
? TConfig extends {
121-
'~types': infer TTypes
122-
}
123-
? TKey extends keyof TTypes
124-
? TTypes[TKey]
125-
: unknown
126-
: unknown
121+
'~types': infer TTypes
122+
}
123+
? TKey extends keyof TTypes
124+
? TTypes[TKey]
125+
: unknown
126+
: unknown
127127
: unknown
128128

129129
export type DefaultRemountDepsFn<TRouteTree extends AnyRoute> = (
130130
opts: MakeRemountDepsOptionsUnion<TRouteTree>,
131131
) => any
132132

133-
export interface DefaultRouterOptionsExtensions { }
133+
export interface DefaultRouterOptionsExtensions {}
134134

135135
export interface RouterOptionsExtensions
136-
extends DefaultRouterOptionsExtensions { }
136+
extends DefaultRouterOptionsExtensions {}
137137

138138
export type SSROption = boolean | 'data-only'
139139

@@ -423,8 +423,8 @@ export interface RouterOptions<
423423
* @default false
424424
*/
425425
scrollRestoration?:
426-
| boolean
427-
| ((opts: { location: ParsedLocation }) => boolean)
426+
| boolean
427+
| ((opts: { location: ParsedLocation }) => boolean)
428428

429429
/**
430430
* A function that will be called to get the key for the scroll restoration cache.
@@ -591,12 +591,12 @@ export type InferRouterContext<TRouteTree extends AnyRoute> =
591591

592592
export type RouterContextOptions<TRouteTree extends AnyRoute> =
593593
AnyContext extends InferRouterContext<TRouteTree>
594-
? {
595-
context?: InferRouterContext<TRouteTree>
596-
}
597-
: {
598-
context: InferRouterContext<TRouteTree>
599-
}
594+
? {
595+
context?: InferRouterContext<TRouteTree>
596+
}
597+
: {
598+
context: InferRouterContext<TRouteTree>
599+
}
600600

601601
export type RouterConstructorOptions<
602602
TRouteTree extends AnyRoute,
@@ -768,14 +768,14 @@ export type AnyRouter = RouterCore<any, any, any, any, any>
768768

769769
export interface ViewTransitionOptions {
770770
types:
771-
| Array<string>
772-
| ((locationChangeInfo: {
773-
fromLocation?: ParsedLocation
774-
toLocation: ParsedLocation
775-
pathChanged: boolean
776-
hrefChanged: boolean
777-
hashChanged: boolean
778-
}) => Array<string> | false)
771+
| Array<string>
772+
| ((locationChangeInfo: {
773+
fromLocation?: ParsedLocation
774+
toLocation: ParsedLocation
775+
pathChanged: boolean
776+
hrefChanged: boolean
777+
hashChanged: boolean
778+
}) => Array<string> | false)
779779
}
780780

781781
// TODO where is this used? can we remove this?
@@ -791,7 +791,7 @@ export function defaultSerializeError(err: unknown) {
791791
}
792792

793793
if (process.env.NODE_ENV === 'development') {
794-
; (obj as any).stack = err.stack
794+
;(obj as any).stack = err.stack
795795
}
796796

797797
return obj
@@ -838,12 +838,12 @@ export type CreateRouterFn = <
838838
options: undefined extends number
839839
? 'strictNullChecks must be enabled in tsconfig.json'
840840
: RouterConstructorOptions<
841-
TRouteTree,
842-
TTrailingSlashOption,
843-
TDefaultStructuralSharingOption,
844-
TRouterHistory,
845-
TDehydrated
846-
>,
841+
TRouteTree,
842+
TTrailingSlashOption,
843+
TDefaultStructuralSharingOption,
844+
TRouterHistory,
845+
TDehydrated
846+
>,
847847
) => RouterCore<
848848
TRouteTree,
849849
TTrailingSlashOption,
@@ -973,11 +973,11 @@ export class RouterCore<
973973

974974
this.pathParamsDecodeCharMap = this.options.pathParamsAllowedCharacters
975975
? new Map(
976-
this.options.pathParamsAllowedCharacters.map((char) => [
977-
encodeURIComponent(char),
978-
char,
979-
]),
980-
)
976+
this.options.pathParamsAllowedCharacters.map((char) => [
977+
encodeURIComponent(char),
978+
char,
979+
]),
980+
)
981981
: undefined
982982

983983
if (
@@ -1250,7 +1250,7 @@ export class RouterCore<
12501250
foundRoute
12511251
? foundRoute.path !== '/' && routeParams['**']
12521252
: // Or if we didn't find a route and we have left over path
1253-
trimPathRight(next.pathname)
1253+
trimPathRight(next.pathname)
12541254
) {
12551255
// If the user has defined an (old) 404 route, use it
12561256
if (this.options.notFoundRoute) {
@@ -1425,9 +1425,9 @@ export class RouterCore<
14251425
} else {
14261426
const status =
14271427
route.options.loader ||
1428-
route.options.beforeLoad ||
1429-
route.lazyFn ||
1430-
routeNeedsPreload(route)
1428+
route.options.beforeLoad ||
1429+
route.lazyFn ||
1430+
routeNeedsPreload(route)
14311431
? 'pending'
14321432
: 'success'
14331433

@@ -1645,9 +1645,9 @@ export class RouterCore<
16451645
: (dest.params ?? true) === true
16461646
? fromParams
16471647
: Object.assign(
1648-
fromParams,
1649-
functionalUpdate(dest.params as any, fromParams),
1650-
)
1648+
fromParams,
1649+
functionalUpdate(dest.params as any, fromParams),
1650+
)
16511651

16521652
// Interpolate the path first to get the actual resolved path, then match against that
16531653
const interpolatedNextTo = interpolatePath({
@@ -1844,7 +1844,7 @@ export class RouterCore<
18441844
'__hashScrollIntoViewOptions',
18451845
] as const
18461846
ignoredProps.forEach((prop) => {
1847-
; (next.state as any)[prop] = this.latestLocation.state[prop]
1847+
;(next.state as any)[prop] = this.latestLocation.state[prop]
18481848
})
18491849
const isEqual = deepEqual(next.state, this.latestLocation.state)
18501850
ignoredProps.forEach((prop) => {
@@ -1967,7 +1967,7 @@ export class RouterCore<
19671967
try {
19681968
new URL(`${href}`)
19691969
reloadDocument = true
1970-
} catch { }
1970+
} catch {}
19711971
}
19721972

19731973
if (reloadDocument) {
@@ -2133,18 +2133,18 @@ export class RouterCore<
21332133
})
21342134
})
21352135

2136-
//
2137-
; (
2138-
[
2139-
[exitingMatches, 'onLeave'],
2140-
[enteringMatches, 'onEnter'],
2141-
[stayingMatches, 'onStay'],
2142-
] as const
2143-
).forEach(([matches, hook]) => {
2144-
matches.forEach((match) => {
2145-
this.looseRoutesById[match.routeId]!.options[hook]?.(match)
2146-
})
2136+
//
2137+
;(
2138+
[
2139+
[exitingMatches, 'onLeave'],
2140+
[enteringMatches, 'onEnter'],
2141+
[stayingMatches, 'onStay'],
2142+
] as const
2143+
).forEach(([matches, hook]) => {
2144+
matches.forEach((match) => {
2145+
this.looseRoutesById[match.routeId]!.options[hook]?.(match)
21472146
})
2147+
})
21482148
})
21492149
},
21502150
})
@@ -2239,11 +2239,11 @@ export class RouterCore<
22392239
const resolvedViewTransitionTypes =
22402240
typeof shouldViewTransition.types === 'function'
22412241
? shouldViewTransition.types(
2242-
getLocationChangeInfo({
2243-
resolvedLocation: prevLocation,
2244-
location: next,
2245-
}),
2246-
)
2242+
getLocationChangeInfo({
2243+
resolvedLocation: prevLocation,
2244+
location: next,
2245+
}),
2246+
)
22472247
: shouldViewTransition.types
22482248

22492249
if (resolvedViewTransitionTypes === false) {
@@ -2472,9 +2472,9 @@ export class RouterCore<
24722472
...location,
24732473
to: location.to
24742474
? this.resolvePathWithBase(
2475-
(location.from || '') as string,
2476-
location.to as string,
2477-
)
2475+
(location.from || '') as string,
2476+
location.to as string,
2477+
)
24782478
: undefined,
24792479
params: location.params || {},
24802480
leaveParams: true,
@@ -2533,10 +2533,10 @@ export class RouterCore<
25332533
}
25342534

25352535
/** Error thrown when search parameter validation fails. */
2536-
export class SearchParamError extends Error { }
2536+
export class SearchParamError extends Error {}
25372537

25382538
/** Error thrown when path parameter parsing/validation fails. */
2539-
export class PathParamError extends Error { }
2539+
export class PathParamError extends Error {}
25402540

25412541
const normalize = (str: string) =>
25422542
str.endsWith('/') && str.length > 1 ? str.slice(0, -1) : str

0 commit comments

Comments
 (0)