opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

Set the exactOptionalPropertyTypes tsconfig option

Open googol opened this issue 2 years ago • 7 comments
trafficstars

Since typescript 4.4 this new tsconfig option has been available, to clarify the difference between { foo: string | undefined } and { foo?: string }. This would be a beneficial option for me to enable in my project, but I cannot as the opentelemetry typings don't typecheck correctly with option.

Affected files that I'm seeing:

Errors  Files
     1  node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentationNodeModuleDefinition.d.ts:2
     1  node_modules/@opentelemetry/instrumentation-dns/build/src/instrumentation.d.ts:10
     1  node_modules/@opentelemetry/instrumentation-express/build/src/instrumentation.d.ts:9
     1  node_modules/@opentelemetry/instrumentation-http/build/src/http.d.ts:22
     1  node_modules/@opentelemetry/instrumentation-net/build/src/instrumentation.d.ts:5
     1  node_modules/@opentelemetry/instrumentation-pg/build/src/instrumentation.d.ts:9
     1  node_modules/@opentelemetry/instrumentation-winston/build/src/instrumentation.d.ts:5
     1  node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentationNodeModuleDefinition.d.ts:2

Link to documentation: https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes

  • [x] This only affects the JavaScript OpenTelemetry library
  • [ ] This may affect other libraries, but I would like to get opinions here first

googol avatar Apr 03 '23 11:04 googol

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Jun 05 '23 06:06 github-actions[bot]

please consider this change

googol avatar Jun 05 '23 07:06 googol

Seeing this same issue in my projects

voxpelli avatar Jun 12 '23 20:06 voxpelli

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Aug 14 '23 06:08 github-actions[bot]

Bumping to keep this alive. This is still desired

googol avatar Aug 14 '23 07:08 googol

We talked about this in the SIG meeting and we are generally in favor of this, assuming it doesn't cause issues. I'm going to mark this as up for grabs and PRs will be welcome.

dyladan avatar Feb 28 '24 17:02 dyladan