@@ -38,17 +38,20 @@ export function mockChange(overrides?: Partial<import('@/types/change').Change>)
3838
3939const ROLE_LEVEL : Record < UserRole , number > = { viewer : 1 , editor : 2 , admin : 3 } ;
4040
41+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4142const AuthContext = React . createContext < any > ( null ) ;
4243
4344// We dynamically import to get the actual context reference
45+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4446let _realAuthContext : React . Context < any > | null = null ;
4547
4648async function getRealAuthContext ( ) {
4749 if ( ! _realAuthContext ) {
4850 const mod = await import ( '@/contexts/AuthContext' ) ;
4951 // The context is not exported, but useAuth reads from it.
5052 // We'll use a provider wrapper approach instead.
51- _realAuthContext = ( mod as any ) . __AuthContext ;
53+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
54+ _realAuthContext = ( mod as Record < string , unknown > ) . __AuthContext as React . Context < any > ;
5255 }
5356 return _realAuthContext ;
5457}
@@ -120,7 +123,7 @@ export function createAuthValue(user: AuthUser | null) {
120123interface WrapperOptions {
121124 user ?: AuthUser | null ;
122125 initialRoute ?: string ;
123- authOverrides ?: Record < string , any > ;
126+ authOverrides ?: Record < string , unknown > ;
124127}
125128
126129/**
@@ -139,7 +142,8 @@ export function renderWithProviders(
139142
140143 // We need to provide this through the real context. We'll use the mock approach.
141144 // Set the mock return value before rendering.
142- const { useAuth } = require ( '@/contexts/AuthContext' ) ;
145+ // eslint-disable-next-line @typescript-eslint/no-require-imports
146+ const { useAuth } = require ( '@/contexts/AuthContext' ) as { useAuth : { _isMockFunction ?: boolean ; mockReturnValue : ( v : unknown ) => void } } ;
143147 if ( typeof useAuth === 'function' && useAuth . _isMockFunction ) {
144148 useAuth . mockReturnValue ( authValue ) ;
145149 }
0 commit comments