@@ -183,22 +183,21 @@ const ValidJestFnCallChains = [
183183 'xtest.failing.each' ,
184184] ;
185185
186- // todo: switch back to using declaration merging once https://github.com/ typescript-eslint/typescript -eslint/pull/8485
187- // is landed
188- interface SharedConfigurationSettings {
189- jest ?: {
190- globalAliases ?: Record < string , string [ ] > ;
191- globalPackage ?: string ;
192- version ?: number | string ;
193- } ;
186+ declare module '@ typescript-eslint/utils/ts -eslint' {
187+ export interface SharedConfigurationSettings {
188+ jest ?: {
189+ globalAliases ?: Record < string , string [ ] > ;
190+ globalPackage ?: string ;
191+ version ?: number | string ;
192+ } ;
193+ }
194194}
195195
196196const resolvePossibleAliasedGlobal = (
197197 global : string ,
198198 context : TSESLint . RuleContext < string , unknown [ ] > ,
199199) => {
200- const globalAliases =
201- ( context . settings as SharedConfigurationSettings ) . jest ?. globalAliases ?? { } ;
200+ const globalAliases = context . settings . jest ?. globalAliases ?? { } ;
202201
203202 const alias = Object . entries ( globalAliases ) . find ( ( [ , aliases ] ) =>
204203 aliases . includes ( global ) ,
@@ -589,8 +588,7 @@ const resolveToJestFn = (
589588
590589 if ( maybeImport ) {
591590 const globalPackage =
592- ( context . settings as SharedConfigurationSettings ) . jest ?. globalPackage ??
593- '@jest/globals' ;
591+ context . settings . jest ?. globalPackage ?? '@jest/globals' ;
594592
595593 // the identifier is imported from our global package so return the original import name
596594 if ( maybeImport . source === globalPackage ) {
0 commit comments