From 7135ac7998dd6f00125107640927ad2751db9760 Mon Sep 17 00:00:00 2001 From: Ali Sabzevari Date: Tue, 3 Aug 2021 15:58:40 +0200 Subject: [PATCH] chore(context-async-hooks): fix lint warnings --- .../src/AbstractAsyncHooksContextManager.ts | 4 ++++ .../src/AsyncHooksContextManager.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/opentelemetry-context-async-hooks/src/AbstractAsyncHooksContextManager.ts b/packages/opentelemetry-context-async-hooks/src/AbstractAsyncHooksContextManager.ts index 4eb200c0aae..e0bdacb3ba8 100644 --- a/packages/opentelemetry-context-async-hooks/src/AbstractAsyncHooksContextManager.ts +++ b/packages/opentelemetry-context-async-hooks/src/AbstractAsyncHooksContextManager.ts @@ -68,6 +68,7 @@ export abstract class AbstractAsyncHooksContextManager return target; } + // eslint-disable-next-line @typescript-eslint/ban-types private _bindFunction(context: Context, target: T): T { const manager = this; const contextWrapper = function (this: never, ...args: unknown[]) { @@ -130,6 +131,7 @@ export abstract class AbstractAsyncHooksContextManager * @param ee EventEmitter instance * @param original reference to the patched method */ + // eslint-disable-next-line @typescript-eslint/ban-types private _patchRemoveListener(ee: EventEmitter, original: Function) { const contextManager = this; return function (this: never, event: string, listener: Func) { @@ -148,6 +150,7 @@ export abstract class AbstractAsyncHooksContextManager * @param ee EventEmitter instance * @param original reference to the patched method */ + // eslint-disable-next-line @typescript-eslint/ban-types private _patchRemoveAllListeners(ee: EventEmitter, original: Function) { const contextManager = this; return function (this: never, event: string) { @@ -172,6 +175,7 @@ export abstract class AbstractAsyncHooksContextManager */ private _patchAddListener( ee: EventEmitter, + // eslint-disable-next-line @typescript-eslint/ban-types original: Function, context: Context ) { diff --git a/packages/opentelemetry-context-async-hooks/src/AsyncHooksContextManager.ts b/packages/opentelemetry-context-async-hooks/src/AsyncHooksContextManager.ts index 5a2a3abae5f..59aefb8755f 100644 --- a/packages/opentelemetry-context-async-hooks/src/AsyncHooksContextManager.ts +++ b/packages/opentelemetry-context-async-hooks/src/AsyncHooksContextManager.ts @@ -46,7 +46,7 @@ export class AsyncHooksContextManager extends AbstractAsyncHooksContextManager { ): ReturnType { this._enterContext(context); try { - return fn.call(thisArg!, ...args); + return fn.call(thisArg, ...args); } finally { this._exitContext(); }