@@ -43,13 +43,16 @@ export function tanstackRouterBrowserTracingIntegration<R extends AnyRouter>(
4343 if ( instrumentPageLoad && initialWindowLocation ) {
4444 const matchedRoutes = router . matchRoutes (
4545 initialWindowLocation . pathname ,
46+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
4647 router . options . parseSearch ( initialWindowLocation . search ) ,
4748 { preload : false , throwOnError : false } ,
4849 ) ;
4950
51+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
5052 const lastMatch = matchedRoutes [ matchedRoutes . length - 1 ] ;
5153
5254 startBrowserTracingPageLoadSpan ( client , {
55+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
5356 name : lastMatch ? lastMatch . routeId : initialWindowLocation . pathname ,
5457 attributes : {
5558 [ SEMANTIC_ATTRIBUTE_SENTRY_OP ] : 'pageload' ,
@@ -66,23 +69,30 @@ export function tanstackRouterBrowserTracingIntegration<R extends AnyRouter>(
6669 // onBeforeNavigate is called during pageloads. We can avoid creating navigation spans by:
6770 // 1. Checking if there's no fromLocation (initial pageload)
6871 // 2. Comparing the states of the to and from arguments
72+
6973 if (
74+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7075 ! onBeforeNavigateArgs . fromLocation ||
76+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7177 onBeforeNavigateArgs . toLocation . state === onBeforeNavigateArgs . fromLocation . state
7278 ) {
7379 return ;
7480 }
7581
7682 const onResolvedMatchedRoutes = router . matchRoutes (
83+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7784 onBeforeNavigateArgs . toLocation . pathname ,
85+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7886 onBeforeNavigateArgs . toLocation . search ,
7987 { preload : false , throwOnError : false } ,
8088 ) ;
8189
90+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
8291 const onBeforeNavigateLastMatch = onResolvedMatchedRoutes [ onResolvedMatchedRoutes . length - 1 ] ;
8392
8493 const navigationLocation = WINDOW . location ;
8594 const navigationSpan = startBrowserTracingNavigationSpan ( client , {
95+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
8696 name : onBeforeNavigateLastMatch ? onBeforeNavigateLastMatch . routeId : navigationLocation . pathname ,
8797 attributes : {
8898 [ SEMANTIC_ATTRIBUTE_SENTRY_OP ] : 'navigation' ,
@@ -96,14 +106,18 @@ export function tanstackRouterBrowserTracingIntegration<R extends AnyRouter>(
96106 unsubscribeOnResolved ( ) ;
97107 if ( navigationSpan ) {
98108 const onResolvedMatchedRoutes = router . matchRoutes (
109+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
99110 onResolvedArgs . toLocation . pathname ,
111+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
100112 onResolvedArgs . toLocation . search ,
101113 { preload : false , throwOnError : false } ,
102114 ) ;
103115
116+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
104117 const onResolvedLastMatch = onResolvedMatchedRoutes [ onResolvedMatchedRoutes . length - 1 ] ;
105118
106119 if ( onResolvedLastMatch ) {
120+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
107121 navigationSpan . updateName ( onResolvedLastMatch . routeId ) ;
108122 navigationSpan . setAttribute ( SEMANTIC_ATTRIBUTE_SENTRY_SOURCE , 'route' ) ;
109123 navigationSpan . setAttributes ( routeMatchToParamSpanAttributes ( onResolvedLastMatch ) ) ;
@@ -122,6 +136,7 @@ function routeMatchToParamSpanAttributes(match: RouteMatch | undefined): Record<
122136 }
123137
124138 const paramAttributes : Record < string , string > = { } ;
139+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
125140 Object . entries ( match . params as Record < string , string > ) . forEach ( ( [ key , value ] ) => {
126141 paramAttributes [ `url.path.parameter.${ key } ` ] = value ;
127142 paramAttributes [ `params.${ key } ` ] = value ; // params.[key] is an alias
0 commit comments