From 9ca65fcd1992f4db0e9040455d69f209047381d8 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Sun, 10 Nov 2019 13:04:06 -0500 Subject: [PATCH] fix: lint --- .../src/documentLoad.ts | 2 +- packages/opentelemetry-plugin-grpc/src/grpc.ts | 9 ++++++--- packages/opentelemetry-plugin-http/src/http.ts | 2 +- packages/opentelemetry-plugin-http/src/types.ts | 2 +- packages/opentelemetry-plugin-http/src/utils.ts | 2 +- .../opentelemetry-plugin-pg/src/pg.ts | 7 ++++--- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/opentelemetry-plugin-document-load/src/documentLoad.ts b/packages/opentelemetry-plugin-document-load/src/documentLoad.ts index 0ffea50d310..520c2b24b0b 100644 --- a/packages/opentelemetry-plugin-document-load/src/documentLoad.ts +++ b/packages/opentelemetry-plugin-document-load/src/documentLoad.ts @@ -198,7 +198,7 @@ export class DocumentLoad extends BasePlugin { }); } else { // // fallback to previous version - const perf: (typeof otperformance) & PerformanceLegacy = otperformance; + const perf: typeof otperformance & PerformanceLegacy = otperformance; const performanceTiming = perf.timing; if (performanceTiming) { const keys = Object.values(PTN); diff --git a/packages/opentelemetry-plugin-grpc/src/grpc.ts b/packages/opentelemetry-plugin-grpc/src/grpc.ts index 531bd80bbf6..9c44c65abd4 100644 --- a/packages/opentelemetry-plugin-grpc/src/grpc.ts +++ b/packages/opentelemetry-plugin-grpc/src/grpc.ts @@ -354,9 +354,12 @@ export class GrpcPlugin extends BasePlugin { parent: currentSpan || undefined, }) .setAttribute(AttributeNames.COMPONENT, GrpcPlugin.component); - return plugin._makeGrpcClientRemoteCall(original, args, this, plugin)( - span - ); + return plugin._makeGrpcClientRemoteCall( + original, + args, + this, + plugin + )(span); }; }; } diff --git a/packages/opentelemetry-plugin-http/src/http.ts b/packages/opentelemetry-plugin-http/src/http.ts index 76278b5760c..22c34c62b64 100644 --- a/packages/opentelemetry-plugin-http/src/http.ts +++ b/packages/opentelemetry-plugin-http/src/http.ts @@ -485,7 +485,7 @@ export class HttpPlugin extends BasePlugin { span: Span, execute: T, rethrow: K - ): K extends true ? ReturnType : (ReturnType | void); + ): K extends true ? ReturnType : ReturnType | void; private _safeExecute ReturnType>( span: Span, execute: T, diff --git a/packages/opentelemetry-plugin-http/src/types.ts b/packages/opentelemetry-plugin-http/src/types.ts index 05fe0338630..e55c3583483 100644 --- a/packages/opentelemetry-plugin-http/src/types.ts +++ b/packages/opentelemetry-plugin-http/src/types.ts @@ -39,7 +39,7 @@ export type RequestSignature = [http.RequestOptions, HttpCallbackOptional] & export type HttpRequestArgs = Array; export type ParsedRequestOptions = - | http.RequestOptions & Partial + | (http.RequestOptions & Partial) | http.RequestOptions; export type Http = typeof http; /* tslint:disable-next-line:no-any */ diff --git a/packages/opentelemetry-plugin-http/src/utils.ts b/packages/opentelemetry-plugin-http/src/utils.ts index b1a27b97fd8..f4d5d052e01 100644 --- a/packages/opentelemetry-plugin-http/src/utils.ts +++ b/packages/opentelemetry-plugin-http/src/utils.ts @@ -46,7 +46,7 @@ export const getAbsoluteUrl = ( // it should be displayed if it's not 80 and 443 (default ports) if ( (host as string).indexOf(':') === -1 && - (port && port !== '80' && port !== '443') + port && port !== '80' && port !== '443' ) { host += `:${port}`; } diff --git a/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/src/pg.ts b/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/src/pg.ts index e41ceee08a0..a6841ae33a8 100644 --- a/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/src/pg.ts +++ b/packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/src/pg.ts @@ -97,9 +97,10 @@ export class PostgresPlugin extends BasePlugin { const parentSpan = plugin._tracer.getCurrentSpan(); if (typeof args[args.length - 1] === 'function') { // Patch ParameterQuery callback - args[args.length - 1] = utils.patchCallback(span, args[ - args.length - 1 - ] as PostgresCallback); + args[args.length - 1] = utils.patchCallback( + span, + args[args.length - 1] as PostgresCallback + ); // If a parent span exists, bind the callback if (parentSpan) { args[args.length - 1] = plugin._tracer.bind(