Skip to content

Commit 92e951f

Browse files
authored
build: Update @typescript-eslint packages & fix resulting linting issues (#6657)
1 parent 0f9a3df commit 92e951f

File tree

21 files changed

+141
-76
lines changed

21 files changed

+141
-76
lines changed

packages/browser/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tmp.js

packages/browser/src/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,5 +179,5 @@ export interface ReportDialogOptions {
179179
errorFormEntry?: string;
180180
successMessage?: string;
181181
/** Callback after reportDialog showed up */
182-
onLoad?(): void;
182+
onLoad?(this: void): void;
183183
}

packages/browser/src/sdk.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ export function showReportDialog(options: ReportDialogOptions = {}, hub: Hub = g
164164
script.src = getReportDialogEndpoint(dsn, options);
165165

166166
if (options.onLoad) {
167-
// eslint-disable-next-line @typescript-eslint/unbound-method
168167
script.onload = options.onLoad;
169168
}
170169

packages/browser/test/unit/sdk.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
/* eslint-disable @typescript-eslint/unbound-method */
2-
import { Scope } from '@sentry/core';
3-
import { createTransport } from '@sentry/core';
2+
import { createTransport, Scope } from '@sentry/core';
43
import { MockIntegration } from '@sentry/core/test/lib/sdk.test';
54
import { Client, Integration } from '@sentry/types';
65
import { resolvedSyncPromise } from '@sentry/utils';
76

87
import { BrowserOptions } from '../../src';
98
import { init } from '../../src/sdk';
10-
// eslint-disable-next-line no-var
11-
declare var global: any;
129

1310
const PUBLIC_DSN = 'https://username@domain/123';
1411

packages/core/src/hub.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ export class Hub implements HubInterface {
258258

259259
if (!scope || !client) return;
260260

261-
// eslint-disable-next-line @typescript-eslint/unbound-method
262261
const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =
263262
(client.getOptions && client.getOptions()) || {};
264263

packages/eslint-config-sdk/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"dependencies": {
2222
"@sentry-internal/eslint-plugin-sdk": "7.29.0",
2323
"@sentry-internal/typescript": "7.29.0",
24-
"@typescript-eslint/eslint-plugin": "^3.9.0",
25-
"@typescript-eslint/parser": "^3.9.0",
24+
"@typescript-eslint/eslint-plugin": "^5.48.0",
25+
"@typescript-eslint/parser": "^5.48.0",
2626
"eslint-config-prettier": "^6.11.0",
2727
"eslint-plugin-deprecation": "^1.1.0",
2828
"eslint-plugin-import": "^2.22.0",

packages/nextjs/src/config/wrappers/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ import type { NextApiRequest, NextApiResponse } from 'next';
2323
// wrapped route from being wrapped again by the auto-wrapper.
2424

2525
export type NextApiHandler = {
26-
__sentry_route__?: string;
2726
(req: NextApiRequest, res: NextApiResponse): void | Promise<void> | unknown | Promise<unknown>;
27+
__sentry_route__?: string;
2828
};
2929

3030
export type WrappedNextApiHandler = {
31+
(req: NextApiRequest, res: NextApiResponse): Promise<void> | Promise<unknown>;
3132
__sentry_route__?: string;
3233
__sentry_wrapped__?: boolean;
33-
(req: NextApiRequest, res: NextApiResponse): Promise<void> | Promise<unknown>;
3434
};
3535

3636
export type AugmentedNextApiRequest = NextApiRequest & {

packages/node/src/handlers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export function errorHandler(options?: {
256256
* Callback method deciding whether error should be captured and sent to Sentry
257257
* @param error Captured middleware error
258258
*/
259-
shouldHandleError?(error: MiddlewareError): boolean;
259+
shouldHandleError?(this: void, error: MiddlewareError): boolean;
260260
}): (
261261
error: MiddlewareError,
262262
req: http.IncomingMessage,
@@ -269,7 +269,6 @@ export function errorHandler(options?: {
269269
res: http.ServerResponse,
270270
next: (error: MiddlewareError) => void,
271271
): void {
272-
// eslint-disable-next-line @typescript-eslint/unbound-method
273272
const shouldHandleError = (options && options.shouldHandleError) || defaultShouldHandleError;
274273

275274
if (shouldHandleError(error)) {

packages/node/src/integrations/onuncaughtexception.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface OnUncaughtExceptionOptions {
2929
* `onFatalError` itself threw, or because an independent error happened somewhere else while `onFatalError`
3030
* was running.
3131
*/
32-
onFatalError?(firstError: Error, secondError?: Error): void;
32+
onFatalError?(this: void, firstError: Error, secondError?: Error): void;
3333
}
3434

3535
/** Global Exception handler */
@@ -84,10 +84,8 @@ export class OnUncaughtException implements Integration {
8484
const client = getCurrentHub().getClient<NodeClient>();
8585

8686
if (this._options.onFatalError) {
87-
// eslint-disable-next-line @typescript-eslint/unbound-method
8887
onFatalError = this._options.onFatalError;
8988
} else if (client && client.getOptions().onFatalError) {
90-
// eslint-disable-next-line @typescript-eslint/unbound-method
9189
onFatalError = client.getOptions().onFatalError as OnFatalErrorHandler;
9290
}
9391

packages/node/src/transports/http.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ export function makeNodeTransport(options: NodeTransportOptions): Transport {
7474
// TODO(v7): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node
7575
// versions(>= 8) as they had memory leaks when using it: #2555
7676
const agent = proxy
77-
? (new (require('https-proxy-agent'))(proxy) as http.Agent)
77+
? // eslint-disable-next-line @typescript-eslint/no-var-requires
78+
(new (require('https-proxy-agent'))(proxy) as http.Agent)
7879
: new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2000 });
7980

8081
const requestExecutor = createRequestExecutor(options, options.httpModule ?? nativeHttpModule, agent);

0 commit comments

Comments
 (0)