Skip to content

Commit

Permalink
chore(instrumentation-fetch): fix lint warnings (#2454)
Browse files Browse the repository at this point in the history
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
  • Loading branch information
alisabzevari and vmarchaud committed Sep 4, 2021
1 parent 6617573 commit 7b01cfa
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/opentelemetry-instrumentation-fetch/src/fetch.ts
Expand Up @@ -84,7 +84,7 @@ export class FetchInstrumentation extends InstrumentationBase<
);
}

init() {}
init(): void {}

private _getConfig(): FetchInstrumentationConfig {
return this._config;
Expand Down Expand Up @@ -326,11 +326,9 @@ export class FetchInstrumentation extends InstrumentationBase<
}
function onSuccess(
span: api.Span,
resolve: (
value?: Response | PromiseLike<Response> | undefined
) => void,
resolve: (value: Response | PromiseLike<Response>) => void,
response: Response
) {
): void {
try {
const resClone = response.clone();
const body = resClone.body;
Expand Down Expand Up @@ -381,7 +379,7 @@ export class FetchInstrumentation extends InstrumentationBase<
return original
.apply(this, options instanceof Request ? [options] : [url, options])
.then(
(onSuccess as any).bind(this, createdSpan, resolve),
onSuccess.bind(this, createdSpan, resolve),
onError.bind(this, createdSpan, reject)
);
}
Expand Down Expand Up @@ -447,7 +445,7 @@ export class FetchInstrumentation extends InstrumentationBase<
/**
* implements enable function
*/
override enable() {
override enable(): void {
if (isWrapped(window.fetch)) {
this._unwrap(window, 'fetch');
this._diag.debug('removing previous patch for constructor');
Expand All @@ -458,7 +456,7 @@ export class FetchInstrumentation extends InstrumentationBase<
/**
* implements unpatch function
*/
override disable() {
override disable(): void {
this._unwrap(window, 'fetch');
this._usedResources = new WeakSet<PerformanceResourceTiming>();
}
Expand Down

0 comments on commit 7b01cfa

Please sign in to comment.