Skip to content

Commit

Permalink
chore(context-async-hools): fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
alisabzevari committed Aug 3, 2021
1 parent be6d940 commit 1796970
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -68,6 +68,7 @@ export abstract class AbstractAsyncHooksContextManager
return target;
}

// eslint-disable-next-line @typescript-eslint/ban-types
private _bindFunction<T extends Function>(context: Context, target: T): T {
const manager = this;
const contextWrapper = function (this: never, ...args: unknown[]) {
Expand Down Expand Up @@ -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<void>) {
Expand All @@ -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) {
Expand All @@ -172,6 +175,7 @@ export abstract class AbstractAsyncHooksContextManager
*/
private _patchAddListener(
ee: EventEmitter,
// eslint-disable-next-line @typescript-eslint/ban-types
original: Function,
context: Context
) {
Expand Down
Expand Up @@ -46,7 +46,7 @@ export class AsyncHooksContextManager extends AbstractAsyncHooksContextManager {
): ReturnType<F> {
this._enterContext(context);
try {
return fn.call(thisArg!, ...args);
return fn.call(thisArg, ...args);
} finally {
this._exitContext();
}
Expand Down

0 comments on commit 1796970

Please sign in to comment.