Skip to content

Commit f5d6572

Browse files
committed
Fix TypeScript errors not showing up in CI
1 parent 374d6f4 commit f5d6572

File tree

10 files changed

+6
-11
lines changed

10 files changed

+6
-11
lines changed

packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ const expectFileMatchesSnapshotWithCompression = (filePath: string, snapshotLabe
261261

262262
// Verify the brotli variant matches
263263
expect(
264-
// @ts-expect-error @types/node is missing the brotli functions
265264
Zlib.brotliDecompressSync(
266265
Fs.readFileSync(Path.resolve(MOCK_REPO_DIR, `${filePath}.br`))
267266
).toString()

x-pack/plugins/actions/server/builtin_action_types/slack.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ async function slackExecutor(
126126
// https://slack.dev/node-slack-sdk/webhook
127127
// node-slack-sdk use Axios inside :)
128128
const webhook = new IncomingWebhook(webhookUrl, {
129+
// @ts-expect-error The types exposed by 'HttpsProxyAgent' isn't up to date with 'Agent'
129130
agent: proxyAgent,
130131
});
131132
result = await webhook.send(message);

x-pack/plugins/canvas/shareable_runtime/api/__tests__/shareable.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jest.mock('../../supported_renderers');
1515
describe('Canvas Shareable Workpad API', () => {
1616
// Mock the AJAX load of the workpad.
1717
beforeEach(function () {
18-
// @ts-expect-error Applying a global in Jest is alright.
1918
global.fetch = jest.fn().mockImplementation(() => {
2019
const p = new Promise((resolve, _reject) => {
2120
resolve({

x-pack/plugins/fleet/server/services/epm/registry/requests.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export function getFetchOptions(targetUrl: string): RequestInit | undefined {
9393
logger.debug(`Using ${proxyUrl} as proxy for ${targetUrl}`);
9494

9595
return {
96+
// @ts-expect-error The types exposed by 'HttpsProxyAgent' isn't up to date with 'Agent'
9697
agent: getProxyAgent({ proxyUrl, targetUrl }),
9798
};
9899
}

x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ export class HeadlessChromiumDriver {
340340
hostname === conditions.hostname &&
341341
protocol === `${conditions.protocol}:` &&
342342
this._shouldUseCustomHeadersForPort(conditions, port) &&
343-
// @ts-expect-error according to the types `pathname` is `string | undefined`, but it's actually `string | null`
344343
pathname.startsWith(`${conditions.basePath}/`)
345344
);
346345
}

x-pack/plugins/security_solution/public/management/common/routing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ type Exact<T, Shape> = T extends Shape ? ExactKeys<T, Shape> : never;
3232
* Ensures that when creating a URL query param string, that the given input strictly
3333
* matches the expected interface (guards against possibly leaking internal state)
3434
*/
35-
const querystringStringify: <ExpectedType, ArgType>(
35+
const querystringStringify = <ExpectedType, ArgType>(
3636
params: Exact<ExpectedType, ArgType>
37-
) => string = querystring.stringify;
37+
): string => querystring.stringify((params as unknown) as querystring.ParsedUrlQueryInput);
3838

3939
/** Make `selected_endpoint` required */
4040
type EndpointDetailsUrlProps = Omit<EndpointIndexUIQueryParams, 'selected_endpoint'> &

x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/url_from_query_params.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { EndpointIndexUIQueryParams } from '../types';
1111
import { AppLocation } from '../../../../../common/endpoint/types';
1212

1313
export function urlFromQueryParams(queryParams: EndpointIndexUIQueryParams): Partial<AppLocation> {
14-
const search = querystring.stringify(queryParams);
14+
const search = querystring.stringify(queryParams as Record<string, string>);
1515
return {
1616
search,
1717
};

x-pack/plugins/security_solution/public/network/pages/details/index.test.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import { NetworkDetails } from './index';
2626
type Action = 'PUSH' | 'POP' | 'REPLACE';
2727
const pop: Action = 'POP';
2828

29-
type GlobalWithFetch = NodeJS.Global & { fetch: jest.Mock };
30-
3129
jest.mock('react-router-dom', () => {
3230
const original = jest.requireActual('react-router-dom');
3331

@@ -85,7 +83,7 @@ describe('Network Details', () => {
8583
indicesExist: false,
8684
indexPattern: {},
8785
});
88-
(global as GlobalWithFetch).fetch = jest.fn().mockImplementationOnce(() =>
86+
global.fetch = jest.fn().mockImplementationOnce(() =>
8987
Promise.resolve({
9088
ok: true,
9189
json: () => {

x-pack/plugins/uptime/public/components/overview/__tests__/synthetics_callout.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ describe('SyntheticsCallout', () => {
1919
setItem: setItemMock,
2020
};
2121

22-
// @ts-expect-error replacing a call to localStorage we use for monitor list size
2322
global.localStorage = localStorageMock;
2423
});
2524

x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ describe('MonitorList component', () => {
135135
setItem: jest.fn(),
136136
};
137137

138-
// @ts-expect-error replacing a call to localStorage we use for monitor list size
139138
global.localStorage = localStorageMock;
140139
});
141140

0 commit comments

Comments
 (0)