Skip to content

Commit

Permalink
refactor(sdk-node): fix eslint warning
Browse files Browse the repository at this point in the history
```
/home/runner/work/opentelemetry-js/opentelemetry-js/experimental/packages/opentelemetry-sdk-node/src/index.ts
  20:1  warning  Using 'ExportAllDeclaration' is not allowed  no-restricted-syntax
  21:1  warning  Using 'ExportAllDeclaration' is not allowed  no-restricted-syntax
  22:1  warning  Using 'ExportAllDeclaration' is not allowed  no-restricted-syntax
  23:1  warning  Using 'ExportAllDeclaration' is not allowed  no-restricted-syntax
  24:1  warning  Using 'ExportAllDeclaration' is not allowed  no-restricted-syntax
  25:1  warning  Using 'ExportAllDeclaration' is not allowed  no-restricted-syntax
  26:1  warning  Using 'ExportAllDeclaration' is not allowed  no-restricted-syntax
  27:1  warning  Using 'ExportAllDeclaration' is not allowed  no-restricted-syntax
```

This feels a bit different than the other ones, as this is a meta-
package, and these are wildcard exports to re-export all the public
exports from the upstream packages into individual _namespaces_.

There is no risk of accidentally exporting something that wasn't
meant to be public, and it would be a huge pain to enumerate things
from each of the upstream packages and keep things in-sync.

Ref open-telemetry#5365
  • Loading branch information
chancancode committed Jan 30, 2025
1 parent 3c040c4 commit 926e20c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions experimental/packages/opentelemetry-sdk-node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* limitations under the License.
*/

/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace wildcard export with named exports before next major version
*/
// These exist to re-export *all* items from the individual packages as
// individual namespaces, so `export *` is appropriate here.

/* eslint-disable no-restricted-syntax */
export * as api from '@opentelemetry/api';
export * as contextBase from '@opentelemetry/api';
export * as core from '@opentelemetry/core';
Expand All @@ -25,5 +26,7 @@ export * as metrics from '@opentelemetry/sdk-metrics';
export * as node from '@opentelemetry/sdk-trace-node';
export * as resources from '@opentelemetry/resources';
export * as tracing from '@opentelemetry/sdk-trace-base';
/* eslint-enable no-restricted-syntax */

export { LoggerProviderConfig, MeterProviderConfig, NodeSDK } from './sdk';
export { NodeSDKConfiguration } from './types';

0 comments on commit 926e20c

Please sign in to comment.