From ad133a1fc744d4c1ecc18c3abafaf100d362b1e8 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Wed, 10 Jun 2026 12:33:05 +0200 Subject: [PATCH 1/2] ref(node): Drop generic-pool no-explicit-any lint exemption Type the one remaining `any` (the vendored Pool index signature) as `unknown` and remove generic-pool from the no-explicit-any override in .oxlintrc.base.json. Co-Authored-By: Claude Opus 4.8 (1M context) --- .oxlintrc.base.json | 1 - .../tracing/genericPool/vendored/generic-pool-types.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.oxlintrc.base.json b/.oxlintrc.base.json index 6f530396796d..f87e8ef82fcb 100644 --- a/.oxlintrc.base.json +++ b/.oxlintrc.base.json @@ -143,7 +143,6 @@ { "files": [ "**/integrations/tracing/dataloader/vendored/**/*.ts", - "**/integrations/tracing/genericPool/vendored/**/*.ts", "**/integrations/fs/vendored/**/*.ts", "**/integrations/tracing/knex/vendored/**/*.ts", "**/integrations/tracing/mongo/vendored/**/*.ts", diff --git a/packages/node/src/integrations/tracing/genericPool/vendored/generic-pool-types.ts b/packages/node/src/integrations/tracing/genericPool/vendored/generic-pool-types.ts index 2b380f7ab431..361d2081173e 100644 --- a/packages/node/src/integrations/tracing/genericPool/vendored/generic-pool-types.ts +++ b/packages/node/src/integrations/tracing/genericPool/vendored/generic-pool-types.ts @@ -4,5 +4,5 @@ export declare class Pool { acquire(priority?: number): PromiseLike; - [key: string]: any; + [key: string]: unknown; } From b5d9fa270907f52e9915c6f54410b22e1cd0521d Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Wed, 10 Jun 2026 12:39:08 +0200 Subject: [PATCH 2/2] ref(node): Remove generic-pool no-this-alias suppressions Replace the three `const instrumentation = this` aliases with captured tracer/bound methods/an arrow over the live `_isDisabled` flag, so no eslint-disable is needed. Only true false-positives keep suppressions. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../genericPool/vendored/instrumentation.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/node/src/integrations/tracing/genericPool/vendored/instrumentation.ts b/packages/node/src/integrations/tracing/genericPool/vendored/instrumentation.ts index 7779b966c7b7..6bf28fd4c83e 100644 --- a/packages/node/src/integrations/tracing/genericPool/vendored/instrumentation.ts +++ b/packages/node/src/integrations/tracing/genericPool/vendored/instrumentation.ts @@ -102,11 +102,10 @@ export class GenericPoolInstrumentation extends InstrumentationBase { } private _acquirePatcher(original: AcquireFn) { - // eslint-disable-next-line @typescript-eslint/no-this-alias - const instrumentation = this; + const tracer = this.tracer; return function wrapped_acquire(this: genericPool.Pool, ...args: unknown[]) { const parent = api.context.active(); - const span = instrumentation.tracer.startSpan('generic-pool.acquire', {}, parent); + const span = tracer.startSpan('generic-pool.acquire', {}, parent); return api.context.with(api.trace.setSpan(parent, span), () => { return (original.call(this, ...args) as PromiseLike).then( @@ -125,29 +124,29 @@ export class GenericPoolInstrumentation extends InstrumentationBase { } private _poolWrapper(original: (this: unknown, ...args: unknown[]) => { acquire: AcquireFn }) { - // eslint-disable-next-line @typescript-eslint/no-this-alias - const instrumentation = this; + const wrap = this._wrap.bind(this); + const acquireWithCallbacksPatcher = this._acquireWithCallbacksPatcher.bind(this); return function wrapped_pool(this: unknown, ...args: unknown[]) { const pool = original.apply(this, args); - instrumentation._wrap(pool, 'acquire', instrumentation._acquireWithCallbacksPatcher.bind(instrumentation)); + wrap(pool, 'acquire', acquireWithCallbacksPatcher); return pool; }; } private _acquireWithCallbacksPatcher(original: AcquireFn) { - // eslint-disable-next-line @typescript-eslint/no-this-alias - const instrumentation = this; + const tracer = this.tracer; + const isDisabled = (): boolean => this._isDisabled; return function wrapped_acquire( this: genericPool.Pool, cb: (err: unknown, client: unknown) => unknown, priority: number, ) { // only used for v2 - v2.3 - if (instrumentation._isDisabled) { + if (isDisabled()) { return original.call(this, cb, priority); } const parent = api.context.active(); - const span = instrumentation.tracer.startSpan('generic-pool.acquire', {}, parent); + const span = tracer.startSpan('generic-pool.acquire', {}, parent); return api.context.with(api.trace.setSpan(parent, span), () => { original.call(