Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(instrumentation-fetch): fix lint warnings #2454

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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