@@ -43,16 +43,14 @@ 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
46+
4747 router . options . parseSearch ( initialWindowLocation . search ) ,
4848 { preload : false , throwOnError : false } ,
4949 ) ;
5050
51- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
5251 const lastMatch = matchedRoutes [ matchedRoutes . length - 1 ] ;
5352
5453 startBrowserTracingPageLoadSpan ( client , {
55- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
5654 name : lastMatch ? lastMatch . routeId : initialWindowLocation . pathname ,
5755 attributes : {
5856 [ SEMANTIC_ATTRIBUTE_SENTRY_OP ] : 'pageload' ,
@@ -65,11 +63,12 @@ export function tanstackRouterBrowserTracingIntegration<R extends AnyRouter>(
6563
6664 if ( instrumentNavigation ) {
6765 // The onBeforeNavigate hook is called at the very beginning of a navigation and is only called once per navigation, even when the user is redirected
68- router . subscribe ( 'onBeforeNavigate' , onBeforeNavigateArgs => {
66+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
67+ router . subscribe ( 'onBeforeNavigate' , ( onBeforeNavigateArgs : any ) => {
6968 // onBeforeNavigate is called during pageloads. We can avoid creating navigation spans by:
7069 // 1. Checking if there's no fromLocation (initial pageload)
7170 // 2. Comparing the states of the to and from arguments
72-
71+
7372 if (
7473 // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7574 ! onBeforeNavigateArgs . fromLocation ||
@@ -87,14 +86,12 @@ export function tanstackRouterBrowserTracingIntegration<R extends AnyRouter>(
8786 { preload : false , throwOnError : false } ,
8887 ) ;
8988
90- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
9189 const onBeforeNavigateLastMatch = onResolvedMatchedRoutes [ onResolvedMatchedRoutes . length - 1 ] ;
9290
9391 const navigationLocation = WINDOW . location ;
9492 const navigationSpan = startBrowserTracingNavigationSpan ( client , {
9593 name : onBeforeNavigateLastMatch
96- ? // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
97- onBeforeNavigateLastMatch . routeId
94+ ? onBeforeNavigateLastMatch . routeId
9895 : // In SSR/non-browser contexts, WINDOW.location may be undefined, so fall back to the router's location
9996 // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
10097 navigationLocation ?. pathname || onBeforeNavigateArgs . toLocation . pathname ,
@@ -106,7 +103,8 @@ export function tanstackRouterBrowserTracingIntegration<R extends AnyRouter>(
106103 } ) ;
107104
108105 // In case the user is redirected during navigation we want to update the span with the right value.
109- const unsubscribeOnResolved = router . subscribe ( 'onResolved' , onResolvedArgs => {
106+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
107+ const unsubscribeOnResolved = router . subscribe ( 'onResolved' , ( onResolvedArgs : any ) => {
110108 unsubscribeOnResolved ( ) ;
111109 if ( navigationSpan ) {
112110 const onResolvedMatchedRoutes = router . matchRoutes (
@@ -117,11 +115,9 @@ export function tanstackRouterBrowserTracingIntegration<R extends AnyRouter>(
117115 { preload : false , throwOnError : false } ,
118116 ) ;
119117
120- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
121118 const onResolvedLastMatch = onResolvedMatchedRoutes [ onResolvedMatchedRoutes . length - 1 ] ;
122119
123120 if ( onResolvedLastMatch ) {
124- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
125121 navigationSpan . updateName ( onResolvedLastMatch . routeId ) ;
126122 navigationSpan . setAttribute ( SEMANTIC_ATTRIBUTE_SENTRY_SOURCE , 'route' ) ;
127123 navigationSpan . setAttributes ( routeMatchToParamSpanAttributes ( onResolvedLastMatch ) ) ;
@@ -140,7 +136,6 @@ function routeMatchToParamSpanAttributes(match: RouteMatch | undefined): Record<
140136 }
141137
142138 const paramAttributes : Record < string , string > = { } ;
143- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
144139 Object . entries ( match . params as Record < string , string > ) . forEach ( ( [ key , value ] ) => {
145140 paramAttributes [ `url.path.parameter.${ key } ` ] = value ;
146141 paramAttributes [ `params.${ key } ` ] = value ; // params.[key] is an alias
0 commit comments