@@ -271,8 +271,9 @@ export class TraceDirective implements OnInit, AfterViewInit {
271271 * @inheritdoc
272272 */
273273 public ngAfterViewInit ( ) : void {
274- if ( this . _tracingSpan ) {
275- runOutsideAngular ( ( ) => this . _tracingSpan ! . end ( ) ) ;
274+ const span = this . _tracingSpan ;
275+ if ( span ) {
276+ runOutsideAngular ( ( ) => span . end ( ) ) ;
276277 }
277278 }
278279}
@@ -302,8 +303,7 @@ export function TraceClass(options?: TraceClassOptions): ClassDecorator {
302303 /* eslint-disable @typescript-eslint/no-unsafe-member-access */
303304 return target => {
304305 const originalOnInit = target . prototype . ngOnInit ;
305- // eslint-disable-next-line @typescript-eslint/no-explicit-any
306- target . prototype . ngOnInit = function ( ...args : any [ ] ) : ReturnType < typeof originalOnInit > {
306+ target . prototype . ngOnInit = function ( ...args : unknown [ ] ) : ReturnType < typeof originalOnInit > {
307307 tracingSpan = runOutsideAngular ( ( ) =>
308308 startInactiveSpan ( {
309309 onlyIfParent : true ,
@@ -321,8 +321,7 @@ export function TraceClass(options?: TraceClassOptions): ClassDecorator {
321321 } ;
322322
323323 const originalAfterViewInit = target . prototype . ngAfterViewInit ;
324- // eslint-disable-next-line @typescript-eslint/no-explicit-any
325- target . prototype . ngAfterViewInit = function ( ...args : any [ ] ) : ReturnType < typeof originalAfterViewInit > {
324+ target . prototype . ngAfterViewInit = function ( ...args : unknown [ ] ) : ReturnType < typeof originalAfterViewInit > {
326325 if ( tracingSpan ) {
327326 runOutsideAngular ( ( ) => tracingSpan . end ( ) ) ;
328327 }
@@ -345,11 +344,9 @@ interface TraceMethodOptions {
345344 * Decorator function that can be used to capture a single lifecycle methods of the component.
346345 */
347346export function TraceMethod ( options ?: TraceMethodOptions ) : MethodDecorator {
348- // eslint-disable-next-line @typescript-eslint/ban-types
349- return ( target : Object , propertyKey : string | symbol , descriptor : PropertyDescriptor ) => {
347+ return ( _target : unknown , propertyKey : string | symbol , descriptor : PropertyDescriptor ) => {
350348 const originalMethod = descriptor . value ;
351- // eslint-disable-next-line @typescript-eslint/no-explicit-any
352- descriptor . value = function ( ...args : any [ ] ) : ReturnType < typeof originalMethod > {
349+ descriptor . value = function ( ...args : unknown [ ] ) : ReturnType < typeof originalMethod > {
353350 const now = timestampInSeconds ( ) ;
354351
355352 runOutsideAngular ( ( ) => {
0 commit comments