From 92f16d310da3f593cf44fe0e39b0aa61ff1dc719 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sun, 8 Nov 2026 11:48:18 +0000 Subject: [PATCH] ci: apply automated fixes --- DEBUGGING.md | 4 +-- .../interrupted-navigations/shared.ts | 10 +++--- .../ssr/scenarios/assets/react/src/server.ts | 3 +- .../ssr/scenarios/assets/solid/src/server.ts | 3 +- .../ssr/scenarios/assets/vue/src/server.ts | 3 +- docs/router/api/router/LinkPropsType.md | 3 +- docs/router/api/router/ToOptionsType.md | 4 +-- .../api/router/ViewTransitionOptionsType.md | 10 +++--- docs/router/guide/navigation.md | 6 ++-- docs/router/how-to/debug-router-issues.md | 12 ++----- .../framework/react/guide/early-hints.md | 3 +- .../react/guide/import-protection.md | 4 +-- .../internal/prismaNamespace.ts | 5 ++- .../src/prisma-generated/models/User.ts | 34 +++++++------------ .../internal/prismaNamespace.ts | 5 ++- .../src/prisma-generated/models/User.ts | 34 +++++++------------ .../internal/prismaNamespace.ts | 5 ++- .../src/prisma-generated/models/User.ts | 34 +++++++------------ .../internal/prismaNamespace.ts | 5 ++- .../src/prisma-generated/models/User.ts | 34 +++++++------------ .../internal/prismaNamespace.ts | 5 ++- .../src/prisma-generated/models/User.ts | 34 +++++++------------ .../convex/_generated/api.d.ts | 14 ++------ .../eslint-plugin-start/lint-improvements.md | 4 +-- .../render-graph-builder.ts | 3 +- packages/react-router/src/link.tsx | 5 ++- .../src/nonRouteComponentContext.tsx | 4 +-- packages/react-router/src/route.tsx | 3 +- .../src/ssr/renderRouterToStream.tsx | 3 +- packages/react-router/src/utils.ts | 5 +-- packages/react-start-client/src/Hydrate.tsx | 3 +- .../react-start-rsc/src/RscNodeRenderer.tsx | 6 ++-- .../src/ServerComponentTypes.ts | 8 +---- .../src/createCompositeComponent.ts | 4 +-- .../src/serialization.server.ts | 3 +- packages/router-core/src/load-client.ts | 17 +++------- packages/router-core/src/manifest.ts | 3 +- .../router-core/src/new-process-route-tree.ts | 10 +++--- packages/router-core/src/routeInfo.ts | 15 ++++---- packages/router-core/src/router.ts | 6 ++-- .../router-core/src/ssr/hydrationScripts.ts | 5 +-- .../src/ssr/serializer/transformer.ts | 3 +- packages/router-core/src/structuralSharing.ts | 3 +- packages/router-core/src/utils.ts | 18 ++++------ .../router-devtools-core/src/useStyles.tsx | 16 +++++---- .../src/core/code-splitter/compilers.ts | 10 +++--- packages/router-plugin/src/core/config.ts | 6 ++-- .../src/core/hmr/handle-route-update.ts | 3 +- .../router-plugin/tests/regression-helpers.ts | 4 +-- packages/solid-router/src/Match.tsx | 4 +-- packages/solid-router/src/link.tsx | 14 +++----- .../src/nonRouteComponentContext.tsx | 4 +-- .../tests/server/lazyRouteComponent.test.tsx | 9 +++-- packages/solid-start-client/src/Hydrate.tsx | 3 +- .../src/createCsrfMiddleware.ts | 5 +-- .../start-client-core/src/createMiddleware.ts | 8 ++--- .../src/getDefaultSerovalPlugins.ts | 3 +- .../src/getGlobalStartContext.ts | 24 ++++++------- .../start-client-core/src/hydration/types.ts | 3 +- packages/start-client-core/src/serverRoute.ts | 16 ++------- .../start-plugin-core/src/build-sitemap.ts | 8 +---- .../start-plugin-core/src/config-context.ts | 3 +- .../src/import-protection/analysis.ts | 30 +++++++--------- packages/start-plugin-core/src/schema.ts | 12 +++---- .../src/start-compiler/compiler.ts | 4 +-- packages/start-plugin-core/src/types.ts | 11 ++---- packages/start-plugin-core/src/vite/types.ts | 3 +- .../src/createStartHandler.ts | 3 +- packages/start-server-core/src/early-hints.ts | 3 +- packages/start-server-core/src/inlineCss.ts | 3 +- .../tests/createStartHandler.test.ts | 3 +- .../server-functions-reconciliation.test.ts | 3 +- packages/virtual-file-routes/src/types.ts | 5 +-- packages/vue-router/src/link.tsx | 2 +- .../src/nonRouteComponentContext.tsx | 4 +-- pnpm-workspace.yaml | 2 +- 76 files changed, 224 insertions(+), 412 deletions(-) diff --git a/DEBUGGING.md b/DEBUGGING.md index b29605b2fb..b08ada3a54 100644 --- a/DEBUGGING.md +++ b/DEBUGGING.md @@ -77,9 +77,7 @@ console.log('[DEBUG buildLocation] output:', result) ```javascript test('should reproduce the exact issue from bug report', async () => { // Set up the exact scenario described - const router = createRouter({ - /* exact config from bug report */ - }) + const router = createRouter({/* exact config from bug report */}) // Perform the exact user actions await navigate({ to: '/initial-route' }) diff --git a/benchmarks/memory/client/scenarios/interrupted-navigations/shared.ts b/benchmarks/memory/client/scenarios/interrupted-navigations/shared.ts index 80f234f0c8..247562c145 100644 --- a/benchmarks/memory/client/scenarios/interrupted-navigations/shared.ts +++ b/benchmarks/memory/client/scenarios/interrupted-navigations/shared.ts @@ -225,12 +225,10 @@ export function createWorkload( return navigation .then((value): NavigationSettlement => ({ status: 'fulfilled', value })) - .catch( - (reason: unknown): NavigationSettlement => ({ - status: 'rejected', - reason, - }), - ) + .catch((reason: unknown): NavigationSettlement => ({ + status: 'rejected', + reason, + })) } await router.load() diff --git a/benchmarks/ssr/scenarios/assets/react/src/server.ts b/benchmarks/ssr/scenarios/assets/react/src/server.ts index 64fb21708c..aea860b7f2 100644 --- a/benchmarks/ssr/scenarios/assets/react/src/server.ts +++ b/benchmarks/ssr/scenarios/assets/react/src/server.ts @@ -9,8 +9,7 @@ import type { } from '@tanstack/react-start/server' type CreateTransformContext = - | { warmup: true } - | { request: Request; warmup: false } + { warmup: true } | { request: Request; warmup: false } const cdnOrigin = 'https://cdn.example.com' diff --git a/benchmarks/ssr/scenarios/assets/solid/src/server.ts b/benchmarks/ssr/scenarios/assets/solid/src/server.ts index 541e776a79..95f1c2c921 100644 --- a/benchmarks/ssr/scenarios/assets/solid/src/server.ts +++ b/benchmarks/ssr/scenarios/assets/solid/src/server.ts @@ -9,8 +9,7 @@ import type { } from '@tanstack/solid-start/server' type CreateTransformContext = - | { warmup: true } - | { request: Request; warmup: false } + { warmup: true } | { request: Request; warmup: false } const cdnOrigin = 'https://cdn.example.com' diff --git a/benchmarks/ssr/scenarios/assets/vue/src/server.ts b/benchmarks/ssr/scenarios/assets/vue/src/server.ts index fd1e83d6b8..96ece21403 100644 --- a/benchmarks/ssr/scenarios/assets/vue/src/server.ts +++ b/benchmarks/ssr/scenarios/assets/vue/src/server.ts @@ -9,8 +9,7 @@ import type { } from '@tanstack/vue-start/server' type CreateTransformContext = - | { warmup: true } - | { request: Request; warmup: false } + { warmup: true } | { request: Request; warmup: false } const cdnOrigin = 'https://cdn.example.com' diff --git a/docs/router/api/router/LinkPropsType.md b/docs/router/api/router/LinkPropsType.md index e8df561a97..5b0dd85d5a 100644 --- a/docs/router/api/router/LinkPropsType.md +++ b/docs/router/api/router/LinkPropsType.md @@ -9,8 +9,7 @@ The `LinkProps` type extends the [`ActiveLinkOptions`](./ActiveLinkOptionsType.m type LinkProps = ActiveLinkOptions & Omit, 'children'> & { children?: - | React.ReactNode - | ((state: { isActive: boolean }) => React.ReactNode) + React.ReactNode | ((state: { isActive: boolean }) => React.ReactNode) } ``` diff --git a/docs/router/api/router/ToOptionsType.md b/docs/router/api/router/ToOptionsType.md index 909d2bbe28..267d55a592 100644 --- a/docs/router/api/router/ToOptionsType.md +++ b/docs/router/api/router/ToOptionsType.md @@ -21,9 +21,7 @@ type SearchParamOptions = { type PathParamOptions = { params?: - | true - | Record - | ((prev: TFromParams) => TToParams) + true | Record | ((prev: TFromParams) => TToParams) } type MaskOptions = { diff --git a/docs/router/api/router/ViewTransitionOptionsType.md b/docs/router/api/router/ViewTransitionOptionsType.md index 12ee4ca36f..1e64bccb5c 100644 --- a/docs/router/api/router/ViewTransitionOptionsType.md +++ b/docs/router/api/router/ViewTransitionOptionsType.md @@ -27,11 +27,11 @@ The `ViewTransitionOptions` type accepts an object with a single property: ### `types` property - Type: `Array | ((locationChangeInfo: { - fromLocation?: ParsedLocation - toLocation: ParsedLocation - pathChanged: boolean - hrefChanged: boolean - hashChanged: boolean +fromLocation?: ParsedLocation +toLocation: ParsedLocation +pathChanged: boolean +hrefChanged: boolean +hashChanged: boolean }) => (Array | false))` - Required - Either one of: diff --git a/docs/router/guide/navigation.md b/docs/router/guide/navigation.md index dc9c46e57e..537cc4609b 100644 --- a/docs/router/guide/navigation.md +++ b/docs/router/guide/navigation.md @@ -167,12 +167,10 @@ export type LinkProps< > = LinkOptions & { // A function that returns additional props for the `active` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated) activeProps?: - | FrameworkHTMLAnchorTagAttributes - | (() => FrameworkHTMLAnchorAttributes) + FrameworkHTMLAnchorTagAttributes | (() => FrameworkHTMLAnchorAttributes) // A function that returns additional props for the `inactive` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated) inactiveProps?: - | FrameworkHTMLAnchorAttributes - | (() => FrameworkHTMLAnchorAttributes) + FrameworkHTMLAnchorAttributes | (() => FrameworkHTMLAnchorAttributes) } ``` diff --git a/docs/router/how-to/debug-router-issues.md b/docs/router/how-to/debug-router-issues.md index 27dadd361f..b8beccd23f 100644 --- a/docs/router/how-to/debug-router-issues.md +++ b/docs/router/how-to/debug-router-issues.md @@ -268,9 +268,7 @@ const route = createRoute({ // Add to router configuration const router = createRouter({ routeTree, - context: { - /* ... */ - }, + context: {/* ... */}, // Log all navigation events onNavigate: ({ location, type }) => { console.log(`Navigation (${type}):`, location.pathname) @@ -479,9 +477,7 @@ function MyComponent() { // Add to router configuration const router = createRouter({ routeTree, - context: { - /* ... */ - }, + context: {/* ... */}, onUpdate: (router) => { console.log('Router state updated:', { pathname: router.state.location.pathname, @@ -723,9 +719,7 @@ Monitor these requests when debugging: ```tsx const router = createRouter({ routeTree, - context: { - /* ... */ - }, + context: {/* ... */}, onUpdate: (router) => { performance.mark('router-update') }, diff --git a/docs/start/framework/react/guide/early-hints.md b/docs/start/framework/react/guide/early-hints.md index 2341215022..2d7b9795fb 100644 --- a/docs/start/framework/react/guide/early-hints.md +++ b/docs/start/framework/react/guide/early-hints.md @@ -236,8 +236,7 @@ export default createServerEntry({ if (phase !== 'static' || !links.length) return const response = getNodeResponseSomehow(request) as - | ServerResponse - | undefined + ServerResponse | undefined response?.writeEarlyHints({ link: links }) }, diff --git a/docs/start/framework/react/guide/import-protection.md b/docs/start/framework/react/guide/import-protection.md index 451d405f81..1a17280489 100644 --- a/docs/start/framework/react/guide/import-protection.md +++ b/docs/start/framework/react/guide/import-protection.md @@ -525,9 +525,7 @@ importProtection: { interface ImportProtectionOptions { enabled?: boolean behavior?: - | 'error' - | 'mock' - | { dev?: 'error' | 'mock'; build?: 'error' | 'mock' } + 'error' | 'mock' | { dev?: 'error' | 'mock'; build?: 'error' | 'mock' } log?: 'once' | 'always' include?: Array exclude?: Array diff --git a/e2e/react-start/basic-auth/src/prisma-generated/internal/prismaNamespace.ts b/e2e/react-start/basic-auth/src/prisma-generated/internal/prismaNamespace.ts index f420c55329..02c12a3cd4 100644 --- a/e2e/react-start/basic-auth/src/prisma-generated/internal/prismaNamespace.ts +++ b/e2e/react-start/basic-auth/src/prisma-generated/internal/prismaNamespace.ts @@ -307,9 +307,8 @@ type NoExpand = T extends unknown ? T : never // this type assumes the passed object is entirely optional export type AtLeast = NoExpand< O extends unknown - ? - | (K extends keyof O ? { [P in K]: O[P] } & O : O) - | ({ [P in keyof O as P extends K ? P : never]-?: O[P] } & O) + ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) + | ({ [P in keyof O as P extends K ? P : never]-?: O[P] } & O) : never > diff --git a/e2e/react-start/basic-auth/src/prisma-generated/models/User.ts b/e2e/react-start/basic-auth/src/prisma-generated/models/User.ts index 4312db9bd9..1444b9daa9 100644 --- a/e2e/react-start/basic-auth/src/prisma-generated/models/User.ts +++ b/e2e/react-start/basic-auth/src/prisma-generated/models/User.ts @@ -70,8 +70,7 @@ export type UserAggregateArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -780,9 +779,9 @@ export interface UserDelegate< Prisma.Extends<'skip', Prisma.Keys>, Prisma.Extends<'take', Prisma.Keys> >, - OrderByArg extends Prisma.True extends HasSelectOrTake + OrderByArg extends (Prisma.True extends HasSelectOrTake ? { orderBy: UserGroupByArgs['orderBy'] } - : { orderBy?: UserGroupByArgs['orderBy'] }, + : { orderBy?: UserGroupByArgs['orderBy'] }), OrderFields extends Prisma.ExcludeUnderscoreKeys< Prisma.Keys> >, @@ -790,8 +789,8 @@ export interface UserDelegate< ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, - ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, - InputErrors extends ByEmpty extends Prisma.True + ByEmpty extends (T['by'] extends never[] ? Prisma.True : Prisma.False), + InputErrors extends (ByEmpty extends Prisma.True ? `Error: "by" must not be empty.` : HavingValid extends Prisma.False ? { @@ -832,7 +831,7 @@ export interface UserDelegate< [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields], + }[OrderFields]), >( args: Prisma.SubsetIntersection & InputErrors, @@ -867,13 +866,9 @@ export interface Prisma__UserClient< */ then( onfulfilled?: - | ((value: T) => TResult1 | PromiseLike) - | undefined - | null, + ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: - | ((reason: any) => TResult2 | PromiseLike) - | undefined - | null, + ((reason: any) => TResult2 | PromiseLike) | undefined | null, ): runtime.Types.Utils.JsPromise /** * Attaches a callback for only the rejection of the Promise. @@ -882,9 +877,7 @@ export interface Prisma__UserClient< */ catch( onrejected?: - | ((reason: any) => TResult | PromiseLike) - | undefined - | null, + ((reason: any) => TResult | PromiseLike) | undefined | null, ): runtime.Types.Utils.JsPromise /** * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The @@ -973,8 +966,7 @@ export type UserFindFirstArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -1026,8 +1018,7 @@ export type UserFindFirstOrThrowArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -1079,8 +1070,7 @@ export type UserFindManyArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * diff --git a/e2e/solid-start/basic-auth/src/prisma-generated/internal/prismaNamespace.ts b/e2e/solid-start/basic-auth/src/prisma-generated/internal/prismaNamespace.ts index f420c55329..02c12a3cd4 100644 --- a/e2e/solid-start/basic-auth/src/prisma-generated/internal/prismaNamespace.ts +++ b/e2e/solid-start/basic-auth/src/prisma-generated/internal/prismaNamespace.ts @@ -307,9 +307,8 @@ type NoExpand = T extends unknown ? T : never // this type assumes the passed object is entirely optional export type AtLeast = NoExpand< O extends unknown - ? - | (K extends keyof O ? { [P in K]: O[P] } & O : O) - | ({ [P in keyof O as P extends K ? P : never]-?: O[P] } & O) + ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) + | ({ [P in keyof O as P extends K ? P : never]-?: O[P] } & O) : never > diff --git a/e2e/solid-start/basic-auth/src/prisma-generated/models/User.ts b/e2e/solid-start/basic-auth/src/prisma-generated/models/User.ts index 4312db9bd9..1444b9daa9 100644 --- a/e2e/solid-start/basic-auth/src/prisma-generated/models/User.ts +++ b/e2e/solid-start/basic-auth/src/prisma-generated/models/User.ts @@ -70,8 +70,7 @@ export type UserAggregateArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -780,9 +779,9 @@ export interface UserDelegate< Prisma.Extends<'skip', Prisma.Keys>, Prisma.Extends<'take', Prisma.Keys> >, - OrderByArg extends Prisma.True extends HasSelectOrTake + OrderByArg extends (Prisma.True extends HasSelectOrTake ? { orderBy: UserGroupByArgs['orderBy'] } - : { orderBy?: UserGroupByArgs['orderBy'] }, + : { orderBy?: UserGroupByArgs['orderBy'] }), OrderFields extends Prisma.ExcludeUnderscoreKeys< Prisma.Keys> >, @@ -790,8 +789,8 @@ export interface UserDelegate< ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, - ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, - InputErrors extends ByEmpty extends Prisma.True + ByEmpty extends (T['by'] extends never[] ? Prisma.True : Prisma.False), + InputErrors extends (ByEmpty extends Prisma.True ? `Error: "by" must not be empty.` : HavingValid extends Prisma.False ? { @@ -832,7 +831,7 @@ export interface UserDelegate< [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields], + }[OrderFields]), >( args: Prisma.SubsetIntersection & InputErrors, @@ -867,13 +866,9 @@ export interface Prisma__UserClient< */ then( onfulfilled?: - | ((value: T) => TResult1 | PromiseLike) - | undefined - | null, + ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: - | ((reason: any) => TResult2 | PromiseLike) - | undefined - | null, + ((reason: any) => TResult2 | PromiseLike) | undefined | null, ): runtime.Types.Utils.JsPromise /** * Attaches a callback for only the rejection of the Promise. @@ -882,9 +877,7 @@ export interface Prisma__UserClient< */ catch( onrejected?: - | ((reason: any) => TResult | PromiseLike) - | undefined - | null, + ((reason: any) => TResult | PromiseLike) | undefined | null, ): runtime.Types.Utils.JsPromise /** * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The @@ -973,8 +966,7 @@ export type UserFindFirstArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -1026,8 +1018,7 @@ export type UserFindFirstOrThrowArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -1079,8 +1070,7 @@ export type UserFindManyArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * diff --git a/e2e/vue-start/basic-auth/src/prisma-generated/internal/prismaNamespace.ts b/e2e/vue-start/basic-auth/src/prisma-generated/internal/prismaNamespace.ts index f420c55329..02c12a3cd4 100644 --- a/e2e/vue-start/basic-auth/src/prisma-generated/internal/prismaNamespace.ts +++ b/e2e/vue-start/basic-auth/src/prisma-generated/internal/prismaNamespace.ts @@ -307,9 +307,8 @@ type NoExpand = T extends unknown ? T : never // this type assumes the passed object is entirely optional export type AtLeast = NoExpand< O extends unknown - ? - | (K extends keyof O ? { [P in K]: O[P] } & O : O) - | ({ [P in keyof O as P extends K ? P : never]-?: O[P] } & O) + ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) + | ({ [P in keyof O as P extends K ? P : never]-?: O[P] } & O) : never > diff --git a/e2e/vue-start/basic-auth/src/prisma-generated/models/User.ts b/e2e/vue-start/basic-auth/src/prisma-generated/models/User.ts index 4312db9bd9..1444b9daa9 100644 --- a/e2e/vue-start/basic-auth/src/prisma-generated/models/User.ts +++ b/e2e/vue-start/basic-auth/src/prisma-generated/models/User.ts @@ -70,8 +70,7 @@ export type UserAggregateArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -780,9 +779,9 @@ export interface UserDelegate< Prisma.Extends<'skip', Prisma.Keys>, Prisma.Extends<'take', Prisma.Keys> >, - OrderByArg extends Prisma.True extends HasSelectOrTake + OrderByArg extends (Prisma.True extends HasSelectOrTake ? { orderBy: UserGroupByArgs['orderBy'] } - : { orderBy?: UserGroupByArgs['orderBy'] }, + : { orderBy?: UserGroupByArgs['orderBy'] }), OrderFields extends Prisma.ExcludeUnderscoreKeys< Prisma.Keys> >, @@ -790,8 +789,8 @@ export interface UserDelegate< ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, - ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, - InputErrors extends ByEmpty extends Prisma.True + ByEmpty extends (T['by'] extends never[] ? Prisma.True : Prisma.False), + InputErrors extends (ByEmpty extends Prisma.True ? `Error: "by" must not be empty.` : HavingValid extends Prisma.False ? { @@ -832,7 +831,7 @@ export interface UserDelegate< [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields], + }[OrderFields]), >( args: Prisma.SubsetIntersection & InputErrors, @@ -867,13 +866,9 @@ export interface Prisma__UserClient< */ then( onfulfilled?: - | ((value: T) => TResult1 | PromiseLike) - | undefined - | null, + ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: - | ((reason: any) => TResult2 | PromiseLike) - | undefined - | null, + ((reason: any) => TResult2 | PromiseLike) | undefined | null, ): runtime.Types.Utils.JsPromise /** * Attaches a callback for only the rejection of the Promise. @@ -882,9 +877,7 @@ export interface Prisma__UserClient< */ catch( onrejected?: - | ((reason: any) => TResult | PromiseLike) - | undefined - | null, + ((reason: any) => TResult | PromiseLike) | undefined | null, ): runtime.Types.Utils.JsPromise /** * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The @@ -973,8 +966,7 @@ export type UserFindFirstArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -1026,8 +1018,7 @@ export type UserFindFirstOrThrowArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -1079,8 +1070,7 @@ export type UserFindManyArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * diff --git a/examples/react/start-basic-auth/src/prisma-generated/internal/prismaNamespace.ts b/examples/react/start-basic-auth/src/prisma-generated/internal/prismaNamespace.ts index f420c55329..02c12a3cd4 100644 --- a/examples/react/start-basic-auth/src/prisma-generated/internal/prismaNamespace.ts +++ b/examples/react/start-basic-auth/src/prisma-generated/internal/prismaNamespace.ts @@ -307,9 +307,8 @@ type NoExpand = T extends unknown ? T : never // this type assumes the passed object is entirely optional export type AtLeast = NoExpand< O extends unknown - ? - | (K extends keyof O ? { [P in K]: O[P] } & O : O) - | ({ [P in keyof O as P extends K ? P : never]-?: O[P] } & O) + ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) + | ({ [P in keyof O as P extends K ? P : never]-?: O[P] } & O) : never > diff --git a/examples/react/start-basic-auth/src/prisma-generated/models/User.ts b/examples/react/start-basic-auth/src/prisma-generated/models/User.ts index 4312db9bd9..1444b9daa9 100644 --- a/examples/react/start-basic-auth/src/prisma-generated/models/User.ts +++ b/examples/react/start-basic-auth/src/prisma-generated/models/User.ts @@ -70,8 +70,7 @@ export type UserAggregateArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -780,9 +779,9 @@ export interface UserDelegate< Prisma.Extends<'skip', Prisma.Keys>, Prisma.Extends<'take', Prisma.Keys> >, - OrderByArg extends Prisma.True extends HasSelectOrTake + OrderByArg extends (Prisma.True extends HasSelectOrTake ? { orderBy: UserGroupByArgs['orderBy'] } - : { orderBy?: UserGroupByArgs['orderBy'] }, + : { orderBy?: UserGroupByArgs['orderBy'] }), OrderFields extends Prisma.ExcludeUnderscoreKeys< Prisma.Keys> >, @@ -790,8 +789,8 @@ export interface UserDelegate< ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, - ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, - InputErrors extends ByEmpty extends Prisma.True + ByEmpty extends (T['by'] extends never[] ? Prisma.True : Prisma.False), + InputErrors extends (ByEmpty extends Prisma.True ? `Error: "by" must not be empty.` : HavingValid extends Prisma.False ? { @@ -832,7 +831,7 @@ export interface UserDelegate< [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields], + }[OrderFields]), >( args: Prisma.SubsetIntersection & InputErrors, @@ -867,13 +866,9 @@ export interface Prisma__UserClient< */ then( onfulfilled?: - | ((value: T) => TResult1 | PromiseLike) - | undefined - | null, + ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: - | ((reason: any) => TResult2 | PromiseLike) - | undefined - | null, + ((reason: any) => TResult2 | PromiseLike) | undefined | null, ): runtime.Types.Utils.JsPromise /** * Attaches a callback for only the rejection of the Promise. @@ -882,9 +877,7 @@ export interface Prisma__UserClient< */ catch( onrejected?: - | ((reason: any) => TResult | PromiseLike) - | undefined - | null, + ((reason: any) => TResult | PromiseLike) | undefined | null, ): runtime.Types.Utils.JsPromise /** * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The @@ -973,8 +966,7 @@ export type UserFindFirstArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -1026,8 +1018,7 @@ export type UserFindFirstOrThrowArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -1079,8 +1070,7 @@ export type UserFindManyArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * diff --git a/examples/solid/start-basic-auth/src/prisma-generated/internal/prismaNamespace.ts b/examples/solid/start-basic-auth/src/prisma-generated/internal/prismaNamespace.ts index f420c55329..02c12a3cd4 100644 --- a/examples/solid/start-basic-auth/src/prisma-generated/internal/prismaNamespace.ts +++ b/examples/solid/start-basic-auth/src/prisma-generated/internal/prismaNamespace.ts @@ -307,9 +307,8 @@ type NoExpand = T extends unknown ? T : never // this type assumes the passed object is entirely optional export type AtLeast = NoExpand< O extends unknown - ? - | (K extends keyof O ? { [P in K]: O[P] } & O : O) - | ({ [P in keyof O as P extends K ? P : never]-?: O[P] } & O) + ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) + | ({ [P in keyof O as P extends K ? P : never]-?: O[P] } & O) : never > diff --git a/examples/solid/start-basic-auth/src/prisma-generated/models/User.ts b/examples/solid/start-basic-auth/src/prisma-generated/models/User.ts index 4312db9bd9..1444b9daa9 100644 --- a/examples/solid/start-basic-auth/src/prisma-generated/models/User.ts +++ b/examples/solid/start-basic-auth/src/prisma-generated/models/User.ts @@ -70,8 +70,7 @@ export type UserAggregateArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -780,9 +779,9 @@ export interface UserDelegate< Prisma.Extends<'skip', Prisma.Keys>, Prisma.Extends<'take', Prisma.Keys> >, - OrderByArg extends Prisma.True extends HasSelectOrTake + OrderByArg extends (Prisma.True extends HasSelectOrTake ? { orderBy: UserGroupByArgs['orderBy'] } - : { orderBy?: UserGroupByArgs['orderBy'] }, + : { orderBy?: UserGroupByArgs['orderBy'] }), OrderFields extends Prisma.ExcludeUnderscoreKeys< Prisma.Keys> >, @@ -790,8 +789,8 @@ export interface UserDelegate< ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, - ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, - InputErrors extends ByEmpty extends Prisma.True + ByEmpty extends (T['by'] extends never[] ? Prisma.True : Prisma.False), + InputErrors extends (ByEmpty extends Prisma.True ? `Error: "by" must not be empty.` : HavingValid extends Prisma.False ? { @@ -832,7 +831,7 @@ export interface UserDelegate< [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields], + }[OrderFields]), >( args: Prisma.SubsetIntersection & InputErrors, @@ -867,13 +866,9 @@ export interface Prisma__UserClient< */ then( onfulfilled?: - | ((value: T) => TResult1 | PromiseLike) - | undefined - | null, + ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: - | ((reason: any) => TResult2 | PromiseLike) - | undefined - | null, + ((reason: any) => TResult2 | PromiseLike) | undefined | null, ): runtime.Types.Utils.JsPromise /** * Attaches a callback for only the rejection of the Promise. @@ -882,9 +877,7 @@ export interface Prisma__UserClient< */ catch( onrejected?: - | ((reason: any) => TResult | PromiseLike) - | undefined - | null, + ((reason: any) => TResult | PromiseLike) | undefined | null, ): runtime.Types.Utils.JsPromise /** * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The @@ -973,8 +966,7 @@ export type UserFindFirstArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -1026,8 +1018,7 @@ export type UserFindFirstOrThrowArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * @@ -1079,8 +1070,7 @@ export type UserFindManyArgs< * Determine the order of Users to fetch. */ orderBy?: - | Prisma.UserOrderByWithRelationInput - | Prisma.UserOrderByWithRelationInput[] + Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * diff --git a/examples/solid/start-convex-better-auth/convex/_generated/api.d.ts b/examples/solid/start-convex-better-auth/convex/_generated/api.d.ts index 7743e55077..c2c5edd435 100644 --- a/examples/solid/start-convex-better-auth/convex/_generated/api.d.ts +++ b/examples/solid/start-convex-better-auth/convex/_generated/api.d.ts @@ -1048,12 +1048,7 @@ export declare const components: { | 'starts_with' | 'ends_with' value: - | string - | number - | boolean - | Array - | Array - | null + string | number | boolean | Array | Array | null }> }, any @@ -1092,12 +1087,7 @@ export declare const components: { | 'starts_with' | 'ends_with' value: - | string - | number - | boolean - | Array - | Array - | null + string | number | boolean | Array | Array | null }> }, any diff --git a/packages/eslint-plugin-start/lint-improvements.md b/packages/eslint-plugin-start/lint-improvements.md index ff46b57353..42202a61d5 100644 --- a/packages/eslint-plugin-start/lint-improvements.md +++ b/packages/eslint-plugin-start/lint-improvements.md @@ -655,9 +655,7 @@ async function benchmark(name: string, fn: () => Promise) { // Run on large fixture set await benchmark('no-async-client-component', async () => { - const eslint = new ESLint({ - /* config */ - }) + const eslint = new ESLint({/* config */}) await eslint.lintFiles(['fixtures/large-project/**/*.tsx']) }) ``` diff --git a/packages/eslint-plugin-start/src/rules/no-async-client-component/render-graph-builder.ts b/packages/eslint-plugin-start/src/rules/no-async-client-component/render-graph-builder.ts index 3b736da2d9..9e3323360a 100644 --- a/packages/eslint-plugin-start/src/rules/no-async-client-component/render-graph-builder.ts +++ b/packages/eslint-plugin-start/src/rules/no-async-client-component/render-graph-builder.ts @@ -193,8 +193,7 @@ export function createRenderGraphBuilder( // Visit body with this component as context const funcNode = decl.initializer as - | ts.ArrowFunction - | ts.FunctionExpression + ts.ArrowFunction | ts.FunctionExpression tsLib.forEachChild(funcNode.body, (child) => visitNode(child, sourceFile, key), ) diff --git a/packages/react-router/src/link.tsx b/packages/react-router/src/link.tsx index ce6a7ed9d1..7f79eb31da 100644 --- a/packages/react-router/src/link.tsx +++ b/packages/react-router/src/link.tsx @@ -747,8 +747,7 @@ export type LinkProps< export interface LinkPropsChildren { // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns children?: - | React.ReactNode - | ((state: { isActive: boolean }) => React.ReactNode) + React.ReactNode | ((state: { isActive: boolean }) => React.ReactNode) } type LinkComponentReactProps = Omit< @@ -791,7 +790,7 @@ export type LinkComponent< export interface LinkComponentRoute< in out TDefaultFrom extends string = string, > { - defaultFrom: TDefaultFrom; + defaultFrom: TDefaultFrom < TRouter extends AnyRouter = RegisteredRouter, const TTo extends string | undefined = undefined, diff --git a/packages/react-router/src/nonRouteComponentContext.tsx b/packages/react-router/src/nonRouteComponentContext.tsx index 252ab7fd10..6d91e0064d 100644 --- a/packages/react-router/src/nonRouteComponentContext.tsx +++ b/packages/react-router/src/nonRouteComponentContext.tsx @@ -3,9 +3,7 @@ import * as React from 'react' export type NonRouteComponent = - | 'pendingComponent' - | 'errorComponent' - | 'notFoundComponent' + 'pendingComponent' | 'errorComponent' | 'notFoundComponent' export const nonRouteComponentContext = process.env.NODE_ENV !== 'production' diff --git a/packages/react-router/src/route.tsx b/packages/react-router/src/route.tsx index 57dca9ef02..dbbb77ef6b 100644 --- a/packages/react-router/src/route.tsx +++ b/packages/react-router/src/route.tsx @@ -616,8 +616,7 @@ export function createRouteMask< export interface DefaultRouteTypes { component: - | ((props: TProps) => any) - | React.LazyExoticComponent<(props: TProps) => any> + ((props: TProps) => any) | React.LazyExoticComponent<(props: TProps) => any> } export interface RouteTypes extends DefaultRouteTypes {} diff --git a/packages/react-router/src/ssr/renderRouterToStream.tsx b/packages/react-router/src/ssr/renderRouterToStream.tsx index b55fc35405..e7c3ee65c7 100644 --- a/packages/react-router/src/ssr/renderRouterToStream.tsx +++ b/packages/react-router/src/ssr/renderRouterToStream.tsx @@ -71,8 +71,7 @@ export const renderRouterToStream = async ({ if (typeof ReactDOMServer.renderToPipeableStream === 'function') { const reactAppPassthrough = new PassThrough() let pipeable: - | ReturnType - | undefined + ReturnType | undefined let resolveReady!: () => void const ready = new Promise((resolve) => { resolveReady = resolve diff --git a/packages/react-router/src/utils.ts b/packages/react-router/src/utils.ts index 7887761993..486bd9f6ba 100644 --- a/packages/react-router/src/utils.ts +++ b/packages/react-router/src/utils.ts @@ -14,8 +14,9 @@ let REACT_USE = 'use' * Use dynamic lookup to avoid Webpack compilation errors with React 18. */ export const reactUse: - | ((usable: Promise | React.Context) => T) - | undefined = (React as any)[REACT_USE] + ((usable: Promise | React.Context) => T) | undefined = ( + React as any +)[REACT_USE] export function useStableCallback) => any>( fn: T, diff --git a/packages/react-start-client/src/Hydrate.tsx b/packages/react-start-client/src/Hydrate.tsx index 019730f3be..b636682a72 100644 --- a/packages/react-start-client/src/Hydrate.tsx +++ b/packages/react-start-client/src/Hydrate.tsx @@ -33,8 +33,7 @@ export type HydrationStrategy< > = ReactHydrationStrategy export type HydrateWhen = - | ReactHydrationStrategy - | (() => ReactHydrationStrategy) + ReactHydrationStrategy | (() => ReactHydrationStrategy) type HydrateCommonOptions = { when: HydrateWhen diff --git a/packages/react-start-rsc/src/RscNodeRenderer.tsx b/packages/react-start-rsc/src/RscNodeRenderer.tsx index 430f24ad0f..32165efe83 100644 --- a/packages/react-start-rsc/src/RscNodeRenderer.tsx +++ b/packages/react-start-rsc/src/RscNodeRenderer.tsx @@ -41,11 +41,9 @@ function RscNodeRenderInner({ */ export function RscNodeRenderer({ data }: { data: any }): React.ReactNode { const cssHrefs = data[SERVER_COMPONENT_CSS_HREFS] as - | ReadonlySet - | undefined + ReadonlySet | undefined const jsPreloads = data[SERVER_COMPONENT_JS_PRELOADS] as - | ReadonlySet - | undefined + ReadonlySet | undefined const path = (data[RSC_PROXY_PATH] as Array | undefined) ?? [] diff --git a/packages/react-start-rsc/src/ServerComponentTypes.ts b/packages/react-start-rsc/src/ServerComponentTypes.ts index 5e1fa32a52..0138643f37 100644 --- a/packages/react-start-rsc/src/ServerComponentTypes.ts +++ b/packages/react-start-rsc/src/ServerComponentTypes.ts @@ -101,13 +101,7 @@ export type ValidateReactSerializable = ValidateSerializable< > export type ReactSerializable = - | number - | string - | bigint - | boolean - | null - | undefined - | React.ReactNode + number | string | bigint | boolean | null | undefined | React.ReactNode export type ValidateCompositeComponentReturnType = unknown extends TComp ? React.ReactNode diff --git a/packages/react-start-rsc/src/createCompositeComponent.ts b/packages/react-start-rsc/src/createCompositeComponent.ts index 02a840dc64..64013dd476 100644 --- a/packages/react-start-rsc/src/createCompositeComponent.ts +++ b/packages/react-start-rsc/src/createCompositeComponent.ts @@ -177,9 +177,7 @@ function createCompositeHandle( */ interface SlotPropsBase { [key: string]: - | ((...args: Array) => React.ReactNode) - | React.ReactNode - | undefined + ((...args: Array) => React.ReactNode) | React.ReactNode | undefined children?: React.ReactNode } diff --git a/packages/react-start-rsc/src/serialization.server.ts b/packages/react-start-rsc/src/serialization.server.ts index ee9ad0eca8..319da496c6 100644 --- a/packages/react-start-rsc/src/serialization.server.ts +++ b/packages/react-start-rsc/src/serialization.server.ts @@ -208,8 +208,7 @@ const adapter = createSerializationAdapter({ kind === 'composite' && RSC_SLOT_USAGES_STREAM in component ? ((component as any)[RSC_SLOT_USAGES_STREAM] as unknown as - | ReadableStream - | undefined) + ReadableStream | undefined) : undefined return { diff --git a/packages/router-core/src/load-client.ts b/packages/router-core/src/load-client.ts index e84bb8fba5..6193adde7f 100644 --- a/packages/router-core/src/load-client.ts +++ b/packages/router-core/src/load-client.ts @@ -26,10 +26,7 @@ import type { RoutePaths } from './routeInfo' import type { RouterHistory } from '@tanstack/history' type RouteComponentType = - | 'component' - | 'pendingComponent' - | 'errorComponent' - | 'notFoundComponent' + 'component' | 'pendingComponent' | 'errorComponent' | 'notFoundComponent' export function replaceRouteChunk( route: AnyRoute, @@ -207,8 +204,7 @@ type NonRedirectOutcome = | [kind: typeof CANCELED] type RawLoaderOutcome = - | NonRedirectOutcome - | [kind: typeof REDIRECTED, redirect: AnyRedirect] + NonRedirectOutcome | [kind: typeof REDIRECTED, redirect: AnyRedirect] type LoaderOutcome = NonRedirectOutcome | RedirectOutcome @@ -996,8 +992,7 @@ async function getNotFoundBoundary( fallback = 0, ): Promise { const cause = indexed?.[1 /* outcome */][1 /* error or redirect */] as - | NotFoundError - | undefined + NotFoundError | undefined let index = cause?.routeId ? matches.findIndex((match) => match.routeId === cause.routeId) : (indexed?.[0 /* index */] ?? matches.length - 1) @@ -1951,8 +1946,7 @@ export async function loadClientRoute( const previousLocation = resolvedLocation ?? router.stores.location.get() const location = router.latestLocation const pendingLocation = router._pendingLocation as - | (ParsedLocation & { _redirects?: number }) - | undefined + (ParsedLocation & { _redirects?: number }) | undefined const redirects = pendingLocation?.href === location.href ? (pendingLocation._redirects ?? 0) @@ -2225,8 +2219,7 @@ export async function hydrate(router: AnyRouter): Promise { router.options.ssr = { nonce: ( document.querySelector('meta[property="csp-nonce"]') as - | HTMLMetaElement - | undefined + HTMLMetaElement | undefined )?.content, } diff --git a/packages/router-core/src/manifest.ts b/packages/router-core/src/manifest.ts index b43f485236..ab0273acb1 100644 --- a/packages/router-core/src/manifest.ts +++ b/packages/router-core/src/manifest.ts @@ -4,8 +4,7 @@ export type ScriptFormat = 'module' | 'iife' export const DEV_STYLES_ATTR = 'data-tanstack-router-dev-styles' export type AssetCrossOriginConfig = - | AssetCrossOrigin - | Partial> + AssetCrossOrigin | Partial> export type ManifestAssetLink = | string diff --git a/packages/router-core/src/new-process-route-tree.ts b/packages/router-core/src/new-process-route-tree.ts index fd63889df2..12afda7d3e 100644 --- a/packages/router-core/src/new-process-route-tree.ts +++ b/packages/router-core/src/new-process-route-tree.ts @@ -25,9 +25,7 @@ export type SegmentKind = * All the kinds of segments that can be present in the segment tree. */ type ExtendedSegmentKind = - | SegmentKind - | typeof SEGMENT_TYPE_INDEX - | typeof SEGMENT_TYPE_PATHLESS + SegmentKind | typeof SEGMENT_TYPE_INDEX | typeof SEGMENT_TYPE_PATHLESS export type DynamicPathSegment = [ kind: Exclude, @@ -393,8 +391,7 @@ type DynamicSegmentNode = SegmentNode & { } type AnySegmentNode = - | StaticSegmentNode - | DynamicSegmentNode + StaticSegmentNode | DynamicSegmentNode type SegmentNode = { kind: ExtendedSegmentKind @@ -456,7 +453,8 @@ type RouteLike = { } } & // router tree - (| { fullPath: string; from?: never } // full path from the root + ( + | { fullPath: string; from?: never } // full path from the root // flat route masks list | { fullPath?: never; from: string } // full path from the root ) diff --git a/packages/router-core/src/routeInfo.ts b/packages/router-core/src/routeInfo.ts index 6c9249e091..d61e2a3c80 100644 --- a/packages/router-core/src/routeInfo.ts +++ b/packages/router-core/src/routeInfo.ts @@ -81,8 +81,7 @@ export type ToPath = : AddTrailingSlash | RemoveTrailingSlashes export type CatchAllPaths = - | CurrentPath - | ParentPath + CurrentPath | ParentPath export type CodeRoutesByPath = ParseRoute extends infer TRoutes extends AnyRoute @@ -108,11 +107,10 @@ export type CodeRoutePaths = export type RoutePaths = unknown extends TRouteTree ? string - : - | (InferFileRouteTypes extends never - ? CodeRoutePaths - : InferFileRouteTypes['fullPaths']) - | '/' + : | (InferFileRouteTypes extends never + ? CodeRoutePaths + : InferFileRouteTypes['fullPaths']) + | '/' export type RouteToPathAlwaysTrailingSlash = TRoute['path'] extends '/' @@ -129,8 +127,7 @@ export type RouteToPathNeverTrailingSlash = : TRoute['fullPath'] export type RouteToPathPreserveTrailingSlash = - | RouteToPathNeverTrailingSlash - | RouteToPathAlwaysTrailingSlash + RouteToPathNeverTrailingSlash | RouteToPathAlwaysTrailingSlash export type RouteToPathByTrailingSlashOption = { always: RouteToPathAlwaysTrailingSlash diff --git a/packages/router-core/src/router.ts b/packages/router-core/src/router.ts index ecf443168d..edd2417984 100644 --- a/packages/router-core/src/router.ts +++ b/packages/router-core/src/router.ts @@ -483,8 +483,7 @@ export interface RouterOptions< * @default false */ scrollRestoration?: - | boolean - | ((opts: { location: ParsedLocation }) => boolean) + boolean | ((opts: { location: ParsedLocation }) => boolean) /** * A function that will be called to get the key for the scroll restoration cache. @@ -1116,8 +1115,7 @@ export interface RouterCore< _refreshRoute: (() => Promise) | undefined /** Development-only replacement for a route's lazy chunk owner. */ _replaceRouteChunk: - | ((route: AnyRoute, lazyFn: AnyRoute['lazyFn']) => void) - | undefined + ((route: AnyRoute, lazyFn: AnyRoute['lazyFn']) => void) | undefined } export type HydrationHandoff = [ diff --git a/packages/router-core/src/ssr/hydrationScripts.ts b/packages/router-core/src/ssr/hydrationScripts.ts index 79222e5d73..7a13e71942 100644 --- a/packages/router-core/src/ssr/hydrationScripts.ts +++ b/packages/router-core/src/ssr/hydrationScripts.ts @@ -62,10 +62,7 @@ export type HydrationScriptOutput = { } type ConsumerOwnership = - | HydrationScriptOutput - | 'fast-path' - | 'cleaned' - | undefined + HydrationScriptOutput | 'fast-path' | 'cleaned' | undefined /** The one-time initial `` take: hydration tags plus the boundary. */ export type InitialHydrationScriptTags = { diff --git a/packages/router-core/src/ssr/serializer/transformer.ts b/packages/router-core/src/ssr/serializer/transformer.ts index 6fe99f2c43..e598e1a6e3 100644 --- a/packages/router-core/src/ssr/serializer/transformer.ts +++ b/packages/router-core/src/ssr/serializer/transformer.ts @@ -43,8 +43,7 @@ export function createSerializationAdapter< TInput = unknown, TOutput = unknown, const TExtendsAdapters extends - | ReadonlyArray - | never = never, + ReadonlyArray | never = never, >( opts: CreateSerializationAdapterOptions, ): SerializationAdapter { diff --git a/packages/router-core/src/structuralSharing.ts b/packages/router-core/src/structuralSharing.ts index 93111cd8c3..818837f983 100644 --- a/packages/router-core/src/structuralSharing.ts +++ b/packages/router-core/src/structuralSharing.ts @@ -2,6 +2,5 @@ import type { Constrain } from './utils' export interface OptionalStructuralSharing { readonly structuralSharing?: - | Constrain - | undefined + Constrain | undefined } diff --git a/packages/router-core/src/utils.ts b/packages/router-core/src/utils.ts index 63aa518695..a922b32805 100644 --- a/packages/router-core/src/utils.ts +++ b/packages/router-core/src/utils.ts @@ -85,12 +85,10 @@ export type IntersectAssign = TLeft extends any export type Timeout = ReturnType export type Updater = - | TResult - | ((prev?: TPrevious) => TResult) + TResult | ((prev?: TPrevious) => TResult) export type NonNullableUpdater = - | TResult - | ((prev: TPrevious) => TResult) + TResult | ((prev: TPrevious) => TResult) export type ExtractObjects = TUnion extends MergeAllPrimitive ? never @@ -126,16 +124,13 @@ export type ExtractPrimitives = TUnion extends MergeAllPrimitive : TUnion export type PartialMergeAll = - | ExtractPrimitives - | PartialMergeAllObject + ExtractPrimitives | PartialMergeAllObject export type Constrain = - | (T extends TConstraint ? T : never) - | TDefault + (T extends TConstraint ? T : never) | TDefault export type ConstrainLiteral = - | (T & TConstraint) - | TDefault + (T & TConstraint) | TDefault /** * To be added to router types @@ -162,8 +157,7 @@ export type MergeAllObjects< } export type MergeAll = - | MergeAllObjects - | ExtractPrimitives + MergeAllObjects | ExtractPrimitives export type ValidateJSON = ((...args: Array) => any) extends T ? unknown extends T diff --git a/packages/router-devtools-core/src/useStyles.tsx b/packages/router-devtools-core/src/useStyles.tsx index 32908c524d..c1dc90a506 100644 --- a/packages/router-devtools-core/src/useStyles.tsx +++ b/packages/router-devtools-core/src/useStyles.tsx @@ -495,12 +495,16 @@ const stylesFactory = (shadowDOMTarget?: ShadowRoot) => { const base = css` ${position === 'top-left' ? `top: ${size[2]}; left: ${size[2]};` : ''} ${position === 'top-right' ? `top: ${size[2]}; right: ${size[2]};` : ''} - ${position === 'bottom-left' - ? `bottom: ${size[2]}; left: ${size[2]};` - : ''} - ${position === 'bottom-right' - ? `bottom: ${size[2]}; right: ${size[2]};` - : ''} + ${ + position === 'bottom-left' + ? `bottom: ${size[2]}; left: ${size[2]};` + : '' + } + ${ + position === 'bottom-right' + ? `bottom: ${size[2]}; right: ${size[2]};` + : '' + } ` return base }, diff --git a/packages/router-plugin/src/core/code-splitter/compilers.ts b/packages/router-plugin/src/core/code-splitter/compilers.ts index 0cd783a58a..ce4abfc15a 100644 --- a/packages/router-plugin/src/core/code-splitter/compilers.ts +++ b/packages/router-plugin/src/core/code-splitter/compilers.ts @@ -1412,12 +1412,10 @@ export function detectCodeSplitGroupingsFromRoute(opts: ParseAstOptions): { return } - if ( - !( - path.node.callee.name === 'createRoute' || - path.node.callee.name === 'createFileRoute' - ) - ) { + if (!( + path.node.callee.name === 'createRoute' || + path.node.callee.name === 'createFileRoute' + )) { return } diff --git a/packages/router-plugin/src/core/config.ts b/packages/router-plugin/src/core/config.ts index 6c11241a01..aeafceea56 100644 --- a/packages/router-plugin/src/core/config.ts +++ b/packages/router-plugin/src/core/config.ts @@ -74,9 +74,9 @@ export type CodeSplittingOptions = { const codeSplittingOptionsSchema = z.object({ splitBehavior: z - .custom< - CodeSplittingOptions['splitBehavior'] - >((value) => typeof value === 'function') + .custom( + (value) => typeof value === 'function', + ) .optional(), defaultBehavior: splitGroupingsSchema.optional(), deleteNodes: z.array(z.string()).optional(), diff --git a/packages/router-plugin/src/core/hmr/handle-route-update.ts b/packages/router-plugin/src/core/hmr/handle-route-update.ts index 23b51d2432..67c2871463 100644 --- a/packages/router-plugin/src/core/hmr/handle-route-update.ts +++ b/packages/router-plugin/src/core/hmr/handle-route-update.ts @@ -25,8 +25,7 @@ function handleRouteUpdate( ) { const router = window.__TSR_ROUTER__ as AnyRouterWithPrivateState const oldRoute = router.routesById[routeId] as - | AnyRouteWithPrivateProps - | undefined + AnyRouteWithPrivateProps | undefined if (!oldRoute) { return diff --git a/packages/router-plugin/tests/regression-helpers.ts b/packages/router-plugin/tests/regression-helpers.ts index df482ffe78..4e8144953f 100644 --- a/packages/router-plugin/tests/regression-helpers.ts +++ b/packages/router-plugin/tests/regression-helpers.ts @@ -171,9 +171,7 @@ function runTransform(plugin: UnpluginOptions, code: string, id: string) { throw new Error('Expected object transform') } const result = transform.handler.call({} as never, code, id) as - | TransformResult - | null - | undefined + TransformResult | null | undefined if (!result) { return null } diff --git a/packages/solid-router/src/Match.tsx b/packages/solid-router/src/Match.tsx index 37c4020c03..fc96202381 100644 --- a/packages/solid-router/src/Match.tsx +++ b/packages/solid-router/src/Match.tsx @@ -34,8 +34,8 @@ const renderScrollRestoration = export const Match = (props: { routeId: string }) => { const router = useRouter() - const currentMatch = Solid.createMemo( - () => router.stores.byRoute.get(props.routeId)!.get()!, + const currentMatch = Solid.createMemo(() => + router.stores.byRoute.get(props.routeId)!.get()!, ) const nearestMatch = [() => props.routeId, currentMatch] as const diff --git a/packages/solid-router/src/link.tsx b/packages/solid-router/src/link.tsx index 27bed97d92..165a1a1076 100644 --- a/packages/solid-router/src/link.tsx +++ b/packages/solid-router/src/link.tsx @@ -307,12 +307,9 @@ function createLinkProps( return } - if ( - !( - (e as IntersectionObserverEntry).isIntersecting ?? - preload() === 'intent' - ) - ) { + if (!( + (e as IntersectionObserverEntry).isIntersecting ?? preload() === 'intent' + )) { if ((e as IntersectionObserverEntry).isIntersecting === false) { cancelPreload() } @@ -586,8 +583,7 @@ export type LinkProps< export interface LinkPropsChildren { // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns children?: - | Solid.JSX.Element - | ((state: { isActive: boolean }) => Solid.JSX.Element) + Solid.JSX.Element | ((state: { isActive: boolean }) => Solid.JSX.Element) } type LinkComponentSolidProps = TComp extends Solid.ValidComponent @@ -629,7 +625,7 @@ export type LinkComponent< export interface LinkComponentRoute< in out TDefaultFrom extends string = string, > { - defaultFrom: TDefaultFrom; + defaultFrom: TDefaultFrom < TRouter extends AnyRouter = RegisteredRouter, const TTo extends string | undefined = undefined, diff --git a/packages/solid-router/src/nonRouteComponentContext.tsx b/packages/solid-router/src/nonRouteComponentContext.tsx index 908eec02b5..f3c5c73172 100644 --- a/packages/solid-router/src/nonRouteComponentContext.tsx +++ b/packages/solid-router/src/nonRouteComponentContext.tsx @@ -1,9 +1,7 @@ import * as Solid from 'solid-js' export type NonRouteComponent = - | 'pendingComponent' - | 'errorComponent' - | 'notFoundComponent' + 'pendingComponent' | 'errorComponent' | 'notFoundComponent' export const nonRouteComponentContext = process.env.NODE_ENV !== 'production' diff --git a/packages/solid-router/tests/server/lazyRouteComponent.test.tsx b/packages/solid-router/tests/server/lazyRouteComponent.test.tsx index 95ab8a5cdd..5c8ad6b741 100644 --- a/packages/solid-router/tests/server/lazyRouteComponent.test.tsx +++ b/packages/solid-router/tests/server/lazyRouteComponent.test.tsx @@ -17,11 +17,10 @@ describe('lazyRouteComponent (server)', () => { 'renders a missing $exportName export as blank in production (preload: $preload)', async ({ exportName, preload }) => { vi.stubEnv('NODE_ENV', 'production') - const importer = vi.fn( - (): Promise null>> => - Promise.resolve({ - Other: () => null, - }), + const importer = vi.fn((): Promise null>> => + Promise.resolve({ + Other: () => null, + }), ) const Page = lazyRouteComponent(importer, exportName) const onError = vi.fn() diff --git a/packages/solid-start-client/src/Hydrate.tsx b/packages/solid-start-client/src/Hydrate.tsx index 1b52e643f2..592bd8abeb 100644 --- a/packages/solid-start-client/src/Hydrate.tsx +++ b/packages/solid-start-client/src/Hydrate.tsx @@ -30,8 +30,7 @@ export type HydrationStrategy< > = SolidHydrationStrategy export type HydrateWhen = - | SolidHydrationStrategy - | (() => SolidHydrationStrategy) + SolidHydrationStrategy | (() => SolidHydrationStrategy) type HydrateCommonOptions = { when: HydrateWhen diff --git a/packages/start-client-core/src/createCsrfMiddleware.ts b/packages/start-client-core/src/createCsrfMiddleware.ts index 75cf65c81e..4aaa699e11 100644 --- a/packages/start-client-core/src/createCsrfMiddleware.ts +++ b/packages/start-client-core/src/createCsrfMiddleware.ts @@ -10,10 +10,7 @@ import type { Register } from '@tanstack/router-core' export const csrfSymbol = Symbol.for('tanstack-start:csrf-middleware') export type CsrfSecFetchSite = - | 'same-origin' - | 'same-site' - | 'cross-site' - | 'none' + 'same-origin' | 'same-site' | 'cross-site' | 'none' export type CsrfMatcher = | TValue diff --git a/packages/start-client-core/src/createMiddleware.ts b/packages/start-client-core/src/createMiddleware.ts index 9b19833d09..503a7019aa 100644 --- a/packages/start-client-core/src/createMiddleware.ts +++ b/packages/start-client-core/src/createMiddleware.ts @@ -191,9 +191,7 @@ export type IntersectAllMiddleware< TAcc = undefined, > = TMiddlewares extends readonly [infer TMiddleware, ...infer TRest] ? TMiddleware extends - | AnyFunctionMiddleware - | AnyRequestMiddleware - | AnyServerFn + AnyFunctionMiddleware | AnyRequestMiddleware | AnyServerFn ? IntersectAllMiddleware< TRest, TType, @@ -250,9 +248,7 @@ export type AssignAllMiddleware< TAcc = undefined, > = TMiddlewares extends readonly [infer TMiddleware, ...infer TRest] ? TMiddleware extends - | AnyFunctionMiddleware - | AnyRequestMiddleware - | AnyServerFn + AnyFunctionMiddleware | AnyRequestMiddleware | AnyServerFn ? AssignAllMiddleware< TRest, TType, diff --git a/packages/start-client-core/src/getDefaultSerovalPlugins.ts b/packages/start-client-core/src/getDefaultSerovalPlugins.ts index 3071e9924f..cea405276b 100644 --- a/packages/start-client-core/src/getDefaultSerovalPlugins.ts +++ b/packages/start-client-core/src/getDefaultSerovalPlugins.ts @@ -11,8 +11,7 @@ export function getSerovalPlugins( routerPlugins: Array>, ): Array> { const adapters = getStartOptions()?.serializationAdapters as - | Array - | undefined + Array | undefined return [...(adapters?.map(makeSerovalPlugin) ?? []), ...routerPlugins] } diff --git a/packages/start-client-core/src/getGlobalStartContext.ts b/packages/start-client-core/src/getGlobalStartContext.ts index 3e1af51361..a0897dbdef 100644 --- a/packages/start-client-core/src/getGlobalStartContext.ts +++ b/packages/start-client-core/src/getGlobalStartContext.ts @@ -4,15 +4,15 @@ import type { AssignAllServerRequestContext } from './createMiddleware' import type { Expand, Register } from '@tanstack/router-core' export const getGlobalStartContext: () => - | Expand> - | undefined = createIsomorphicFn() - .client(() => undefined) - .server(() => { - const context = getStartContext().contextAfterGlobalMiddlewares - if (!context) { - throw new Error( - `Global context not set yet, you are calling getGlobalStartContext() before the global middlewares are applied.`, - ) - } - return context - }) + Expand> | undefined = + createIsomorphicFn() + .client(() => undefined) + .server(() => { + const context = getStartContext().contextAfterGlobalMiddlewares + if (!context) { + throw new Error( + `Global context not set yet, you are calling getGlobalStartContext() before the global middlewares are applied.`, + ) + } + return context + }) diff --git a/packages/start-client-core/src/hydration/types.ts b/packages/start-client-core/src/hydration/types.ts index f4250067d6..28bf0c7f57 100644 --- a/packages/start-client-core/src/hydration/types.ts +++ b/packages/start-client-core/src/hydration/types.ts @@ -26,8 +26,7 @@ export type HydrationInteractionEvent = | 'pointerup' export type HydrationInteractionEvents = - | HydrationInteractionEvent - | ReadonlyArray + HydrationInteractionEvent | ReadonlyArray export type HydrationMarkerAttributes = Record diff --git a/packages/start-client-core/src/serverRoute.ts b/packages/start-client-core/src/serverRoute.ts index 511412683e..dccc75d83d 100644 --- a/packages/start-client-core/src/serverRoute.ts +++ b/packages/start-client-core/src/serverRoute.ts @@ -426,14 +426,7 @@ export type ResolveAllServerContext< > export type RouteMethod = - | 'ANY' - | 'GET' - | 'POST' - | 'PUT' - | 'PATCH' - | 'DELETE' - | 'OPTIONS' - | 'HEAD' + 'ANY' | 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD' export type RouteMethodHandlerFn< TRegister, @@ -453,13 +446,10 @@ export type RouteMethodHandlerFn< TMethodMiddlewares >, ) => - | RouteMethodResult - | Promise> + RouteMethodResult | Promise> export type RouteMethodResult = - | Response - | undefined - | RouteMethodNextResult + Response | undefined | RouteMethodNextResult export type RouteMethodNextResult = { isNext: true diff --git a/packages/start-plugin-core/src/build-sitemap.ts b/packages/start-plugin-core/src/build-sitemap.ts index 744096a2ff..491be906aa 100644 --- a/packages/start-plugin-core/src/build-sitemap.ts +++ b/packages/start-plugin-core/src/build-sitemap.ts @@ -12,13 +12,7 @@ export type SitemapUrl = { lastmod: string priority?: number changefreq?: - | 'always' - | 'hourly' - | 'daily' - | 'weekly' - | 'monthly' - | 'yearly' - | 'never' + 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never' alternateRefs?: Array<{ href: string hreflang: string diff --git a/packages/start-plugin-core/src/config-context.ts b/packages/start-plugin-core/src/config-context.ts index 825860a595..eee5f06b5d 100644 --- a/packages/start-plugin-core/src/config-context.ts +++ b/packages/start-plugin-core/src/config-context.ts @@ -46,8 +46,7 @@ export function createStartConfigContext(opts: { let startConfig: TanStackStartOutputConfig | null = null let resolvedEntryPlanCache: - | ReturnType - | undefined + ReturnType | undefined function requireRoot(): string { if (!resolvedStartConfig.root) { diff --git a/packages/start-plugin-core/src/import-protection/analysis.ts b/packages/start-plugin-core/src/import-protection/analysis.ts index 85f90b0a87..1a0eb0e4de 100644 --- a/packages/start-plugin-core/src/import-protection/analysis.ts +++ b/packages/start-plugin-core/src/import-protection/analysis.ts @@ -139,26 +139,22 @@ function collectIdentifiersFromPattern( export function isValidExportName(name: string): boolean { if (name === 'default' || name.length === 0) return false const first = name.charCodeAt(0) - if ( - !( - (first >= 65 && first <= 90) || - (first >= 97 && first <= 122) || - first === 95 || - first === 36 - ) - ) + if (!( + (first >= 65 && first <= 90) || + (first >= 97 && first <= 122) || + first === 95 || + first === 36 + )) return false for (let i = 1; i < name.length; i++) { const ch = name.charCodeAt(i) - if ( - !( - (ch >= 65 && ch <= 90) || - (ch >= 97 && ch <= 122) || - (ch >= 48 && ch <= 57) || - ch === 95 || - ch === 36 - ) - ) + if (!( + (ch >= 65 && ch <= 90) || + (ch >= 97 && ch <= 122) || + (ch >= 48 && ch <= 57) || + ch === 95 || + ch === 36 + )) return false } return true diff --git a/packages/start-plugin-core/src/schema.ts b/packages/start-plugin-core/src/schema.ts index 413ac4673f..a5f6b94cfa 100644 --- a/packages/start-plugin-core/src/schema.ts +++ b/packages/start-plugin-core/src/schema.ts @@ -41,9 +41,9 @@ const importProtectionOptionsSchema = z */ mockAccess: z.enum(['error', 'warn', 'off']).optional(), onViolation: z - .custom< - (violation: unknown) => boolean | void | Promise - >((value) => typeof value === 'function') + .custom<(violation: unknown) => boolean | void | Promise>( + (value) => typeof value === 'function', + ) .optional(), include: z.array(patternSchema).optional(), exclude: z.array(patternSchema).optional(), @@ -272,9 +272,9 @@ export const tanstackStartOptionsObjectSchema = z.object({ enabled: z.boolean().optional(), concurrency: z.number().optional(), filter: z - .custom< - (page: z.infer) => unknown - >((value) => typeof value === 'function') + .custom<(page: z.infer) => unknown>( + (value) => typeof value === 'function', + ) .optional(), failOnError: z.boolean().optional(), autoStaticPathsDiscovery: z.boolean().optional(), diff --git a/packages/start-plugin-core/src/start-compiler/compiler.ts b/packages/start-plugin-core/src/start-compiler/compiler.ts index 13193f7249..9e4b0c3897 100644 --- a/packages/start-plugin-core/src/start-compiler/compiler.ts +++ b/packages/start-plugin-core/src/start-compiler/compiler.ts @@ -103,9 +103,7 @@ export function isStartCompilerPluginEnabledForEnv( function isStartCompilerEnvironmentEnabled( environment: - | StartCompilerEnvironment - | Array - | undefined, + StartCompilerEnvironment | Array | undefined, env: StartCompilerEnvironment, ): boolean { if (!environment) return true diff --git a/packages/start-plugin-core/src/types.ts b/packages/start-plugin-core/src/types.ts index db94e343d5..62fa3c2ede 100644 --- a/packages/start-plugin-core/src/types.ts +++ b/packages/start-plugin-core/src/types.ts @@ -20,8 +20,7 @@ export type SerializationAdapterByRuntime = Partial< > export type SerializationAdapterConfig = - | SerializationAdapterModuleRef - | SerializationAdapterByRuntime + SerializationAdapterModuleRef | SerializationAdapterByRuntime export type StartCompilerEnvironment = 'client' | 'server' @@ -52,9 +51,7 @@ export interface StartCompilerTransformContext { export interface StartCompilerImportTransform { name: string environment?: - | StartCompilerEnvironment - | Array - | undefined + StartCompilerEnvironment | Array | undefined imports: Array detect: RegExp order?: 'pre' | 'post' | undefined @@ -80,9 +77,7 @@ export interface StartCompilerVirtualModuleContext { export interface StartCompilerPlugin { name: string environment?: - | StartCompilerEnvironment - | Array - | undefined + StartCompilerEnvironment | Array | undefined detect?: RegExp | undefined virtualModuleIdPattern?: RegExp | undefined transformAst?: ( diff --git a/packages/start-plugin-core/src/vite/types.ts b/packages/start-plugin-core/src/vite/types.ts index 4b98551268..d371caa090 100644 --- a/packages/start-plugin-core/src/vite/types.ts +++ b/packages/start-plugin-core/src/vite/types.ts @@ -8,8 +8,7 @@ export interface ViteRscForwardSsrResolverStrategy { } export type SsrResolverStrategy = - | { type: 'default' } - | ViteRscForwardSsrResolverStrategy + { type: 'default' } | ViteRscForwardSsrResolverStrategy export type TanStackStartVitePluginCoreOptions = TanStackStartCoreOptions & { providerEnvironmentName: string diff --git a/packages/start-server-core/src/createStartHandler.ts b/packages/start-server-core/src/createStartHandler.ts index f1be8fe0d9..0a7e45c09b 100644 --- a/packages/start-server-core/src/createStartHandler.ts +++ b/packages/start-server-core/src/createStartHandler.ts @@ -1170,8 +1170,7 @@ async function handleServerRoutes({ // in the request phase for (const route of matchedRoutes) { const serverMiddleware = route.options.server?.middleware as - | Array - | undefined + Array | undefined if (serverMiddleware) { const flattened = flattenMiddlewares(serverMiddleware) for (const m of flattened) { diff --git a/packages/start-server-core/src/early-hints.ts b/packages/start-server-core/src/early-hints.ts index 4b504d77d5..5627abbda0 100644 --- a/packages/start-server-core/src/early-hints.ts +++ b/packages/start-server-core/src/early-hints.ts @@ -114,8 +114,7 @@ function addEarlyHintFetchAttrs( attrs: Record | undefined, ) { const crossOrigin = getStringAttr(attrs, 'crossOrigin', 'crossorigin') as - | EarlyHint['crossOrigin'] - | undefined + EarlyHint['crossOrigin'] | undefined const type = getStringAttr(attrs, 'type') const integrity = getStringAttr(attrs, 'integrity') const referrerPolicy = getStringAttr( diff --git a/packages/start-server-core/src/inlineCss.ts b/packages/start-server-core/src/inlineCss.ts index 6fd7bd7fe2..b515b92480 100644 --- a/packages/start-server-core/src/inlineCss.ts +++ b/packages/start-server-core/src/inlineCss.ts @@ -1,8 +1,7 @@ import type { Awaitable } from '@tanstack/router-core' export type HandlerInlineCssOption = - | boolean - | ((ctx: { request: Request }) => Awaitable) + boolean | ((ctx: { request: Request }) => Awaitable) /** * The inline-CSS choice that needs no handler callback: a request override diff --git a/packages/start-server-core/tests/createStartHandler.test.ts b/packages/start-server-core/tests/createStartHandler.test.ts index f2918ed523..11fb80fa2c 100644 --- a/packages/start-server-core/tests/createStartHandler.test.ts +++ b/packages/start-server-core/tests/createStartHandler.test.ts @@ -78,8 +78,7 @@ const startMocks = vi.hoisted(() => { requestMiddleware: [] as Array, serverFnResult: undefined as undefined | Response | object, serverFnHandler: undefined as - | undefined - | ((opts: { serverFnId: string }) => unknown), + undefined | ((opts: { serverFnId: string }) => unknown), serverFnCalls: [] as Array<{ context?: unknown }>, router: undefined as undefined | AnyRouter, routerFactory: undefined as undefined | (() => AnyRouter), diff --git a/packages/start-server-core/tests/server-functions-reconciliation.test.ts b/packages/start-server-core/tests/server-functions-reconciliation.test.ts index a924fa96e4..8741904ee2 100644 --- a/packages/start-server-core/tests/server-functions-reconciliation.test.ts +++ b/packages/start-server-core/tests/server-functions-reconciliation.test.ts @@ -44,8 +44,7 @@ const serverFnMocks = vi.hoisted(() => { previousServerFnBase, middleware: [] as Array, action: undefined as - | undefined - | (ReturnType & { method: string }), + undefined | (ReturnType & { method: string }), } }) diff --git a/packages/virtual-file-routes/src/types.ts b/packages/virtual-file-routes/src/types.ts index 7a52b0d303..17883b1cb1 100644 --- a/packages/virtual-file-routes/src/types.ts +++ b/packages/virtual-file-routes/src/types.ts @@ -23,10 +23,7 @@ export type Route = { children?: Array } export type VirtualRouteNode = - | IndexRoute - | LayoutRoute - | Route - | PhysicalSubtree + IndexRoute | LayoutRoute | Route | PhysicalSubtree export type VirtualRootRoute = { type: 'root' diff --git a/packages/vue-router/src/link.tsx b/packages/vue-router/src/link.tsx index 34666743e3..e05596b8e2 100644 --- a/packages/vue-router/src/link.tsx +++ b/packages/vue-router/src/link.tsx @@ -824,7 +824,7 @@ export type LinkComponent< export interface LinkComponentRoute< in out TDefaultFrom extends string = string, > { - defaultFrom: TDefaultFrom; + defaultFrom: TDefaultFrom < TRouter extends AnyRouter = RegisteredRouter, const TTo extends string | undefined = undefined, diff --git a/packages/vue-router/src/nonRouteComponentContext.tsx b/packages/vue-router/src/nonRouteComponentContext.tsx index 2111a9ef57..0b3000693a 100644 --- a/packages/vue-router/src/nonRouteComponentContext.tsx +++ b/packages/vue-router/src/nonRouteComponentContext.tsx @@ -1,9 +1,7 @@ import * as Vue from 'vue' export type NonRouteComponent = - | 'pendingComponent' - | 'errorComponent' - | 'notFoundComponent' + 'pendingComponent' | 'errorComponent' | 'notFoundComponent' export const nonRouteComponentContext = process.env.NODE_ENV !== 'production' diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e2cafddf0e..26aa805860 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -168,4 +168,4 @@ allowBuilds: protobufjs: false # transitive dep minimumReleaseAgeExclude: # Renovate security update: @trpc/server@11.8.0 - - "@trpc/server@11.8.0" + - '@trpc/server@11.8.0'