From aede19ce22710c2eef0d624f369f2fda4b032d08 Mon Sep 17 00:00:00 2001 From: simon-id Date: Thu, 27 Nov 2025 14:30:01 +0100 Subject: [PATCH 01/10] Update eslint.config.mjs --- eslint.config.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index be9763c6576..2a5ab124090 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -94,6 +94,7 @@ export default [ promise: eslintPluginPromise }, rules: { + 'no-unused-expressions': 'error', '@stylistic/array-bracket-spacing': ['error', 'never'], '@stylistic/arrow-spacing': ['error', { before: true, after: true }], '@stylistic/block-spacing': ['error', 'always'], From 42e153b6938735cf51f78caaa3f1e84d47c30e7e Mon Sep 17 00:00:00 2001 From: simon-id Date: Thu, 27 Nov 2025 17:57:39 +0100 Subject: [PATCH 02/10] zeui --- eslint.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 2a5ab124090..2736f458fd5 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -94,7 +94,6 @@ export default [ promise: eslintPluginPromise }, rules: { - 'no-unused-expressions': 'error', '@stylistic/array-bracket-spacing': ['error', 'never'], '@stylistic/arrow-spacing': ['error', { before: true, after: true }], '@stylistic/block-spacing': ['error', 'always'], @@ -392,6 +391,7 @@ export default [ unicorn: eslintPluginUnicorn }, rules: { + 'no-unused-expressions': 'error', 'eslint-rules/eslint-process-env': 'error', 'eslint-rules/eslint-env-aliases': 'error', 'eslint-rules/eslint-safe-typeof-object': 'error', From 1ec0138a1e134b39c6cd31792af69a59f800edac Mon Sep 17 00:00:00 2001 From: simon-id Date: Mon, 1 Dec 2025 17:26:34 +0100 Subject: [PATCH 03/10] add void before error.stack --- packages/datadog-instrumentations/src/couchbase.js | 6 +++--- packages/datadog-instrumentations/src/dns.js | 2 +- packages/datadog-instrumentations/src/elasticsearch.js | 2 +- packages/datadog-instrumentations/src/graphql.js | 4 ++-- packages/datadog-instrumentations/src/mysql.js | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/datadog-instrumentations/src/couchbase.js b/packages/datadog-instrumentations/src/couchbase.js index 7a648b7ef71..3dbf332ecd9 100644 --- a/packages/datadog-instrumentations/src/couchbase.js +++ b/packages/datadog-instrumentations/src/couchbase.js @@ -96,7 +96,7 @@ function wrap (prefix, fn) { return fn.apply(this, arguments) } catch (error) { ctx.error = error - error.stack // trigger getting the stack at the original throwing point + void error.stack // trigger getting the stack at the original throwing point errorCh.publish(ctx) throw error @@ -162,7 +162,7 @@ function wrapCBandPromise (fn, name, startData, thisArg, args) { ) return res } catch (e) { - e.stack + void e.stack ctx.error = e errorCh.publish(ctx) throw e @@ -226,7 +226,7 @@ addHook({ name: 'couchbase', file: 'lib/bucket.js', versions: ['^2.6.12'] }, Buc try { return _n1qlReq.apply(this, arguments) } catch (err) { - err.stack // trigger getting the stack at the original throwing point + void err.stack // trigger getting the stack at the original throwing point ctx.error = err errorCh.publish(ctx) diff --git a/packages/datadog-instrumentations/src/dns.js b/packages/datadog-instrumentations/src/dns.js index ac37784c58d..3010911cc55 100644 --- a/packages/datadog-instrumentations/src/dns.js +++ b/packages/datadog-instrumentations/src/dns.js @@ -85,7 +85,7 @@ function wrap (prefix, fn, expectedArgs, rrtype) { return fn.apply(this, arguments) // TODO deal with promise versions when we support `dns/promises` } catch (error) { - error.stack // trigger getting the stack at the original throwing point + void error.stack // trigger getting the stack at the original throwing point ctx.error = error errorCh.publish(ctx) diff --git a/packages/datadog-instrumentations/src/elasticsearch.js b/packages/datadog-instrumentations/src/elasticsearch.js index 9cc7434e7d9..4a6ab62b84a 100644 --- a/packages/datadog-instrumentations/src/elasticsearch.js +++ b/packages/datadog-instrumentations/src/elasticsearch.js @@ -99,7 +99,7 @@ function createWrapRequest (name) { } return promise } catch (err) { - err.stack // trigger getting the stack at the original throwing point + void err.stack // trigger getting the stack at the original throwing point errorCh.publish(err) throw err diff --git a/packages/datadog-instrumentations/src/graphql.js b/packages/datadog-instrumentations/src/graphql.js index 2568661d4c7..84fffe66355 100644 --- a/packages/datadog-instrumentations/src/graphql.js +++ b/packages/datadog-instrumentations/src/graphql.js @@ -103,7 +103,7 @@ function wrapParse (parse) { return ctx.document } catch (err) { - err.stack + void err.stack ctx.error = err parseErrorCh.publish(ctx) @@ -132,7 +132,7 @@ function wrapValidate (validate) { } return errors } catch (err) { - err.stack + void err.stack ctx.error = err validateErrorCh.publish(ctx) diff --git a/packages/datadog-instrumentations/src/mysql.js b/packages/datadog-instrumentations/src/mysql.js index 5710b81d34a..b7bf01e8704 100644 --- a/packages/datadog-instrumentations/src/mysql.js +++ b/packages/datadog-instrumentations/src/mysql.js @@ -44,7 +44,7 @@ addHook({ name: 'mysql', file: 'lib/Connection.js', versions: ['>=2'] }, Connect return res } catch (err) { - err.stack // trigger getting the stack at the original throwing point + void err.stack // trigger getting the stack at the original throwing point ctx.error = err errorCh.publish(ctx) From 41f60e0c3e6c48e3c3493bc79aae8fd5b0688081 Mon Sep 17 00:00:00 2001 From: simon-id Date: Mon, 1 Dec 2025 17:27:16 +0100 Subject: [PATCH 04/10] replace short-circuit with optional chaining --- packages/dd-trace/src/remote_config/scheduler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dd-trace/src/remote_config/scheduler.js b/packages/dd-trace/src/remote_config/scheduler.js index 65460a1e4e3..500565d88f5 100644 --- a/packages/dd-trace/src/remote_config/scheduler.js +++ b/packages/dd-trace/src/remote_config/scheduler.js @@ -17,7 +17,7 @@ class Scheduler { runAfterDelay (interval = this._interval) { this._timer = setTimeout(this._callback, interval, () => this.runAfterDelay()) - this._timer.unref && this._timer.unref() + this._timer.unref?.() } stop () { From 4586202e9daefd77f7c4117c9f6ff3d169709f5d Mon Sep 17 00:00:00 2001 From: simon-id Date: Mon, 1 Dec 2025 17:27:38 +0100 Subject: [PATCH 05/10] replace short-circuit with if condition --- packages/dd-trace/src/opentracing/propagation/text_map.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/dd-trace/src/opentracing/propagation/text_map.js b/packages/dd-trace/src/opentracing/propagation/text_map.js index 3d7668dfcd3..baffcab94c6 100644 --- a/packages/dd-trace/src/opentracing/propagation/text_map.js +++ b/packages/dd-trace/src/opentracing/propagation/text_map.js @@ -129,8 +129,8 @@ class TextMapPropagator { } _injectBaggageItems (spanContext, carrier) { - if (this._config.legacyBaggageEnabled) { - spanContext?._baggageItems && Object.keys(spanContext._baggageItems).forEach(key => { + if (this._config.legacyBaggageEnabled && spanContext?._baggageItems) { + Object.keys(spanContext._baggageItems).forEach(key => { carrier[baggagePrefix + key] = String(spanContext._baggageItems[key]) }) } From c851f95957464e7e5eae83246d0f66fbbb5a3223 Mon Sep 17 00:00:00 2001 From: simon-id Date: Mon, 1 Dec 2025 17:27:53 +0100 Subject: [PATCH 06/10] add probably missing return --- packages/datadog-plugin-azure-functions/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/datadog-plugin-azure-functions/src/index.js b/packages/datadog-plugin-azure-functions/src/index.js index 2203753dd84..d33f03fbd33 100644 --- a/packages/datadog-plugin-azure-functions/src/index.js +++ b/packages/datadog-plugin-azure-functions/src/index.js @@ -117,7 +117,7 @@ function extractTraceContext (tracer, ctx) { case 'Http': return tracer.extract('http_headers', Object.fromEntries(ctx.httpRequest.headers)) default: - null + return null } } From 7ab17eca50f6fd723991c373392ad7ac32c05e9e Mon Sep 17 00:00:00 2001 From: simon-id Date: Mon, 1 Dec 2025 17:29:15 +0100 Subject: [PATCH 07/10] order rule correctly --- eslint.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 2736f458fd5..ca95c2c0a2c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -391,7 +391,6 @@ export default [ unicorn: eslintPluginUnicorn }, rules: { - 'no-unused-expressions': 'error', 'eslint-rules/eslint-process-env': 'error', 'eslint-rules/eslint-env-aliases': 'error', 'eslint-rules/eslint-safe-typeof-object': 'error', @@ -421,6 +420,7 @@ export default [ 'no-await-in-loop': 'error', 'no-else-return': ['error', { allowElseIf: true }], 'no-implicit-coercion': ['error', { boolean: true, number: true, string: true, allow: ['!!'] }], + 'no-unused-expressions': 'error', 'no-useless-assignment': 'error', 'operator-assignment': 'error', 'prefer-exponentiation-operator': 'error', From 511df85c4880203ea334f99d7d89e457cd66dde8 Mon Sep 17 00:00:00 2001 From: simon-id Date: Mon, 1 Dec 2025 19:31:01 +0100 Subject: [PATCH 08/10] disable no-void --- eslint.config.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index ca95c2c0a2c..44dee2771e0 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -422,6 +422,7 @@ export default [ 'no-implicit-coercion': ['error', { boolean: true, number: true, string: true, allow: ['!!'] }], 'no-unused-expressions': 'error', 'no-useless-assignment': 'error', + 'no-void': 'off', 'operator-assignment': 'error', 'prefer-exponentiation-operator': 'error', 'prefer-object-has-own': 'error', From 5782f36ea18526d07730c10ab9f9d0f17a96aebd Mon Sep 17 00:00:00 2001 From: simon-id Date: Mon, 1 Dec 2025 19:39:39 +0100 Subject: [PATCH 09/10] fix weird line --- packages/datadog-instrumentations/src/mariadb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/datadog-instrumentations/src/mariadb.js b/packages/datadog-instrumentations/src/mariadb.js index bd3bb1334f2..a4deb69f7ce 100644 --- a/packages/datadog-instrumentations/src/mariadb.js +++ b/packages/datadog-instrumentations/src/mariadb.js @@ -66,7 +66,7 @@ function createWrapQuery (options) { finishCh.publish(ctx) return result }, error => { - ctx.error + ctx.error = error errorCh.publish(ctx) finishCh.publish(ctx) throw error From 61593c831941035e679f4b31a65e1416a7e89eb2 Mon Sep 17 00:00:00 2001 From: simon-id Date: Wed, 3 Dec 2025 10:30:39 +0100 Subject: [PATCH 10/10] Update packages/dd-trace/src/remote_config/scheduler.js Co-authored-by: Thomas Watson --- packages/dd-trace/src/remote_config/scheduler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dd-trace/src/remote_config/scheduler.js b/packages/dd-trace/src/remote_config/scheduler.js index 500565d88f5..80fbab33333 100644 --- a/packages/dd-trace/src/remote_config/scheduler.js +++ b/packages/dd-trace/src/remote_config/scheduler.js @@ -17,7 +17,7 @@ class Scheduler { runAfterDelay (interval = this._interval) { this._timer = setTimeout(this._callback, interval, () => this.runAfterDelay()) - this._timer.unref?.() + this._timer.unref() } stop () {