Skip to content

Commit 722183b

Browse files
authored
ref(eslint): Remove unused eslint-disable directives (#10771)
Remove some unused directives to for less eslint warnings. Related to #10610
1 parent 1782d80 commit 722183b

36 files changed

+6
-49
lines changed

dev-packages/e2e-tests/prepare.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable max-lines */
21
/* eslint-disable no-console */
32
import * as dotenv from 'dotenv';
43

dev-packages/e2e-tests/publish-packages.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console */
21
import * as childProcess from 'child_process';
32
import * as path from 'path';
43
import * as glob from 'glob';

dev-packages/e2e-tests/run.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable max-lines */
21
/* eslint-disable no-console */
32
import { spawn } from 'child_process';
43
import { resolve } from 'path';

packages/browser/test/unit/index.test.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ describe('SentryBrowser', () => {
9191
getCurrentScope().setUser(EX_USER);
9292
setCurrentClient(client);
9393

94-
// eslint-disable-next-line deprecation/deprecation
9594
showReportDialog({ eventId: 'foobar' });
9695

9796
expect(getReportDialogEndpoint).toHaveBeenCalledTimes(1);
@@ -106,7 +105,6 @@ describe('SentryBrowser', () => {
106105
setCurrentClient(client);
107106

108107
const DIALOG_OPTION_USER = { email: '[email protected]' };
109-
// eslint-disable-next-line deprecation/deprecation
110108
showReportDialog({ eventId: 'foobar', user: DIALOG_OPTION_USER });
111109

112110
expect(getReportDialogEndpoint).toHaveBeenCalledTimes(1);
@@ -140,7 +138,7 @@ describe('SentryBrowser', () => {
140138

141139
it('should call `onClose` when receiving `__sentry_reportdialog_closed__` MessageEvent', async () => {
142140
const onClose = jest.fn();
143-
// eslint-disable-next-line deprecation/deprecation
141+
144142
showReportDialog({ eventId: 'foobar', onClose });
145143

146144
await waitForPostMessage('__sentry_reportdialog_closed__');
@@ -155,7 +153,7 @@ describe('SentryBrowser', () => {
155153
const onClose = jest.fn(() => {
156154
throw new Error();
157155
});
158-
// eslint-disable-next-line deprecation/deprecation
156+
159157
showReportDialog({ eventId: 'foobar', onClose });
160158

161159
await waitForPostMessage('__sentry_reportdialog_closed__');
@@ -168,7 +166,7 @@ describe('SentryBrowser', () => {
168166

169167
it('should not call `onClose` for other MessageEvents', async () => {
170168
const onClose = jest.fn();
171-
// eslint-disable-next-line deprecation/deprecation
169+
172170
showReportDialog({ eventId: 'foobar', onClose });
173171

174172
await waitForPostMessage('some_message');

packages/bun/src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ export { bunServerIntegration } from './integrations/bunserver';
121121
const INTEGRATIONS = {
122122
// eslint-disable-next-line deprecation/deprecation
123123
...CoreIntegrations,
124-
// eslint-disable-next-line deprecation/deprecation
125124
...NodeIntegrations,
126125
BunServer,
127126
};

packages/core/src/baseclient.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
150150
/**
151151
* @inheritDoc
152152
*/
153-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
153+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
154154
public captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined {
155155
// ensure we haven't captured this very object before
156156
if (checkOrSetAlreadyCaught(exception)) {
@@ -857,7 +857,7 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
857857
/**
858858
* @inheritDoc
859859
*/
860-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
860+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
861861
public abstract eventFromException(_exception: any, _hint?: EventHint): PromiseLike<Event>;
862862

863863
/**

packages/core/src/integrations/inboundfilters.ts

-2
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ function _getPossibleEventMessages(event: Event): string[] {
173173
let lastException;
174174
try {
175175
// @ts-expect-error Try catching to save bundle size
176-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
177176
lastException = event.exception.values[event.exception.values.length - 1];
178177
} catch (e) {
179178
// try catching to save bundle size checking existence of variables
@@ -198,7 +197,6 @@ function _getPossibleEventMessages(event: Event): string[] {
198197
function _isSentryError(event: Event): boolean {
199198
try {
200199
// @ts-expect-error can't be a sentry error if undefined
201-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
202200
return event.exception.values[0].type === 'SentryError';
203201
} catch (e) {
204202
// ignore

packages/core/src/tracing/hubextensions.ts

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ function _startTransaction(
4242
The transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,
4343
);
4444

45-
// eslint-disable-next-line deprecation/deprecation
4645
transactionContext.sampled = false;
4746
}
4847

packages/core/src/tracing/idletransaction.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable max-lines */
21
import type { Hub, SpanTimeInput, TransactionContext } from '@sentry/types';
32
import { logger, timestampInSeconds } from '@sentry/utils';
43

packages/core/src/tracing/sampling.ts

-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ export function sampleTransaction<T extends Transaction>(
107107
*/
108108
function isValidSampleRate(rate: unknown): boolean {
109109
// we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck
110-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
111110
if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {
112111
DEBUG_BUILD &&
113112
logger.warn(

packages/core/src/tracing/transaction.ts

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export class Transaction extends SentrySpan implements TransactionInterface {
8989
}
9090

9191
// This sadly conflicts with the getter/setter ordering :(
92-
/* eslint-disable @typescript-eslint/member-ordering */
9392

9493
/**
9594
* Get the metadata for this transaction.

packages/core/test/lib/api.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable deprecation/deprecation */
21
import type { ClientOptions, DsnComponents } from '@sentry/types';
32
import { makeDsn } from '@sentry/utils';
43

packages/core/test/lib/session.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable deprecation/deprecation */
2-
31
import type { SessionContext } from '@sentry/types';
42
import { timestampInSeconds } from '@sentry/utils';
53

packages/core/test/lib/sessionflusher.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable deprecation/deprecation */
2-
31
import type { Client } from '@sentry/types';
42

53
import { SessionFlusher } from '../../src/sessionflusher';

packages/core/test/lib/tracing/span.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { TRACE_FLAG_NONE, TRACE_FLAG_SAMPLED, spanToJSON } from '../../../src/ut
44

55
describe('span', () => {
66
describe('name', () => {
7-
/* eslint-disable deprecation/deprecation */
87
it('works with name', () => {
98
const span = new SentrySpan({ name: 'span name' });
109
expect(spanToJSON(span).description).toEqual('span name');

packages/core/test/mocks/client.ts

-3
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,11 @@ export class TestClient extends BaseClient<TestClientOptions> {
4949
TestClient.instance = this;
5050
}
5151

52-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
5352
public eventFromException(exception: any): PromiseLike<Event> {
5453
const event: Event = {
5554
exception: {
5655
values: [
5756
{
58-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
5957
type: exception.name,
6058
value: exception.message,
6159
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
@@ -86,7 +84,6 @@ export class TestClient extends BaseClient<TestClientOptions> {
8684
super.sendEvent(event, hint);
8785
return;
8886
}
89-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
9087
TestClient.sendEventCalled && TestClient.sendEventCalled(event);
9188
}
9289

packages/feedback/test/utils/TestClient.ts

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export class TestClient extends BaseClient<TestClientOptions> {
1414
exception: {
1515
values: [
1616
{
17-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
1817
type: exception.name,
1918
value: exception.message,
2019
/* eslint-enable @typescript-eslint/no-unsafe-member-access */

packages/node/src/integrations/http.ts

-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ function _createWrappedRequestMethodFactory(
314314
return function wrappedMethod(this: unknown, ...args: RequestMethodArgs): http.ClientRequest {
315315
const requestArgs = normalizeRequestArgs(httpModule, args);
316316
const requestOptions = requestArgs[0];
317-
// eslint-disable-next-line deprecation/deprecation
318317
const rawRequestUrl = extractRawUrl(requestOptions);
319318
const requestUrl = extractUrl(requestOptions);
320319
const client = getClient();

packages/profiling-node/src/cpu_profiler.ts

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
3434
return require(`${binaryPath}.node`);
3535
}
3636

37-
/* eslint-disable no-fallthrough */
3837
// We need the fallthrough so that in the end, we can fallback to the require dynamice require.
3938
// This is for cases where precompiled binaries were not provided, but may have been compiled from source.
4039
if (platform === 'darwin') {

packages/profiling-node/src/integration.ts

-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ export class ProfilingIntegration implements Integration {
140140

141141
// Remove the profile from the transaction context before sending, relay will take care of the rest.
142142
if (profileContext) {
143-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
144143
delete profiledTransaction.contexts?.['profile'];
145144
}
146145

packages/profiling-node/src/utils.ts

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import type { DebugImage } from './types';
2626

2727
// We require the file because if we import it, it will be included in the bundle.
2828
// I guess tsc does not check file contents when it's imported.
29-
// eslint-disable-next-line
3029
const THREAD_ID_STRING = String(threadId);
3130
const THREAD_NAME = isMainThread ? 'main' : 'worker';
3231
const FORMAT_VERSION = '1';

packages/replay/src/util/getReplay.ts

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { replayIntegration } from '../integration';
44
/**
55
* This is a small utility to get a type-safe instance of the Replay integration.
66
*/
7-
// eslint-disable-next-line deprecation/deprecation
87
export function getReplay(): ReturnType<typeof replayIntegration> | undefined {
98
const client = getClient();
109
return client && client.getIntegrationByName<ReturnType<typeof replayIntegration>>('Replay');

packages/tracing-internal/src/browser/browserTracingIntegration.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable max-lines */
21
import type { IdleTransaction } from '@sentry/core';
32
import { getActiveSpan } from '@sentry/core';
43
import { getCurrentHub } from '@sentry/core';

packages/tracing-internal/src/browser/browsertracing.ts

-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ export class BrowserTracing implements Integration {
340340
this._latestRouteSource = finalContext.attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];
341341
}
342342

343-
// eslint-disable-next-line deprecation/deprecation
344343
if (finalContext.sampled === false) {
345344
DEBUG_BUILD && logger.log(`[Tracing] Will not send ${finalContext.op} transaction because of beforeNavigate.`);
346345
}

packages/tracing-internal/src/node/integrations/mongo.ts

-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ export class Mongo implements LazyLoadedIntegration<MongoModule> {
174174
fill(collection.prototype, operation, function (orig: () => void | Promise<unknown>) {
175175
return function (this: unknown, ...args: unknown[]) {
176176
const lastArg = args[args.length - 1];
177-
// eslint-disable-next-line deprecation/deprecation
178177
const hub = getCurrentHub();
179178
// eslint-disable-next-line deprecation/deprecation
180179
const scope = hub.getScope();

packages/types/src/client.ts

-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ export interface Client<O extends ClientOptions = ClientOptions> {
159159
init(): void;
160160

161161
/** Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. */
162-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
163162
eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;
164163

165164
/** Creates an {@link Event} from primitive inputs to `captureMessage`. */

packages/types/src/startSpanOptions.ts

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ export interface StartSpanOptions extends TransactionContext {
8585
/**
8686
* @deprecated Use attributes instead.
8787
*/
88-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8988
data?: { [key: string]: any };
9089

9190
/**

packages/utils/src/browser.ts

-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ function _htmlElementAsString(el: unknown, keyAttrs?: string[]): string {
111111
out.push(`#${elem.id}`);
112112
}
113113

114-
// eslint-disable-next-line prefer-const
115114
className = elem.className;
116115
if (className && isString(className)) {
117116
classes = className.split(/\s+/);

packages/utils/src/instrument/fetch.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
2-
/* eslint-disable @typescript-eslint/ban-types */
32
import type { HandlerDataFetch } from '@sentry/types';
43

54
import { fill } from '../object';

packages/utils/src/is.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
2-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
32

43
import type { ParameterizedString, PolymorphicEvent, Primitive } from '@sentry/types';
54

packages/utils/src/node-stack-trace.ts

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export function filenameIsInApp(filename: string, isNative: boolean = false): bo
5050
}
5151

5252
/** Node Stack line parser */
53-
// eslint-disable-next-line complexity
5453
export function node(getModule?: GetModuleFn): StackLineParserFn {
5554
const FILENAME_MATCH = /^\s*[-]{4,}$/;
5655
const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;

packages/utils/src/node.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function isNodeEnv(): boolean {
2424
*
2525
* @param request The module path to resolve
2626
*/
27-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
27+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2828
export function dynamicRequire(mod: any, request: string): any {
2929
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
3030
return mod.require(request);

packages/utils/src/object.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable max-lines */
21
/* eslint-disable @typescript-eslint/no-explicit-any */
32
import type { WrappedFunction } from '@sentry/types';
43

packages/utils/src/syncpromise.ts

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/* eslint-disable @typescript-eslint/explicit-function-return-type */
2-
/* eslint-disable @typescript-eslint/typedef */
3-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
42
/* eslint-disable @typescript-eslint/no-explicit-any */
53
import { isThenable } from './is';
64

@@ -182,7 +180,6 @@ class SyncPromise<T> implements PromiseLike<T> {
182180
}
183181

184182
if (this._state === States.RESOLVED) {
185-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
186183
handler[1](this._value as unknown as any);
187184
}
188185

packages/utils/test/normalize.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,13 @@ describe('normalize()', () => {
190190
});
191191

192192
test('circular arrays', () => {
193-
// eslint-disable-next-line @typescript-eslint/ban-types
194193
const obj: object[] = [];
195194
obj.push(obj);
196195
obj.push(obj);
197196
expect(normalize(obj)).toEqual(['[Circular ~]', '[Circular ~]']);
198197
});
199198

200199
test('circular arrays with intermediaries', () => {
201-
// eslint-disable-next-line @typescript-eslint/ban-types
202200
const obj: object[] = [];
203201
obj.push({ name: 'Alice', self: obj });
204202
obj.push({ name: 'Bob', self: obj });

packages/utils/test/syncpromise.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ describe('SyncPromise', () => {
138138

139139
let foo: number = 1;
140140

141-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
142141
new SyncPromise<number>(_ => {
143142
foo = 2;
144143
});

0 commit comments

Comments
 (0)