Skip to content

Commit f63b33b

Browse files
authored
ref: Remove all usages of ts-ignore (#8974)
Replace ts-ignore with ts-expect-error
1 parent 4278a71 commit f63b33b

File tree

140 files changed

+441
-460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+441
-460
lines changed

packages/angular/test/errorhandler.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ describe('SentryErrorHandler', () => {
532532
}),
533533
};
534534

535-
// @ts-ignore this is a minmal hub, we're missing a few props but that's ok
535+
// @ts-expect-error this is a minmal hub, we're missing a few props but that's ok
536536
jest.spyOn(SentryBrowser, 'getCurrentHub').mockImplementationOnce(() => {
537537
return { getClient: () => client };
538538
});

packages/browser-integration-tests/suites/replay/bufferMode/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ sentryTest(
6868
expect(
6969
await page.evaluate(() => {
7070
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
71-
// @ts-ignore private
71+
// @ts-expect-error private
7272
const replay = replayIntegration._replay;
7373
replayIntegration.startBuffering();
7474
return replay.isEnabled();
@@ -210,7 +210,7 @@ sentryTest(
210210
expect(
211211
await page.evaluate(() => {
212212
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
213-
// @ts-ignore private
213+
// @ts-expect-error private
214214
const replay = replayIntegration._replay;
215215
replayIntegration.startBuffering();
216216
return replay.isEnabled();

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestBody/test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ sentryTest('captures text request body', async ({ getLocalTestPath, page, browse
4141
method: 'POST',
4242
body: 'input body',
4343
}).then(() => {
44-
// @ts-ignore Sentry is a global
44+
// @ts-expect-error Sentry is a global
4545
Sentry.captureException('test error');
4646
});
4747
/* eslint-enable */
@@ -120,7 +120,7 @@ sentryTest('captures JSON request body', async ({ getLocalTestPath, page, browse
120120
method: 'POST',
121121
body: '{"foo":"bar"}',
122122
}).then(() => {
123-
// @ts-ignore Sentry is a global
123+
// @ts-expect-error Sentry is a global
124124
Sentry.captureException('test error');
125125
});
126126
/* eslint-enable */
@@ -203,7 +203,7 @@ sentryTest('captures non-text request body', async ({ getLocalTestPath, page, br
203203
method: 'POST',
204204
body: body,
205205
}).then(() => {
206-
// @ts-ignore Sentry is a global
206+
// @ts-expect-error Sentry is a global
207207
Sentry.captureException('test error');
208208
});
209209
/* eslint-enable */
@@ -282,7 +282,7 @@ sentryTest('captures text request body when matching relative URL', async ({ get
282282
method: 'POST',
283283
body: 'input body',
284284
}).then(() => {
285-
// @ts-ignore Sentry is a global
285+
// @ts-expect-error Sentry is a global
286286
Sentry.captureException('test error');
287287
});
288288
/* eslint-enable */
@@ -359,7 +359,7 @@ sentryTest('does not capture request body when URL does not match', async ({ get
359359
method: 'POST',
360360
body: 'input body',
361361
}).then(() => {
362-
// @ts-ignore Sentry is a global
362+
// @ts-expect-error Sentry is a global
363363
Sentry.captureException('test error');
364364
});
365365
/* eslint-enable */

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestHeaders/test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ sentryTest('handles empty/missing request headers', async ({ getLocalTestPath, p
3838
fetch('http://localhost:7654/foo', {
3939
method: 'POST',
4040
}).then(() => {
41-
// @ts-ignore Sentry is a global
41+
// @ts-expect-error Sentry is a global
4242
Sentry.captureException('test error');
4343
});
4444
/* eslint-enable */
@@ -117,7 +117,7 @@ sentryTest('captures request headers as POJO', async ({ getLocalTestPath, page,
117117
'X-Test-Header': 'test-value',
118118
},
119119
}).then(() => {
120-
// @ts-ignore Sentry is a global
120+
// @ts-expect-error Sentry is a global
121121
Sentry.captureException('test error');
122122
});
123123
/* eslint-enable */
@@ -201,7 +201,7 @@ sentryTest('captures request headers on Request', async ({ getLocalTestPath, pag
201201
});
202202
/* eslint-disable */
203203
fetch(request).then(() => {
204-
// @ts-ignore Sentry is a global
204+
// @ts-expect-error Sentry is a global
205205
Sentry.captureException('test error');
206206
});
207207
/* eslint-enable */
@@ -284,7 +284,7 @@ sentryTest('captures request headers as Headers instance', async ({ getLocalTest
284284
method: 'POST',
285285
headers,
286286
}).then(() => {
287-
// @ts-ignore Sentry is a global
287+
// @ts-expect-error Sentry is a global
288288
Sentry.captureException('test error');
289289
});
290290
/* eslint-enable */
@@ -367,7 +367,7 @@ sentryTest('does not captures request headers if URL does not match', async ({ g
367367
'X-Test-Header': 'test-value',
368368
},
369369
}).then(() => {
370-
// @ts-ignore Sentry is a global
370+
// @ts-expect-error Sentry is a global
371371
Sentry.captureException('test error');
372372
});
373373
/* eslint-enable */

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestSize/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ sentryTest('captures request body size when body is sent', async ({ getLocalTest
3939
method: 'POST',
4040
body: '{"foo":"bar"}',
4141
}).then(() => {
42-
// @ts-ignore Sentry is a global
42+
// @ts-expect-error Sentry is a global
4343
Sentry.captureException('test error');
4444
});
4545
/* eslint-enable */
@@ -125,7 +125,7 @@ sentryTest('captures request size from non-text request body', async ({ getLocal
125125
method: 'POST',
126126
body: blob,
127127
}).then(() => {
128-
// @ts-ignore Sentry is a global
128+
// @ts-expect-error Sentry is a global
129129
Sentry.captureException('test error');
130130
});
131131
/* eslint-enable */

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseBody/test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ sentryTest('captures text response body', async ({ getLocalTestPath, page, brows
4141
fetch('http://localhost:7654/foo', {
4242
method: 'POST',
4343
}).then(() => {
44-
// @ts-ignore Sentry is a global
44+
// @ts-expect-error Sentry is a global
4545
Sentry.captureException('test error');
4646
});
4747
/* eslint-enable */
@@ -122,7 +122,7 @@ sentryTest('captures JSON response body', async ({ getLocalTestPath, page, brows
122122
fetch('http://localhost:7654/foo', {
123123
method: 'POST',
124124
}).then(() => {
125-
// @ts-ignore Sentry is a global
125+
// @ts-expect-error Sentry is a global
126126
Sentry.captureException('test error');
127127
});
128128
/* eslint-enable */
@@ -203,7 +203,7 @@ sentryTest('captures non-text response body', async ({ getLocalTestPath, page, b
203203
fetch('http://localhost:7654/foo', {
204204
method: 'POST',
205205
}).then(() => {
206-
// @ts-ignore Sentry is a global
206+
// @ts-expect-error Sentry is a global
207207
Sentry.captureException('test error');
208208
});
209209
/* eslint-enable */
@@ -282,7 +282,7 @@ sentryTest('does not capture response body when URL does not match', async ({ ge
282282
fetch('http://localhost:7654/bar', {
283283
method: 'POST',
284284
}).then(() => {
285-
// @ts-ignore Sentry is a global
285+
// @ts-expect-error Sentry is a global
286286
Sentry.captureException('test error');
287287
});
288288
/* eslint-enable */

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseHeaders/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ sentryTest('handles empty headers', async ({ getLocalTestPath, page, browserName
3838
await page.evaluate(() => {
3939
/* eslint-disable */
4040
fetch('http://localhost:7654/foo').then(() => {
41-
// @ts-ignore Sentry is a global
41+
// @ts-expect-error Sentry is a global
4242
Sentry.captureException('test error');
4343
});
4444
/* eslint-enable */
@@ -113,7 +113,7 @@ sentryTest('captures response headers', async ({ getLocalTestPath, page }) => {
113113
await page.evaluate(() => {
114114
/* eslint-disable */
115115
fetch('http://localhost:7654/foo').then(() => {
116-
// @ts-ignore Sentry is a global
116+
// @ts-expect-error Sentry is a global
117117
Sentry.captureException('test error');
118118
});
119119
/* eslint-enable */
@@ -194,7 +194,7 @@ sentryTest('does not capture response headers if URL does not match', async ({ g
194194
await page.evaluate(() => {
195195
/* eslint-disable */
196196
fetch('http://localhost:7654/bar').then(() => {
197-
// @ts-ignore Sentry is a global
197+
// @ts-expect-error Sentry is a global
198198
Sentry.captureException('test error');
199199
});
200200
/* eslint-enable */

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseSize/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ sentryTest('captures response size from Content-Length header if available', asy
4343
await page.evaluate(() => {
4444
/* eslint-disable */
4545
fetch('http://localhost:7654/foo').then(() => {
46-
// @ts-ignore Sentry is a global
46+
// @ts-expect-error Sentry is a global
4747
Sentry.captureException('test error');
4848
});
4949
/* eslint-enable */
@@ -131,7 +131,7 @@ sentryTest('captures response size without Content-Length header', async ({ getL
131131
await page.evaluate(() => {
132132
/* eslint-disable */
133133
fetch('http://localhost:7654/foo').then(() => {
134-
// @ts-ignore Sentry is a global
134+
// @ts-expect-error Sentry is a global
135135
Sentry.captureException('test error');
136136
});
137137
/* eslint-enable */
@@ -218,7 +218,7 @@ sentryTest('captures response size from non-text response body', async ({ getLoc
218218
fetch('http://localhost:7654/foo', {
219219
method: 'POST',
220220
}).then(() => {
221-
// @ts-ignore Sentry is a global
221+
// @ts-expect-error Sentry is a global
222222
Sentry.captureException('test error');
223223
});
224224
/* eslint-enable */

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestBody/test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ sentryTest('captures text request body', async ({ getLocalTestPath, page, browse
4343

4444
xhr.addEventListener('readystatechange', function () {
4545
if (xhr.readyState === 4) {
46-
// @ts-ignore Sentry is a global
46+
// @ts-expect-error Sentry is a global
4747
setTimeout(() => Sentry.captureException('test error', 0));
4848
}
4949
});
@@ -124,7 +124,7 @@ sentryTest('captures JSON request body', async ({ getLocalTestPath, page, browse
124124

125125
xhr.addEventListener('readystatechange', function () {
126126
if (xhr.readyState === 4) {
127-
// @ts-ignore Sentry is a global
127+
// @ts-expect-error Sentry is a global
128128
setTimeout(() => Sentry.captureException('test error', 0));
129129
}
130130
});
@@ -209,7 +209,7 @@ sentryTest('captures non-text request body', async ({ getLocalTestPath, page, br
209209

210210
xhr.addEventListener('readystatechange', function () {
211211
if (xhr.readyState === 4) {
212-
// @ts-ignore Sentry is a global
212+
// @ts-expect-error Sentry is a global
213213
setTimeout(() => Sentry.captureException('test error', 0));
214214
}
215215
});
@@ -290,7 +290,7 @@ sentryTest('captures text request body when matching relative URL', async ({ get
290290

291291
xhr.addEventListener('readystatechange', function () {
292292
if (xhr.readyState === 4) {
293-
// @ts-ignore Sentry is a global
293+
// @ts-expect-error Sentry is a global
294294
setTimeout(() => Sentry.captureException('test error', 0));
295295
}
296296
});
@@ -371,7 +371,7 @@ sentryTest('does not capture request body when URL does not match', async ({ get
371371

372372
xhr.addEventListener('readystatechange', function () {
373373
if (xhr.readyState === 4) {
374-
// @ts-ignore Sentry is a global
374+
// @ts-expect-error Sentry is a global
375375
setTimeout(() => Sentry.captureException('test error', 0));
376376
}
377377
});

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestHeaders/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ sentryTest('captures request headers', async ({ getLocalTestPath, page, browserN
4747

4848
xhr.addEventListener('readystatechange', function () {
4949
if (xhr.readyState === 4) {
50-
// @ts-ignore Sentry is a global
50+
// @ts-expect-error Sentry is a global
5151
setTimeout(() => Sentry.captureException('test error', 0));
5252
}
5353
});
@@ -135,7 +135,7 @@ sentryTest(
135135

136136
xhr.addEventListener('readystatechange', function () {
137137
if (xhr.readyState === 4) {
138-
// @ts-ignore Sentry is a global
138+
// @ts-expect-error Sentry is a global
139139
setTimeout(() => Sentry.captureException('test error', 0));
140140
}
141141
});

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestSize/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ sentryTest('captures request body size when body is sent', async ({ getLocalTest
4343

4444
xhr.addEventListener('readystatechange', function () {
4545
if (xhr.readyState === 4) {
46-
// @ts-ignore Sentry is a global
46+
// @ts-expect-error Sentry is a global
4747
setTimeout(() => Sentry.captureException('test error', 0));
4848
}
4949
});
@@ -134,7 +134,7 @@ sentryTest('captures request size from non-text request body', async ({ getLocal
134134

135135
xhr.addEventListener('readystatechange', function () {
136136
if (xhr.readyState === 4) {
137-
// @ts-ignore Sentry is a global
137+
// @ts-expect-error Sentry is a global
138138
setTimeout(() => Sentry.captureException('test error', 0));
139139
}
140140
});

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseBody/test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ sentryTest('captures text response body', async ({ getLocalTestPath, page, brows
4747

4848
xhr.addEventListener('readystatechange', function () {
4949
if (xhr.readyState === 4) {
50-
// @ts-ignore Sentry is a global
50+
// @ts-expect-error Sentry is a global
5151
setTimeout(() => Sentry.captureException('test error', 0));
5252
}
5353
});
@@ -132,7 +132,7 @@ sentryTest('captures JSON response body', async ({ getLocalTestPath, page, brows
132132

133133
xhr.addEventListener('readystatechange', function () {
134134
if (xhr.readyState === 4) {
135-
// @ts-ignore Sentry is a global
135+
// @ts-expect-error Sentry is a global
136136
setTimeout(() => Sentry.captureException('test error', 0));
137137
}
138138
});
@@ -217,7 +217,7 @@ sentryTest('captures non-text response body', async ({ getLocalTestPath, page, b
217217

218218
xhr.addEventListener('readystatechange', function () {
219219
if (xhr.readyState === 4) {
220-
// @ts-ignore Sentry is a global
220+
// @ts-expect-error Sentry is a global
221221
setTimeout(() => Sentry.captureException('test error', 0));
222222
}
223223
});
@@ -304,7 +304,7 @@ sentryTest(
304304

305305
xhr.addEventListener('readystatechange', function () {
306306
if (xhr.readyState === 4) {
307-
// @ts-ignore Sentry is a global
307+
// @ts-expect-error Sentry is a global
308308
setTimeout(() => Sentry.captureException('test error', 0));
309309
}
310310
});

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseHeaders/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ sentryTest('captures response headers', async ({ getLocalTestPath, page, browser
5050

5151
xhr.addEventListener('readystatechange', function () {
5252
if (xhr.readyState === 4) {
53-
// @ts-ignore Sentry is a global
53+
// @ts-expect-error Sentry is a global
5454
setTimeout(() => Sentry.captureException('test error', 0));
5555
}
5656
});
@@ -141,7 +141,7 @@ sentryTest(
141141

142142
xhr.addEventListener('readystatechange', function () {
143143
if (xhr.readyState === 4) {
144-
// @ts-ignore Sentry is a global
144+
// @ts-expect-error Sentry is a global
145145
setTimeout(() => Sentry.captureException('test error', 0));
146146
}
147147
});

packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseSize/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ sentryTest(
4848

4949
xhr.addEventListener('readystatechange', function () {
5050
if (xhr.readyState === 4) {
51-
// @ts-ignore Sentry is a global
51+
// @ts-expect-error Sentry is a global
5252
setTimeout(() => Sentry.captureException('test error', 0));
5353
}
5454
});
@@ -144,7 +144,7 @@ sentryTest('captures response size without Content-Length header', async ({ getL
144144

145145
xhr.addEventListener('readystatechange', function () {
146146
if (xhr.readyState === 4) {
147-
// @ts-ignore Sentry is a global
147+
// @ts-expect-error Sentry is a global
148148
setTimeout(() => Sentry.captureException('test error', 0));
149149
}
150150
});
@@ -237,7 +237,7 @@ sentryTest('captures response size for non-string bodies', async ({ getLocalTest
237237

238238
xhr.addEventListener('readystatechange', function () {
239239
if (xhr.readyState === 4) {
240-
// @ts-ignore Sentry is a global
240+
// @ts-expect-error Sentry is a global
241241
setTimeout(() => Sentry.captureException('test error', 0));
242242
}
243243
});

0 commit comments

Comments
 (0)