Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Commit 0c2c76f

Browse files
committed
fix: change the way package.json is being imported
1 parent 2cbaa28 commit 0c2c76f

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/opentelemetry-tracing.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ import {
2424
SpanKind,
2525
} from '@opentelemetry/api';
2626

27-
// eslint-disable-next-line @typescript-eslint/no-var-requires
28-
const PKG = require('../../package.json');
27+
import * as PKG from '../package.json';
2928

3029
/**
3130
* @internal

src/pubsub.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import * as extend from 'extend';
2121
import {GoogleAuth} from 'google-auth-library';
2222
import * as gax from 'google-gax';
2323

24-
// eslint-disable-next-line @typescript-eslint/no-var-requires
25-
const PKG = require('../../package.json');
24+
import * as PKG from '../package.json';
25+
2626
// eslint-disable-next-line @typescript-eslint/no-var-requires
2727
const v1 = require('./v1');
2828

test/pubsub.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import * as subby from '../src/subscription';
2828
import {Topic} from '../src/topic';
2929
import * as util from '../src/util';
3030

31-
// eslint-disable-next-line @typescript-eslint/no-var-requires
32-
const PKG = require('../../package.json');
31+
import * as PKG from '../package.json';
32+
3333
const sandbox = sinon.createSandbox();
3434

3535
const fakeCreds = {} as gax.grpc.ChannelCredentials;

0 commit comments

Comments
 (0)