From ebf21b6fa729738429344c420eed972230ecc2a6 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 25 Aug 2023 13:20:54 +0100 Subject: [PATCH] [8.9] chore(NA): upgrade typescript into v4.7.4 (#162738) (#164761) # Backport This will backport the following commits from `main` to `8.9`: - [chore(NA): upgrade typescript into v4.7.4 (#162738)](https://github.com/elastic/kibana/pull/162738) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- package.json | 4 ++-- .../src/request.ts | 2 +- .../src/kibana/routes/root.ts | 1 + packages/kbn-repo-packages/modern/plugins.js | 6 +----- .../src/tools/ts_program/ts_program.test.ts | 2 +- .../common/static/components/collections.ts | 1 + .../doc_table/components/table_row.tsx | 4 +++- .../expressions/common/execution/execution.ts | 10 ++++++---- .../expression_function_parameter.ts | 4 ++-- .../options/metrics_axes/label_options.tsx | 6 ++++-- .../workpad_interactive_page/event_handlers.ts | 3 ++- .../public/components/create/form.test.tsx | 1 + .../editable_markdown_renderer.test.tsx | 1 + .../fleet/common/experimental_features.ts | 1 + .../index.test.tsx | 1 + .../agent_policy/list_page/index.test.tsx | 1 + .../agents/agent_list_page/index.test.tsx | 1 + x-pack/plugins/fleet/server/mocks/index.ts | 1 + .../fleet/server/routes/health_check/index.ts | 1 + .../extension_point_storage_client.ts | 1 + .../server/services/extension_points/types.ts | 1 + .../public/application/pages/apm/overview.tsx | 5 ++++- .../pages/enterprise_search/overview.tsx | 5 ++++- .../alert_data_client/browser_fields/index.ts | 1 + .../server/authentication/authenticator.ts | 5 +++-- .../server/session_management/session_index.ts | 18 ++++++++++-------- .../osquery/osquery_response_action.tsx | 1 + .../components/page_overlay/page_overlay.tsx | 1 + .../view/components/events_form/index.tsx | 2 ++ x-pack/plugins/security_solution/tsconfig.json | 3 +-- .../lib/alerts/duration_anomaly.test.ts | 1 + .../.storybook/decorator.tsx | 1 + .../common/experimental_features.ts | 1 + .../common/get_experimental_features.test.tsx | 1 + .../keyword_array.ts | 1 + yarn.lock | 8 ++++---- 36 files changed, 70 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 0764646cb2848..8f4c1e71fea29 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "**/hoist-non-react-statics": "^3.3.2", "**/isomorphic-fetch/node-fetch": "^2.6.7", "**/remark-parse/trim": "1.0.1", - "**/typescript": "4.6.3", + "**/typescript": "4.7.4", "globby/fast-glob": "^3.2.11" }, "dependencies": { @@ -1521,7 +1521,7 @@ "tree-kill": "^1.2.2", "ts-morph": "^13.0.2", "tsd": "^0.20.0", - "typescript": "4.6.3", + "typescript": "4.7.4", "url-loader": "^2.2.0", "val-loader": "^1.1.1", "vinyl-fs": "^4.0.0", diff --git a/packages/core/http/core-http-router-server-internal/src/request.ts b/packages/core/http/core-http-router-server-internal/src/request.ts index aa134c21ae95a..19243fba9bc1e 100644 --- a/packages/core/http/core-http-router-server-internal/src/request.ts +++ b/packages/core/http/core-http-router-server-internal/src/request.ts @@ -116,7 +116,7 @@ export class CoreKibanaRequest< public readonly rewrittenUrl?: URL; /** @internal */ - protected readonly [requestSymbol]: Request; + protected readonly [requestSymbol]!: Request; constructor( request: RawRequest, diff --git a/packages/kbn-health-gateway-server/src/kibana/routes/root.ts b/packages/kbn-health-gateway-server/src/kibana/routes/root.ts index eed165b41d6d4..fd71ca7d5a4eb 100644 --- a/packages/kbn-health-gateway-server/src/kibana/routes/root.ts +++ b/packages/kbn-health-gateway-server/src/kibana/routes/root.ts @@ -124,6 +124,7 @@ export class RootRoute implements ServerRoute { try { return await nodeFetch(url, { agent: protocol === 'https:' ? this.getAgent() : undefined, + // @ts-expect-error ts upgrade v4.7.4 signal: controller.signal, redirect: 'manual', }); diff --git a/packages/kbn-repo-packages/modern/plugins.js b/packages/kbn-repo-packages/modern/plugins.js index a197c6a679771..31dd08bf1f5ba 100644 --- a/packages/kbn-repo-packages/modern/plugins.js +++ b/packages/kbn-repo-packages/modern/plugins.js @@ -107,11 +107,7 @@ function getPluginPackagesFilter(selector = {}) { */ function getDistributablePacakgesFilter() { return (pkg) => { - if ( - pkg.isDevOnly || - pkg.manifest.type === 'functional-tests' || - pkg.manifest.type === 'test-helper' - ) { + if (pkg.isDevOnly()) { return false; } diff --git a/packages/kbn-telemetry-tools/src/tools/ts_program/ts_program.test.ts b/packages/kbn-telemetry-tools/src/tools/ts_program/ts_program.test.ts index 8ae36ea7330cc..7e15de907e31a 100644 --- a/packages/kbn-telemetry-tools/src/tools/ts_program/ts_program.test.ts +++ b/packages/kbn-telemetry-tools/src/tools/ts_program/ts_program.test.ts @@ -21,7 +21,7 @@ describe('createKibanaProgram', () => { "fetch": Object { "typeDescriptor": Object { "locale": Object { - "kind": 149, + "kind": 150, "type": "StringKeyword", }, }, diff --git a/src/plugins/charts/common/static/components/collections.ts b/src/plugins/charts/common/static/components/collections.ts index 1f138ab9f7b0e..acb11c647fead 100644 --- a/src/plugins/charts/common/static/components/collections.ts +++ b/src/plugins/charts/common/static/components/collections.ts @@ -20,6 +20,7 @@ export const LabelRotation = Object.freeze({ Horizontal: 0, Vertical: 90, Angled: 75, + VerticalRotation: 270, }); export type LabelRotation = $Values; diff --git a/src/plugins/discover/public/components/doc_table/components/table_row.tsx b/src/plugins/discover/public/components/doc_table/components/table_row.tsx index fe1dd59e825b5..9e61d901ecd7e 100644 --- a/src/plugins/discover/public/components/doc_table/components/table_row.tsx +++ b/src/plugins/discover/public/components/doc_table/components/table_row.tsx @@ -183,7 +183,9 @@ export const TableRow = ({ // We should improve this and show a helpful tooltip why the filter buttons are not // there/disabled when there are ignored values. const isFilterable = Boolean( - mapping(column)?.filterable && filter && !row.raw._ignored?.includes(column) + mapping(column)?.filterable && + typeof filter === 'function' && + !row.raw._ignored?.includes(column) ); rowCells.push( this.execution.params.debug && Object.assign(head.debug, { args })), + tap((args) => this.execution.params.debug && Object.assign(head.debug ?? {}, { args })), switchMap((args) => this.invokeFunction(fn, input, args)), this.execution.params.partial ? identity : last(), switchMap((output) => (getType(output) === 'error' ? throwError(output) : of(output))), - tap((output) => this.execution.params.debug && Object.assign(head.debug, { output })), + tap( + (output) => this.execution.params.debug && Object.assign(head.debug ?? {}, { output }) + ), switchMap((output) => this.invokeChain(tail, output)), catchError((rawError) => { const error = createError(rawError); error.error.message = `[${fnName}] > ${error.error.message}`; if (this.execution.params.debug) { - Object.assign(head.debug, { error, rawError, success: false }); + Object.assign(head.debug ?? {}, { error, rawError, success: false }); } return of(error); @@ -440,7 +442,7 @@ export class Execution< }), finalize(() => { if (this.execution.params.debug) { - Object.assign(head.debug, { duration: now() - timeStart }); + Object.assign(head.debug ?? {}, { duration: now() - timeStart }); } }) ); diff --git a/src/plugins/expressions/common/expression_functions/expression_function_parameter.ts b/src/plugins/expressions/common/expression_functions/expression_function_parameter.ts index 530d0bc5a9c5c..644eb4bb8005e 100644 --- a/src/plugins/expressions/common/expression_functions/expression_function_parameter.ts +++ b/src/plugins/expressions/common/expression_functions/expression_function_parameter.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { KnownTypeToString } from '../types'; +import { TypeString } from '../types'; import { ArgumentType } from './arguments'; export class ExpressionFunctionParameter { @@ -46,6 +46,6 @@ export class ExpressionFunctionParameter { } accepts(type: string) { - return !this.types?.length || this.types.includes(type as KnownTypeToString); + return !this.types?.length || this.types.includes(type as TypeString); } } diff --git a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx index 2c7f394f6a0aa..3310df7259df6 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx @@ -13,7 +13,7 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { SelectOption, SwitchOption } from '@kbn/vis-default-editor-plugin/public'; -import { Labels } from '@kbn/charts-plugin/public'; +import type { LabelRotation, Labels } from '@kbn/charts-plugin/public'; import { TruncateLabelsOption } from '../../common'; import { getRotateOptions } from '../../../collections'; @@ -34,7 +34,8 @@ function LabelOptions({ }: LabelOptionsProps) { const setAxisLabelRotate = useCallback( (paramName: 'rotate', value: Labels['rotate']) => { - setAxisLabel(paramName, Number(value)); + const rotation = Number(value) as LabelRotation; + setAxisLabel(paramName, rotation); }, [setAxisLabel] ); @@ -96,6 +97,7 @@ function LabelOptions({ options={rotateOptions} paramName="rotate" value={axisLabels.rotate} + // @ts-ignore ts upgrade v4.7.4 setValue={setAxisLabelRotate} /> diff --git a/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts index bb06444c0c8f6..ca187a8381d29 100644 --- a/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts +++ b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts @@ -61,7 +61,8 @@ const setupHandler = (commit: CommitFn, canvasOrigin: CanvasOriginFn, zoomScale? // only commits the cursor position if there's a way to latch onto x/y calculation (canvasOrigin is knowable) // or if left button is being held down (i.e. an element is being dragged) - if (buttons === 1 || canvasOrigin) { + // + if (buttons === 1 || canvasOrigin !== undefined) { commit('cursorPosition', { x, y, altKey, metaKey, shiftKey, ctrlKey }); } else { // clears cursorPosition diff --git a/x-pack/plugins/cases/public/components/create/form.test.tsx b/x-pack/plugins/cases/public/components/create/form.test.tsx index 3c53a384275c5..839ac07d0b967 100644 --- a/x-pack/plugins/cases/public/components/create/form.test.tsx +++ b/x-pack/plugins/cases/public/components/create/form.test.tsx @@ -69,6 +69,7 @@ describe('CreateCaseForm', () => { globalForm = form; return ( + // @ts-expect-error ts upgrade v4.7.4
{children}
diff --git a/x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_renderer.test.tsx b/x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_renderer.test.tsx index 59d424fdd82c8..ab0a285401132 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_renderer.test.tsx +++ b/x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_renderer.test.tsx @@ -52,6 +52,7 @@ describe('EditableMarkdown', () => { }); return ( + // @ts-expect-error ts upgrade v4.7.4
{children}
diff --git a/x-pack/plugins/fleet/common/experimental_features.ts b/x-pack/plugins/fleet/common/experimental_features.ts index 1d2929eb00dee..eddb864b465b7 100644 --- a/x-pack/plugins/fleet/common/experimental_features.ts +++ b/x-pack/plugins/fleet/common/experimental_features.ts @@ -46,6 +46,7 @@ export const parseExperimentalConfigValue = (configValue: string[]): Experimenta throw new FleetInvalidExperimentalValue(`[${value}] is not a supported experimental feature`); } + // @ts-expect-error ts upgrade v4.7.4 enabledFeatures[value as keyof ExperimentalFeatures] = true; } diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.test.tsx index 019395c0cb5f6..9548f78f06ecf 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.test.tsx @@ -52,6 +52,7 @@ describe('Agent policy advanced options content', () => { // remove when feature flag is removed ExperimentalFeaturesService.init({ ...allowedExperimentalValues, + // @ts-expect-error ts upgrade v4.7.4 agentTamperProtectionEnabled: true, }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.test.tsx index 1958db916a402..97ec62dce1d87 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.test.tsx @@ -40,6 +40,7 @@ describe('AgentPolicyListPage', () => { // todo: this can be removed when agentTamperProtectionEnabled feature flag is enabled/deleted ExperimentalFeaturesService.init({ ...allowedExperimentalValues, + // @ts-expect-error ts upgrade v4.7.4 agentTamperProtectionEnabled: true, }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx index 0089843c2626f..84394f1ab5c0d 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx @@ -286,6 +286,7 @@ describe('agent_list_page', () => { // todo: this can be removed when agentTamperProtectionEnabled feature flag is enabled/deleted ExperimentalFeaturesService.init({ ...allowedExperimentalValues, + // @ts-expect-error ts upgrade v4.7.4 agentTamperProtectionEnabled: true, }); diff --git a/x-pack/plugins/fleet/server/mocks/index.ts b/x-pack/plugins/fleet/server/mocks/index.ts index e003e391140a5..c7bb8074f06d4 100644 --- a/x-pack/plugins/fleet/server/mocks/index.ts +++ b/x-pack/plugins/fleet/server/mocks/index.ts @@ -68,6 +68,7 @@ export const createAppContextStartContractMock = ( securitySetup: securityMock.createSetup(), securityStart: securityMock.createStart(), logger: loggingSystemMock.create().get(), + // @ts-expect-error ts upgrade v4.7.4 experimentalFeatures: { agentTamperProtectionEnabled: true, diagnosticFileUploadEnabled: true, diff --git a/x-pack/plugins/fleet/server/routes/health_check/index.ts b/x-pack/plugins/fleet/server/routes/health_check/index.ts index 55bd4bf7029ee..25efc25e14bad 100644 --- a/x-pack/plugins/fleet/server/routes/health_check/index.ts +++ b/x-pack/plugins/fleet/server/routes/health_check/index.ts @@ -53,6 +53,7 @@ export const postHealthCheckHandler: FleetRequestHandler< agent: new https.Agent({ rejectUnauthorized: false, }), + // @ts-expect-error ts upgrade v4.7.4 signal: abortController.signal, }); const bodyRes = await res.json(); diff --git a/x-pack/plugins/lists/server/services/extension_points/extension_point_storage_client.ts b/x-pack/plugins/lists/server/services/extension_points/extension_point_storage_client.ts index f2d2035459b54..b3ada7ac69cd5 100644 --- a/x-pack/plugins/lists/server/services/extension_points/extension_point_storage_client.ts +++ b/x-pack/plugins/lists/server/services/extension_points/extension_point_storage_client.ts @@ -45,6 +45,7 @@ export class ExtensionPointStorageClient implements ExtensionPointStorageClientI async pipeRun< T extends ExtensionPoint['type'], D extends NarrowExtensionPointToType = NarrowExtensionPointToType, + // @ts-expect-error ts upgrade v4.7.4 P extends Parameters = Parameters >( extensionType: T, diff --git a/x-pack/plugins/lists/server/services/extension_points/types.ts b/x-pack/plugins/lists/server/services/extension_points/types.ts index 61aa7c451362d..2a298e96d2656 100644 --- a/x-pack/plugins/lists/server/services/extension_points/types.ts +++ b/x-pack/plugins/lists/server/services/extension_points/types.ts @@ -185,6 +185,7 @@ export interface ExtensionPointStorageClientInterface { pipeRun< T extends ExtensionPoint['type'], D extends NarrowExtensionPointToType = NarrowExtensionPointToType, + // @ts-expect-error ts upgrade v4.7.4 P extends Parameters = Parameters >( extensionType: T, diff --git a/x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx index 9dd30bf6db81a..e12b567d8340f 100644 --- a/x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx @@ -70,7 +70,10 @@ export const ApmOverviewPage: React.FC = ({ clusters }) => { getPageData={getPageData} data-test-subj="apmOverviewPage" > - {data && } + { + // @ts-expect-error ts upgrade v4.7.4 + data && + } ); }; diff --git a/x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx index 0cd97166dcf5d..4493ec12adba4 100644 --- a/x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx @@ -69,7 +69,10 @@ export const EntSearchOverviewPage: React.FC = ({ clusters }) => data-test-subj="entSearchOverviewPage" >
- {data && } + { + // @ts-expect-error ts upgrade v4.7.4 + data && + }
); diff --git a/x-pack/plugins/rule_registry/server/alert_data_client/browser_fields/index.ts b/x-pack/plugins/rule_registry/server/alert_data_client/browser_fields/index.ts index f7ba028e5917b..bbb91309b4fca 100644 --- a/x-pack/plugins/rule_registry/server/alert_data_client/browser_fields/index.ts +++ b/x-pack/plugins/rule_registry/server/alert_data_client/browser_fields/index.ts @@ -36,6 +36,7 @@ export const fieldDescriptorToBrowserFieldMapper = (fields: FieldDescriptor[]): const browserField = browserFieldFactory(field, category); if (browserFields[category] && browserFields[category]) { + // @ts-expect-error ts upgrade to v4.7.4 Object.assign(browserFields[category].fields, browserField); } else { browserFields[category] = { fields: browserField }; diff --git a/x-pack/plugins/security/server/authentication/authenticator.ts b/x-pack/plugins/security/server/authentication/authenticator.ts index 8599eb287989e..6f170f607bfcf 100644 --- a/x-pack/plugins/security/server/authentication/authenticator.ts +++ b/x-pack/plugins/security/server/authentication/authenticator.ts @@ -259,7 +259,7 @@ export class Authenticator { ...providerCommonOptions, name, logger: options.loggers.get(type, name), - urls: { loggedOut: (request) => this.getLoggedOutURL(request, type) }, + urls: { loggedOut: (request: KibanaRequest) => this.getLoggedOutURL(request, type) }, }), this.options.config.authc.providers[type]?.[name] ), @@ -275,7 +275,8 @@ export class Authenticator { name: '__http__', logger: options.loggers.get(HTTPAuthenticationProvider.type), urls: { - loggedOut: (request) => this.getLoggedOutURL(request, HTTPAuthenticationProvider.type), + loggedOut: (request: KibanaRequest) => + this.getLoggedOutURL(request, HTTPAuthenticationProvider.type), }, }) ); diff --git a/x-pack/plugins/security/server/session_management/session_index.ts b/x-pack/plugins/security/server/session_management/session_index.ts index cc3307d37adf1..d3813cb9929d7 100644 --- a/x-pack/plugins/security/server/session_management/session_index.ts +++ b/x-pack/plugins/security/server/session_management/session_index.ts @@ -106,16 +106,18 @@ export function getSessionIndexSettings({ }, }, mappings: { - dynamic: 'strict', + dynamic: 'strict' as const, _meta: { [SESSION_INDEX_MAPPINGS_VERSION_META_FIELD_NAME]: SESSION_INDEX_MAPPINGS_VERSION }, properties: { - usernameHash: { type: 'keyword' }, - provider: { properties: { name: { type: 'keyword' }, type: { type: 'keyword' } } }, - idleTimeoutExpiration: { type: 'date' }, - createdAt: { type: 'date' }, - lifespanExpiration: { type: 'date' }, - accessAgreementAcknowledged: { type: 'boolean' }, - content: { type: 'binary' }, + usernameHash: { type: 'keyword' as const }, + provider: { + properties: { name: { type: 'keyword' as const }, type: { type: 'keyword' as const } }, + }, + idleTimeoutExpiration: { type: 'date' as const }, + createdAt: { type: 'date' as const }, + lifespanExpiration: { type: 'date' as const }, + accessAgreementAcknowledged: { type: 'boolean' as const }, + content: { type: 'binary' as const }, }, }, }); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action.tsx index 955a2f43966f7..3d42a95e2164a 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action.tsx @@ -76,6 +76,7 @@ export const OsqueryResponseAction = React.memo((props: OsqueryResponseActionPro ); } + // @ts-expect-error ts upgrade v4.7.4 if (isMounted() && OsqueryForm) { return ( ( useEffect(() => { if ( isMounted() && + // @ts-expect-error ts upgrade v4.7.4 onHide && hideOnUrlPathnameChange && !isHidden && diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/components/events_form/index.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/components/events_form/index.tsx index a3a0f8c325b0e..f76474e4536c4 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/components/events_form/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/components/events_form/index.tsx @@ -120,6 +120,7 @@ const InnerEventsForm = ({ key={String(protectionField)} id={htmlIdGenerator()()} label={name} + // @ts-expect-error ts upgrade v4.7.4 data-test-subj={`policy${OPERATING_SYSTEM_TO_TEST_SUBJ[os]}Event_${protectionField}`} checked={selection[protectionField]} onChange={(event) => onValueSelection(protectionField, event.target.checked)} @@ -164,6 +165,7 @@ const InnerEventsForm = ({ onValueSelection(protectionField, event.target.checked)} diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index a4d2e2873a072..c0d9d0b350155 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -12,8 +12,7 @@ "server/**/*.json", "scripts/**/*.json", "public/**/*.json", - "../../../typings/**/*", - "./public/management/cypress/cypress.d.ts" + "../../../typings/**/*" ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/duration_anomaly.test.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/duration_anomaly.test.ts index 21c20503f31ab..62100f7d198f3 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/duration_anomaly.test.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/alerts/duration_anomaly.test.ts @@ -118,6 +118,7 @@ describe('duration anomaly alert', () => { const mockDate = 'date'; beforeAll(() => { Date.now = jest.fn().mockReturnValue(new Date('2021-05-13T12:33:37.000Z')); + // @ts-expect-error ts upgrade v4.7.4 jest.spyOn(Intl, 'DateTimeFormat').mockImplementation(() => ({ format: jest.fn(), formatToParts: jest.fn(), diff --git a/x-pack/plugins/triggers_actions_ui/.storybook/decorator.tsx b/x-pack/plugins/triggers_actions_ui/.storybook/decorator.tsx index 3a138669b0472..1f981335415eb 100644 --- a/x-pack/plugins/triggers_actions_ui/.storybook/decorator.tsx +++ b/x-pack/plugins/triggers_actions_ui/.storybook/decorator.tsx @@ -58,6 +58,7 @@ export const StorybookContextDecorator: React.FC ExperimentalFeaturesService.init({ experimentalFeatures: { rulesListDatagrid: true, + // @ts-expect-error ts upgrade v4.7.4 internalAlertsTable: true, ruleTagFilter: true, ruleStatusFilter: true, diff --git a/x-pack/plugins/triggers_actions_ui/common/experimental_features.ts b/x-pack/plugins/triggers_actions_ui/common/experimental_features.ts index 0890e86c15ab7..48286f11659ba 100644 --- a/x-pack/plugins/triggers_actions_ui/common/experimental_features.ts +++ b/x-pack/plugins/triggers_actions_ui/common/experimental_features.ts @@ -41,6 +41,7 @@ export const parseExperimentalConfigValue = (configValue: string[]): Experimenta throw new TriggersActionsUIInvalidExperimentalValue(`[${value}] is not valid.`); } + // @ts-expect-error ts upgrade v4.7.4 enabledFeatures[value as keyof ExperimentalFeatures] = true; } diff --git a/x-pack/plugins/triggers_actions_ui/public/common/get_experimental_features.test.tsx b/x-pack/plugins/triggers_actions_ui/public/common/get_experimental_features.test.tsx index 318a681eba7f6..2e4e14af63e9b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/get_experimental_features.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/get_experimental_features.test.tsx @@ -16,6 +16,7 @@ describe('getIsExperimentalFeatureEnabled', () => { ExperimentalFeaturesService.init({ experimentalFeatures: { rulesListDatagrid: true, + // @ts-expect-error ts upgrade v4.7.4 internalAlertsTable: true, rulesDetailLogs: true, ruleTagFilter: true, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword_array.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword_array.ts index e08d449584140..7d95f6c9ec6bc 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword_array.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword_array.ts @@ -154,6 +154,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); const hits = signalsOpen.hits.hits.map((hit) => hit._source?.keyword).sort(); + // @ts-expect-error ts upgrade v4.7.4 expect(hits.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); }); }); diff --git a/yarn.lock b/yarn.lock index 8a0f127193d82..2939a45d4f749 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27951,10 +27951,10 @@ typescript-tuple@^2.2.1: dependencies: typescript-compare "^0.0.2" -typescript@4.6.3, typescript@^3.3.3333, typescript@^4.6.3, typescript@^4.8.4: - version "4.6.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c" - integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw== +typescript@4.7.4, typescript@^3.3.3333, typescript@^4.6.3, typescript@^4.8.4: + version "4.7.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" + integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== ua-parser-js@^0.7.18: version "0.7.24"