diff --git a/packages/kbn-storybook/tsconfig.json b/packages/kbn-storybook/tsconfig.json index db10d4630ff9c8..5c81c9100e6017 100644 --- a/packages/kbn-storybook/tsconfig.json +++ b/packages/kbn-storybook/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "incremental": false, "outDir": "target", diff --git a/src/core/tsconfig.json b/src/core/tsconfig.json index 855962070457e7..f19e379482d3cf 100644 --- a/src/core/tsconfig.json +++ b/src/core/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/dev/typescript/project.ts b/src/dev/typescript/project.ts index 8d92284e496379..04a5de945619b8 100644 --- a/src/dev/typescript/project.ts +++ b/src/dev/typescript/project.ts @@ -7,7 +7,7 @@ */ import { basename, dirname, relative, resolve } from 'path'; - +import { memoize } from 'lodash'; import { IMinimatch, Minimatch } from 'minimatch'; import { REPO_ROOT } from '@kbn/utils'; @@ -26,6 +26,10 @@ function testMatchers(matchers: IMinimatch[], path: string) { return matchers.some((matcher) => matcher.match(path)); } +const parentProjectFactory = memoize(function (parentConfigPath: string) { + return new Project(parentConfigPath); +}); + export class Project { public directory: string; public name: string; @@ -34,6 +38,7 @@ export class Project { private readonly include: IMinimatch[]; private readonly exclude: IMinimatch[]; + private readonly parent?: Project; constructor( public tsConfigPath: string, @@ -41,15 +46,16 @@ export class Project { ) { this.config = parseTsConfig(tsConfigPath); - const { files, include, exclude = [] } = this.config as { + const { files, include, exclude = [], extends: extendsPath } = this.config as { files?: string[]; include?: string[]; exclude?: string[]; + extends?: string; }; if (files || !include) { throw new Error( - 'tsconfig.json files in the Kibana repo must use "include" keys and not "files"' + `[${tsConfigPath}]: tsconfig.json files in the Kibana repo must use "include" keys and not "files"` ); } @@ -58,9 +64,30 @@ export class Project { this.name = options.name || relative(REPO_ROOT, this.directory) || basename(this.directory); this.include = makeMatchers(this.directory, include); this.exclude = makeMatchers(this.directory, exclude); + + if (extendsPath !== undefined) { + const parentConfigPath = resolve(this.directory, extendsPath); + this.parent = parentProjectFactory(parentConfigPath); + } + } + + public isAbsolutePathSelected(path: string): boolean { + return this.isExcluded(path) ? false : this.isIncluded(path); } - public isAbsolutePathSelected(path: string) { - return testMatchers(this.exclude, path) ? false : testMatchers(this.include, path); + public isExcluded(path: string): boolean { + if (testMatchers(this.exclude, path)) return true; + if (this.parent) { + return this.parent.isExcluded(path); + } + return false; + } + + public isIncluded(path: string): boolean { + if (testMatchers(this.include, path)) return true; + if (this.parent) { + return this.parent.isIncluded(path); + } + return false; } } diff --git a/src/plugins/advanced_settings/tsconfig.json b/src/plugins/advanced_settings/tsconfig.json index 4d62e410326b69..97a855959903de 100644 --- a/src/plugins/advanced_settings/tsconfig.json +++ b/src/plugins/advanced_settings/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/apm_oss/tsconfig.json b/src/plugins/apm_oss/tsconfig.json index aeb6837c69a998..ccb123aaec83bc 100644 --- a/src/plugins/apm_oss/tsconfig.json +++ b/src/plugins/apm_oss/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/bfetch/tsconfig.json b/src/plugins/bfetch/tsconfig.json index 173ff725d07d02..6c01479f1929ed 100644 --- a/src/plugins/bfetch/tsconfig.json +++ b/src/plugins/bfetch/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/charts/tsconfig.json b/src/plugins/charts/tsconfig.json index a4f65d5937204c..99edb2ffe3c162 100644 --- a/src/plugins/charts/tsconfig.json +++ b/src/plugins/charts/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/console/tsconfig.json b/src/plugins/console/tsconfig.json index 34aca5021bac4e..d9f49036be8f8f 100644 --- a/src/plugins/console/tsconfig.json +++ b/src/plugins/console/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/dashboard/tsconfig.json b/src/plugins/dashboard/tsconfig.json index dd99119cfb4570..452208b39af601 100644 --- a/src/plugins/dashboard/tsconfig.json +++ b/src/plugins/dashboard/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/data/common/search/expressions/exists_filter.test.ts b/src/plugins/data/common/search/expressions/exists_filter.test.ts index e3b53b22813983..60e8a9c7a09ce5 100644 --- a/src/plugins/data/common/search/expressions/exists_filter.test.ts +++ b/src/plugins/data/common/search/expressions/exists_filter.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { createMockContext } from '../../../../expressions/common'; +import { createMockContext } from '../../../../expressions/common/mocks'; import { functionWrapper } from './utils'; import { existsFilterFunction } from './exists_filter'; diff --git a/src/plugins/data/common/search/expressions/kibana_filter.test.ts b/src/plugins/data/common/search/expressions/kibana_filter.test.ts index ac8ae55492cc06..56a9e1ce660cda 100644 --- a/src/plugins/data/common/search/expressions/kibana_filter.test.ts +++ b/src/plugins/data/common/search/expressions/kibana_filter.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { createMockContext } from '../../../../expressions/common'; +import { createMockContext } from '../../../../expressions/common/mocks'; import { functionWrapper } from './utils'; import { kibanaFilterFunction } from './kibana_filter'; diff --git a/src/plugins/data/common/search/expressions/phrase_filter.test.ts b/src/plugins/data/common/search/expressions/phrase_filter.test.ts index 39bd907513a0df..90e471e166f5eb 100644 --- a/src/plugins/data/common/search/expressions/phrase_filter.test.ts +++ b/src/plugins/data/common/search/expressions/phrase_filter.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { createMockContext } from '../../../../expressions/common'; +import { createMockContext } from '../../../../expressions/common/mocks'; import { functionWrapper } from './utils'; import { phraseFilterFunction } from './phrase_filter'; diff --git a/src/plugins/data/common/search/expressions/range_filter.test.ts b/src/plugins/data/common/search/expressions/range_filter.test.ts index 92670f8a044ba6..129e6bd82e16a6 100644 --- a/src/plugins/data/common/search/expressions/range_filter.test.ts +++ b/src/plugins/data/common/search/expressions/range_filter.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { createMockContext } from '../../../../expressions/common'; +import { createMockContext } from '../../../../expressions/common/mocks'; import { functionWrapper } from './utils'; import { rangeFilterFunction } from './range_filter'; diff --git a/src/plugins/data/tsconfig.json b/src/plugins/data/tsconfig.json index 9c95878af631eb..b99a2f6f85904b 100644 --- a/src/plugins/data/tsconfig.json +++ b/src/plugins/data/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/dev_tools/tsconfig.json b/src/plugins/dev_tools/tsconfig.json index c17b2341fd42f8..f369396b17fbe8 100644 --- a/src/plugins/dev_tools/tsconfig.json +++ b/src/plugins/dev_tools/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/discover/tsconfig.json b/src/plugins/discover/tsconfig.json index ec98199c3423ea..96765d76a340b6 100644 --- a/src/plugins/discover/tsconfig.json +++ b/src/plugins/discover/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/embeddable/tsconfig.json b/src/plugins/embeddable/tsconfig.json index 27a887500fb68e..eacfa831ecee5d 100644 --- a/src/plugins/embeddable/tsconfig.json +++ b/src/plugins/embeddable/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/es_ui_shared/tsconfig.json b/src/plugins/es_ui_shared/tsconfig.json index 9bcda2e0614de6..3d102daaf3aaf2 100644 --- a/src/plugins/es_ui_shared/tsconfig.json +++ b/src/plugins/es_ui_shared/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/expressions/common/mocks.ts b/src/plugins/expressions/common/mocks.ts index eaeebd8e534924..20bdbca07f008b 100644 --- a/src/plugins/expressions/common/mocks.ts +++ b/src/plugins/expressions/common/mocks.ts @@ -34,3 +34,5 @@ export const createMockExecutionContext = ...extraContext, }; }; + +export { createMockContext } from './util/test_utils'; diff --git a/src/plugins/expressions/common/util/index.ts b/src/plugins/expressions/common/util/index.ts index 470dfc3c2d436b..5f83d962d5aea8 100644 --- a/src/plugins/expressions/common/util/index.ts +++ b/src/plugins/expressions/common/util/index.ts @@ -10,4 +10,3 @@ export * from './create_error'; export * from './get_by_alias'; export * from './tables_adapter'; export * from './expressions_inspector_adapter'; -export * from './test_utils'; diff --git a/src/plugins/expressions/tsconfig.json b/src/plugins/expressions/tsconfig.json index cce71013cefa55..fe76ba3050a3bf 100644 --- a/src/plugins/expressions/tsconfig.json +++ b/src/plugins/expressions/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/home/tsconfig.json b/src/plugins/home/tsconfig.json index b15e1fc011b926..19ab5a8e6efec5 100644 --- a/src/plugins/home/tsconfig.json +++ b/src/plugins/home/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/index_pattern_field_editor/tsconfig.json b/src/plugins/index_pattern_field_editor/tsconfig.json index 559b1aaf0fc26c..c638fd34c6bbbf 100644 --- a/src/plugins/index_pattern_field_editor/tsconfig.json +++ b/src/plugins/index_pattern_field_editor/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/index_pattern_management/tsconfig.json b/src/plugins/index_pattern_management/tsconfig.json index 37bd3e4aa5bbb9..3c8fdb1cf65979 100644 --- a/src/plugins/index_pattern_management/tsconfig.json +++ b/src/plugins/index_pattern_management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/input_control_vis/tsconfig.json b/src/plugins/input_control_vis/tsconfig.json index bef7bc394a6ccd..c2f8d8783e822d 100644 --- a/src/plugins/input_control_vis/tsconfig.json +++ b/src/plugins/input_control_vis/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/inspector/tsconfig.json b/src/plugins/inspector/tsconfig.json index 2a9c41464532c3..0e42e577428c69 100644 --- a/src/plugins/inspector/tsconfig.json +++ b/src/plugins/inspector/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/kibana_legacy/tsconfig.json b/src/plugins/kibana_legacy/tsconfig.json index 709036c9e82f43..0b3f42cd3b57b6 100644 --- a/src/plugins/kibana_legacy/tsconfig.json +++ b/src/plugins/kibana_legacy/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/kibana_overview/tsconfig.json b/src/plugins/kibana_overview/tsconfig.json index ac3ac109cb35f0..3396861cb9179b 100644 --- a/src/plugins/kibana_overview/tsconfig.json +++ b/src/plugins/kibana_overview/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/kibana_react/tsconfig.json b/src/plugins/kibana_react/tsconfig.json index eb9a24ca141f6e..857b8cf83645ce 100644 --- a/src/plugins/kibana_react/tsconfig.json +++ b/src/plugins/kibana_react/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/kibana_usage_collection/tsconfig.json b/src/plugins/kibana_usage_collection/tsconfig.json index d664d936f66671..100f1f03955d04 100644 --- a/src/plugins/kibana_usage_collection/tsconfig.json +++ b/src/plugins/kibana_usage_collection/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/kibana_utils/tsconfig.json b/src/plugins/kibana_utils/tsconfig.json index ae5e9b90af8077..d9572707e86629 100644 --- a/src/plugins/kibana_utils/tsconfig.json +++ b/src/plugins/kibana_utils/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/legacy_export/tsconfig.json b/src/plugins/legacy_export/tsconfig.json index ec006d492499ea..d6689ea1067db6 100644 --- a/src/plugins/legacy_export/tsconfig.json +++ b/src/plugins/legacy_export/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/management/tsconfig.json b/src/plugins/management/tsconfig.json index ba3661666631ab..3423299a53df7c 100644 --- a/src/plugins/management/tsconfig.json +++ b/src/plugins/management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/maps_ems/tsconfig.json b/src/plugins/maps_ems/tsconfig.json index b85c3da66b83a0..7f44da00d47a43 100644 --- a/src/plugins/maps_ems/tsconfig.json +++ b/src/plugins/maps_ems/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/maps_legacy/tsconfig.json b/src/plugins/maps_legacy/tsconfig.json index f757e35f785af5..c600024cc4a747 100644 --- a/src/plugins/maps_legacy/tsconfig.json +++ b/src/plugins/maps_legacy/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/navigation/tsconfig.json b/src/plugins/navigation/tsconfig.json index 07cfe10d7d81f9..bb86142e1c4431 100644 --- a/src/plugins/navigation/tsconfig.json +++ b/src/plugins/navigation/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/newsfeed/tsconfig.json b/src/plugins/newsfeed/tsconfig.json index 66244a22336c77..84626b2f3a6a86 100644 --- a/src/plugins/newsfeed/tsconfig.json +++ b/src/plugins/newsfeed/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/presentation_util/tsconfig.json b/src/plugins/presentation_util/tsconfig.json index 37b9380f6f2b9c..cb39c5fb36f564 100644 --- a/src/plugins/presentation_util/tsconfig.json +++ b/src/plugins/presentation_util/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/region_map/tsconfig.json b/src/plugins/region_map/tsconfig.json index 899611d0274657..385c31e6bd2d6d 100644 --- a/src/plugins/region_map/tsconfig.json +++ b/src/plugins/region_map/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/saved_objects/tsconfig.json b/src/plugins/saved_objects/tsconfig.json index d9045b91b9dfae..46b3f9a5afcb67 100644 --- a/src/plugins/saved_objects/tsconfig.json +++ b/src/plugins/saved_objects/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/saved_objects_management/tsconfig.json b/src/plugins/saved_objects_management/tsconfig.json index 99849dea386181..cb74b061792250 100644 --- a/src/plugins/saved_objects_management/tsconfig.json +++ b/src/plugins/saved_objects_management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/saved_objects_tagging_oss/tsconfig.json b/src/plugins/saved_objects_tagging_oss/tsconfig.json index b0059c71424bf5..ae566d96268954 100644 --- a/src/plugins/saved_objects_tagging_oss/tsconfig.json +++ b/src/plugins/saved_objects_tagging_oss/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/security_oss/tsconfig.json b/src/plugins/security_oss/tsconfig.json index 530e01a034b00a..156e4ffee9d794 100644 --- a/src/plugins/security_oss/tsconfig.json +++ b/src/plugins/security_oss/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/share/tsconfig.json b/src/plugins/share/tsconfig.json index 985066915f1ddc..62c0b3739f4b79 100644 --- a/src/plugins/share/tsconfig.json +++ b/src/plugins/share/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/spaces_oss/tsconfig.json b/src/plugins/spaces_oss/tsconfig.json index 0cc82d7e5d1245..96584842ec32bc 100644 --- a/src/plugins/spaces_oss/tsconfig.json +++ b/src/plugins/spaces_oss/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/telemetry/tsconfig.json b/src/plugins/telemetry/tsconfig.json index bdced01d9eb6f0..40370082f99e23 100644 --- a/src/plugins/telemetry/tsconfig.json +++ b/src/plugins/telemetry/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/telemetry_collection_manager/tsconfig.json b/src/plugins/telemetry_collection_manager/tsconfig.json index 1bba81769f0dd0..8bbc440fb1a540 100644 --- a/src/plugins/telemetry_collection_manager/tsconfig.json +++ b/src/plugins/telemetry_collection_manager/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/telemetry_management_section/tsconfig.json b/src/plugins/telemetry_management_section/tsconfig.json index 48e40814b8570d..c6a21733b2d6b7 100644 --- a/src/plugins/telemetry_management_section/tsconfig.json +++ b/src/plugins/telemetry_management_section/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/tile_map/tsconfig.json b/src/plugins/tile_map/tsconfig.json index 899611d0274657..385c31e6bd2d6d 100644 --- a/src/plugins/tile_map/tsconfig.json +++ b/src/plugins/tile_map/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/timelion/tsconfig.json b/src/plugins/timelion/tsconfig.json index 5b96d69a878ea6..bb8a48339d44ed 100644 --- a/src/plugins/timelion/tsconfig.json +++ b/src/plugins/timelion/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/ui_actions/tsconfig.json b/src/plugins/ui_actions/tsconfig.json index a871d7215cdc52..89b66d18705c26 100644 --- a/src/plugins/ui_actions/tsconfig.json +++ b/src/plugins/ui_actions/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/url_forwarding/tsconfig.json b/src/plugins/url_forwarding/tsconfig.json index 8e867a6bad14f6..f1916e4ce5957e 100644 --- a/src/plugins/url_forwarding/tsconfig.json +++ b/src/plugins/url_forwarding/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/usage_collection/tsconfig.json b/src/plugins/usage_collection/tsconfig.json index 96b2c4d37e17c2..b4a0721ef3672c 100644 --- a/src/plugins/usage_collection/tsconfig.json +++ b/src/plugins/usage_collection/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_default_editor/tsconfig.json b/src/plugins/vis_default_editor/tsconfig.json index 27bb775c2d0e8a..54a84e08224a8d 100644 --- a/src/plugins/vis_default_editor/tsconfig.json +++ b/src/plugins/vis_default_editor/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_markdown/tsconfig.json b/src/plugins/vis_type_markdown/tsconfig.json index d5ab89b98081b1..f940c295e7cee0 100644 --- a/src/plugins/vis_type_markdown/tsconfig.json +++ b/src/plugins/vis_type_markdown/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_metric/tsconfig.json b/src/plugins/vis_type_metric/tsconfig.json index 7441848d5a4308..8cee918a3dc82d 100644 --- a/src/plugins/vis_type_metric/tsconfig.json +++ b/src/plugins/vis_type_metric/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_table/tsconfig.json b/src/plugins/vis_type_table/tsconfig.json index ccff3c349cf21c..4f2e80575497b4 100644 --- a/src/plugins/vis_type_table/tsconfig.json +++ b/src/plugins/vis_type_table/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_tagcloud/tsconfig.json b/src/plugins/vis_type_tagcloud/tsconfig.json index 18bbad2257466c..f7f3688183a488 100644 --- a/src/plugins/vis_type_tagcloud/tsconfig.json +++ b/src/plugins/vis_type_tagcloud/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_timelion/tsconfig.json b/src/plugins/vis_type_timelion/tsconfig.json index 77f97de28366d0..d29fb25b153155 100644 --- a/src/plugins/vis_type_timelion/tsconfig.json +++ b/src/plugins/vis_type_timelion/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_timeseries/tsconfig.json b/src/plugins/vis_type_timeseries/tsconfig.json index 7b2dd4b608c1c4..edc2d25b867d1b 100644 --- a/src/plugins/vis_type_timeseries/tsconfig.json +++ b/src/plugins/vis_type_timeseries/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_vega/tsconfig.json b/src/plugins/vis_type_vega/tsconfig.json index 4091dafcbe3572..f375a2483e24ff 100644 --- a/src/plugins/vis_type_vega/tsconfig.json +++ b/src/plugins/vis_type_vega/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_vislib/tsconfig.json b/src/plugins/vis_type_vislib/tsconfig.json index 74bc1440d9dbc6..845628a6b86f91 100644 --- a/src/plugins/vis_type_vislib/tsconfig.json +++ b/src/plugins/vis_type_vislib/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_xy/tsconfig.json b/src/plugins/vis_type_xy/tsconfig.json index 5cb0bc8d0bc8ed..7e23b07bd80f6c 100644 --- a/src/plugins/vis_type_xy/tsconfig.json +++ b/src/plugins/vis_type_xy/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/visualizations/tsconfig.json b/src/plugins/visualizations/tsconfig.json index d7c5e6a4b43663..65de6908228b3a 100644 --- a/src/plugins/visualizations/tsconfig.json +++ b/src/plugins/visualizations/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/visualize/tsconfig.json b/src/plugins/visualize/tsconfig.json index bc0891f3917466..046202d82d1aaf 100644 --- a/src/plugins/visualize/tsconfig.json +++ b/src/plugins/visualize/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/tsconfig.base.json b/tsconfig.base.json index da4de5ef3712b3..c28ed0d8c87509 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -56,5 +56,6 @@ "jest-styled-components", "@testing-library/jest-dom" ] - } + }, + "include": [] } diff --git a/tsconfig.json b/tsconfig.json index c852481518d54a..03597114333cac 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,6 +19,78 @@ "x-pack/plugins/cases/**/*", "x-pack/plugins/lists/**/*", "x-pack/plugins/security_solution/**/*", + + // tests + "src/**/*.test.ts", + "src/**/*.test.tsx", + "src/**/integration_tests/*", + "src/**/tests/*", + // mocks + "src/**/__mocks__/*", + "src/**/mock/*", + "src/**/mocks/*", + "src/**/*/mock.ts", + "src/**/*/mocks.ts", + "src/**/*/mocks.tsx", + "src/**/*.mock.ts", + "src/**/*.mock.tsx", + "src/**/*.mocks.ts", + "src/**/*.mocks.tsx", + + // test helpers + "src/**/test_helpers/*", + "src/**/test_utils/*", + "src/**/*/test_utils.ts", + "src/**/*/test_helpers.ts", + "src/**/*/test_helper.tsx", + + // stubs + "src/**/*/stubs.ts", + "src/**/*.stub.ts", + "src/**/*.stories.tsx", + "src/**/*/_mock_handler_arguments.ts", + + // tests + "x-pack/plugins/**/*.test.ts", + "x-pack/plugins/**/*.test.tsx", + "x-pack/plugins/**/test/**/*", + "x-pack/plugins/**/tests/*", + "x-pack/plugins/**/integration_tests/*", + "x-pack/plugins/**/tests_client_integration/*", + "x-pack/plugins/**/__fixtures__/*", + "x-pack/plugins/**/__stories__/*", + "x-pack/plugins/**/__jest__/**/*", + + // mocks + "x-pack/plugins/**/__mocks__/*", + "x-pack/plugins/**/mock/*", + "x-pack/plugins/**/mocks/*", + "x-pack/plugins/**/*/mock.ts", + "x-pack/plugins/**/*/mocks.ts", + "x-pack/plugins/**/*/mocks.tsx", + "x-pack/plugins/**/*.mock.ts", + "x-pack/plugins/**/*.mock.tsx", + "x-pack/plugins/**/*.mocks.ts", + "x-pack/plugins/**/*.mocks.tsx", + + // test helpers + "x-pack/plugins/**/test_helpers/*", + "x-pack/plugins/**/test_utils/*", + "x-pack/plugins/**/*/test_utils.ts", + "x-pack/plugins/**/*/test_helper.tsx", + "x-pack/plugins/**/*/test_helpers.ts", + "x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/test_data.tsx", + "x-pack/plugins/uptime/server/lib/requests/helper.ts", + "x-pack/plugins/uptime/public/lib/helper/rtl_helpers.tsx", + "x-pack/plugins/uptime/public/lib/helper/enzyme_helpers.tsx", + "x-pack/plugins/apm/server/utils/test_helpers.tsx", + "x-pack/plugins/apm/public/utils/testHelpers.tsx", + + // stubs + "x-pack/plugins/**/*/stubs.ts", + "x-pack/plugins/**/*.stub.ts", + "x-pack/plugins/**/*.stories.tsx", + "x-pack/plugins/**/*/_mock_handler_arguments.ts" ], "exclude": [ "x-pack/plugins/security_solution/cypress/**/*" diff --git a/tsconfig.project.json b/tsconfig.project.json new file mode 100644 index 00000000000000..174c3fdf0fd544 --- /dev/null +++ b/tsconfig.project.json @@ -0,0 +1,65 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "composite": true, + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "exclude": [ + // tests + "**/*.test.ts", + "**/*.test.tsx", + "**/integration_tests/*", + "**/test/**/*", + "**/test/*", + "**/tests/*", + "**/tests_client_integration/*", + "**/__fixtures__/*", + "**/__stories__/*", + "**/__jest__/**", + + // mocks + "**/__mocks__/*", + "**/mock/*", + "**/mocks/*", + "**/*/mock.ts", + "**/*/mocks.ts", + "**/*/mocks.tsx", + "**/*.mock.ts", + "**/*.mock.tsx", + "**/*.mocks.ts", + "**/*.mocks.tsx", + + // test helpers + "**/test_helpers/*", + "**/test_utils/*", + "**/*/test_utils.ts", + "**/*/test_helper.tsx", + "**/*/test_helpers.ts", + // x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/test_data.tsx + "**/*/test_data.tsx", + "**/*/shared_columns_tests.tsx", + // x-pack/plugins/uptime/server/lib/requests/helper.ts + "**/*/requests/helper.ts", + // x-pack/plugins/uptime/public/lib/helper/rtl_helpers.tsx + "**/*/rtl_helpers.tsx", + // x-pack/plugins/uptime/public/lib/helper/enzyme_helpers.tsx + "**/*/enzyme_helpers.tsx", + // x-pack/plugins/apm/server/utils/test_helpers.tsx + "**/*/test_helpers.tsx", + // x-pack/plugins/apm/public/utils/testHelpers.tsx + "**/*/testHelpers.tsx", + + // stubs + "**/*/stubs.ts", + "**/*.stub.ts", + "**/*.stories.tsx", + "**/*/_mock_handler_arguments.ts" + ], + "include": [], + "types": [ + "node", + "flot" + ] +} diff --git a/x-pack/plugins/actions/tsconfig.json b/x-pack/plugins/actions/tsconfig.json index d5c1105c99ad0d..10ebd09235236b 100644 --- a/x-pack/plugins/actions/tsconfig.json +++ b/x-pack/plugins/actions/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/alerting/tsconfig.json b/x-pack/plugins/alerting/tsconfig.json index 86ab00faeb5ade..4010688746901e 100644 --- a/x-pack/plugins/alerting/tsconfig.json +++ b/x-pack/plugins/alerting/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/apm/e2e/tsconfig.json b/x-pack/plugins/apm/e2e/tsconfig.json index c4587349c7ad77..0c13dd717991cf 100644 --- a/x-pack/plugins/apm/e2e/tsconfig.json +++ b/x-pack/plugins/apm/e2e/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.base.json", + "extends": "../../../../tsconfig.project.json", "exclude": ["tmp"], "include": ["./**/*"], "compilerOptions": { diff --git a/x-pack/plugins/apm/ftr_e2e/tsconfig.json b/x-pack/plugins/apm/ftr_e2e/tsconfig.json index 168801f7826075..f699943a254fa9 100644 --- a/x-pack/plugins/apm/ftr_e2e/tsconfig.json +++ b/x-pack/plugins/apm/ftr_e2e/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.base.json", + "extends": "../../../../tsconfig.project.json", "exclude": [ "tmp" ], @@ -12,4 +12,4 @@ "node" ] } -} \ No newline at end of file +} diff --git a/x-pack/plugins/apm/scripts/optimize-tsconfig/optimize.js b/x-pack/plugins/apm/scripts/optimize-tsconfig/optimize.js index fed938119c4a64..613435fe186bff 100644 --- a/x-pack/plugins/apm/scripts/optimize-tsconfig/optimize.js +++ b/x-pack/plugins/apm/scripts/optimize-tsconfig/optimize.js @@ -22,7 +22,7 @@ const { kibanaRoot, tsconfigTpl, filesToIgnore } = require('./paths'); const { unoptimizeTsConfig } = require('./unoptimize'); async function prepareBaseTsConfig() { - const baseConfigFilename = path.resolve(kibanaRoot, 'tsconfig.base.json'); + const baseConfigFilename = path.resolve(kibanaRoot, 'tsconfig.project.json'); const config = json5.parse(await readFile(baseConfigFilename, 'utf-8')); await writeFile( diff --git a/x-pack/plugins/apm/scripts/optimize-tsconfig/paths.js b/x-pack/plugins/apm/scripts/optimize-tsconfig/paths.js index dbc207c9e6d260..b501ec3a8eedf5 100644 --- a/x-pack/plugins/apm/scripts/optimize-tsconfig/paths.js +++ b/x-pack/plugins/apm/scripts/optimize-tsconfig/paths.js @@ -12,7 +12,7 @@ const tsconfigTpl = path.resolve(__dirname, './tsconfig.json'); const filesToIgnore = [ path.resolve(kibanaRoot, 'tsconfig.json'), - path.resolve(kibanaRoot, 'tsconfig.base.json'), + path.resolve(kibanaRoot, 'tsconfig.project.json'), path.resolve(kibanaRoot, 'x-pack/plugins/apm', 'tsconfig.json'), ]; diff --git a/x-pack/plugins/apm/tsconfig.json b/x-pack/plugins/apm/tsconfig.json index ffbf11c23f63ae..ae2085dc240036 100644 --- a/x-pack/plugins/apm/tsconfig.json +++ b/x-pack/plugins/apm/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/banners/tsconfig.json b/x-pack/plugins/banners/tsconfig.json index 85608a8a78ad52..6c4c80173208bc 100644 --- a/x-pack/plugins/banners/tsconfig.json +++ b/x-pack/plugins/banners/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/beats_management/tsconfig.json b/x-pack/plugins/beats_management/tsconfig.json index ad68cc900e6382..398438712b26b3 100644 --- a/x-pack/plugins/beats_management/tsconfig.json +++ b/x-pack/plugins/beats_management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/canvas/storybook/addon/tsconfig.json b/x-pack/plugins/canvas/storybook/addon/tsconfig.json index 2ab1856de661a1..b115d1c46546c8 100644 --- a/x-pack/plugins/canvas/storybook/addon/tsconfig.json +++ b/x-pack/plugins/canvas/storybook/addon/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../../tsconfig.base.json", + "extends": "../../../../../tsconfig.project.json", "include": [ "src/**/*.ts", "src/**/*.tsx" diff --git a/x-pack/plugins/canvas/tsconfig.json b/x-pack/plugins/canvas/tsconfig.json index 487b68ba3542ba..679165f0a1b76c 100644 --- a/x-pack/plugins/canvas/tsconfig.json +++ b/x-pack/plugins/canvas/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/cloud/tsconfig.json b/x-pack/plugins/cloud/tsconfig.json index 46e81aa7fa0868..f6edb9fb7ccae5 100644 --- a/x-pack/plugins/cloud/tsconfig.json +++ b/x-pack/plugins/cloud/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/console_extensions/tsconfig.json b/x-pack/plugins/console_extensions/tsconfig.json index 5ad28f230a0bbf..edcd46c4fafc56 100644 --- a/x-pack/plugins/console_extensions/tsconfig.json +++ b/x-pack/plugins/console_extensions/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/cross_cluster_replication/tsconfig.json b/x-pack/plugins/cross_cluster_replication/tsconfig.json index 9c7590b9c2553e..156a851abb8db3 100644 --- a/x-pack/plugins/cross_cluster_replication/tsconfig.json +++ b/x-pack/plugins/cross_cluster_replication/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/dashboard_enhanced/tsconfig.json b/x-pack/plugins/dashboard_enhanced/tsconfig.json index 567c390edfa5af..f6acdddc6f997c 100644 --- a/x-pack/plugins/dashboard_enhanced/tsconfig.json +++ b/x-pack/plugins/dashboard_enhanced/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/dashboard_mode/tsconfig.json b/x-pack/plugins/dashboard_mode/tsconfig.json index 6e4ed11ffa7ff4..c4a11959ec3e3d 100644 --- a/x-pack/plugins/dashboard_mode/tsconfig.json +++ b/x-pack/plugins/dashboard_mode/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/data_enhanced/tsconfig.json b/x-pack/plugins/data_enhanced/tsconfig.json index 047b9b06516bad..5538a2db3e4cd9 100644 --- a/x-pack/plugins/data_enhanced/tsconfig.json +++ b/x-pack/plugins/data_enhanced/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/discover_enhanced/tsconfig.json b/x-pack/plugins/discover_enhanced/tsconfig.json index 38a55e557909b6..2a055bd0e0710e 100644 --- a/x-pack/plugins/discover_enhanced/tsconfig.json +++ b/x-pack/plugins/discover_enhanced/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json b/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json index 50fe41c49b0c88..99aea16a9aabad 100644 --- a/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json +++ b/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.base.json", + "extends": "../../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/embeddable_enhanced/tsconfig.json b/x-pack/plugins/embeddable_enhanced/tsconfig.json index 6e9eb69585cbc1..32754f2fd55243 100644 --- a/x-pack/plugins/embeddable_enhanced/tsconfig.json +++ b/x-pack/plugins/embeddable_enhanced/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/encrypted_saved_objects/tsconfig.json b/x-pack/plugins/encrypted_saved_objects/tsconfig.json index 2b51b313d34fcb..9eae8b7366bea3 100644 --- a/x-pack/plugins/encrypted_saved_objects/tsconfig.json +++ b/x-pack/plugins/encrypted_saved_objects/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/enterprise_search/tsconfig.json b/x-pack/plugins/enterprise_search/tsconfig.json index 6b4c50770b49f4..a4f1c55463e758 100644 --- a/x-pack/plugins/enterprise_search/tsconfig.json +++ b/x-pack/plugins/enterprise_search/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/event_log/tsconfig.json b/x-pack/plugins/event_log/tsconfig.json index 9b7cde10da3d60..e21dbc93b7b478 100644 --- a/x-pack/plugins/event_log/tsconfig.json +++ b/x-pack/plugins/event_log/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/features/tsconfig.json b/x-pack/plugins/features/tsconfig.json index 1260af55fbff61..11e2dbc8f093fd 100644 --- a/x-pack/plugins/features/tsconfig.json +++ b/x-pack/plugins/features/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/file_upload/tsconfig.json b/x-pack/plugins/file_upload/tsconfig.json index 887a05af31174b..8a982f83632aa5 100644 --- a/x-pack/plugins/file_upload/tsconfig.json +++ b/x-pack/plugins/file_upload/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/fleet/tsconfig.json b/x-pack/plugins/fleet/tsconfig.json index a20d82de3c859c..66849e017395b7 100644 --- a/x-pack/plugins/fleet/tsconfig.json +++ b/x-pack/plugins/fleet/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/global_search/tsconfig.json b/x-pack/plugins/global_search/tsconfig.json index 2d05328f445dfc..2571f7c2e29350 100644 --- a/x-pack/plugins/global_search/tsconfig.json +++ b/x-pack/plugins/global_search/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/global_search_bar/tsconfig.json b/x-pack/plugins/global_search_bar/tsconfig.json index 266eecc35c84bd..595d55c3c5a0dc 100644 --- a/x-pack/plugins/global_search_bar/tsconfig.json +++ b/x-pack/plugins/global_search_bar/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/global_search_providers/tsconfig.json b/x-pack/plugins/global_search_providers/tsconfig.json index f2759954a68452..9be9a681ee7c59 100644 --- a/x-pack/plugins/global_search_providers/tsconfig.json +++ b/x-pack/plugins/global_search_providers/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/graph/tsconfig.json b/x-pack/plugins/graph/tsconfig.json index 741c603e3aae4a..ae0d143455d523 100644 --- a/x-pack/plugins/graph/tsconfig.json +++ b/x-pack/plugins/graph/tsconfig.json @@ -1,6 +1,6 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -27,4 +27,4 @@ { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" } ] - } \ No newline at end of file + } diff --git a/x-pack/plugins/grokdebugger/tsconfig.json b/x-pack/plugins/grokdebugger/tsconfig.json index 51d2d0b6db0eac..3e9e2f78708143 100644 --- a/x-pack/plugins/grokdebugger/tsconfig.json +++ b/x-pack/plugins/grokdebugger/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/index_lifecycle_management/tsconfig.json b/x-pack/plugins/index_lifecycle_management/tsconfig.json index 75bd775a367497..bf43817cbc407b 100644 --- a/x-pack/plugins/index_lifecycle_management/tsconfig.json +++ b/x-pack/plugins/index_lifecycle_management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -8,7 +8,6 @@ "declarationMap": true }, "include": [ - "__jest__/**/*", "common/**/*", "public/**/*", "server/**/*", diff --git a/x-pack/plugins/index_management/tsconfig.json b/x-pack/plugins/index_management/tsconfig.json index 81a96a77cef832..0766839a230b97 100644 --- a/x-pack/plugins/index_management/tsconfig.json +++ b/x-pack/plugins/index_management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -8,11 +8,9 @@ "declarationMap": true }, "include": [ - "__jest__/**/*", "common/**/*", "public/**/*", "server/**/*", - "test/**/*", "../../../typings/**/*", ], "references": [ diff --git a/x-pack/plugins/infra/public/utils/enzyme_helpers.tsx b/x-pack/plugins/infra/public/utils/enzyme_helpers.tsx deleted file mode 100644 index 33fbbd03d790a1..00000000000000 --- a/x-pack/plugins/infra/public/utils/enzyme_helpers.tsx +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -// eslint-disable-next-line import/no-extraneous-dependencies -import { mount, ReactWrapper } from 'enzyme'; -import React from 'react'; -import { act as reactAct } from 'react-dom/test-utils'; -/** - * A wrapper object to provide access to the state of a hook under test and to - * enable interaction with that hook. - */ -interface ReactHookWrapper { - /* Ensures that async React operations have settled before and after the - * given actor callback is called. The actor callback arguments provide easy - * access to the last hook value and allow for updating the arguments passed - * to the hook body to trigger reevaluation. - */ - act: (actor: (lastHookValue: HookValue, setArgs: (args: Args) => void) => void) => void; - /* The enzyme wrapper around the test component. */ - component: ReactWrapper; - /* The most recent value return the by test harness of the hook. */ - getLastHookValue: () => HookValue; - /* The jest Mock function that receives the hook values for introspection. */ - hookValueCallback: jest.Mock; -} - -/** - * Allows for execution of hooks inside of a test component which records the - * returned values. - * - * @param body A function that calls the hook and returns data derived from it - * @param WrapperComponent A component that, if provided, will be wrapped - * around the test component. This can be useful to provide context values. - * @return {ReactHookWrapper} An object providing access to the hook state and - * functions to interact with it. - */ -export const mountHook = ( - body: (args: Args) => HookValue, - WrapperComponent?: React.ComponentType, - initialArgs: Args = {} as Args -): ReactHookWrapper => { - const hookValueCallback = jest.fn(); - let component!: ReactWrapper; - - const act: ReactHookWrapper['act'] = (actor) => { - reactAct(() => { - actor(getLastHookValue(), (args: Args) => component.setProps(args)); - component.update(); - }); - }; - - const getLastHookValue = () => { - const calls = hookValueCallback.mock.calls; - if (calls.length <= 0) { - throw Error('No recent hook value present.'); - } - return calls[calls.length - 1][0]; - }; - - const HookComponent = (props: Args) => { - hookValueCallback(body(props)); - return null; - }; - const TestComponent: React.FunctionComponent = (args) => - WrapperComponent ? ( - - - - ) : ( - - ); - - reactAct(() => { - component = mount(); - }); - - return { - act, - component, - getLastHookValue, - hookValueCallback, - }; -}; diff --git a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_hosts_anomalies.ts b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_hosts_anomalies.ts index ab50986c3b3d5b..b9bfcd302fb838 100644 --- a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_hosts_anomalies.ts +++ b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_hosts_anomalies.ts @@ -84,7 +84,7 @@ export const createMetricsHostsAnomaliesQuery = ({ const sortOptions = [ { [sortToMlFieldMap[field]]: querySortDirection }, { [TIEBREAKER_FIELD]: querySortDirection }, // Tiebreaker - ]; + ] as const; const resultsQuery = { ...defaultRequestParameters, diff --git a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts index 8fb8df5eef3d75..8dadcfe87c6f9e 100644 --- a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts +++ b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts @@ -83,7 +83,7 @@ export const createMetricsK8sAnomaliesQuery = ({ const sortOptions = [ { [sortToMlFieldMap[field]]: querySortDirection }, { [TIEBREAKER_FIELD]: querySortDirection }, // Tiebreaker - ]; + ] as const; const resultsQuery = { ...defaultRequestParameters, diff --git a/x-pack/plugins/infra/tsconfig.json b/x-pack/plugins/infra/tsconfig.json index 765af7974a2f13..b684e1866282f9 100644 --- a/x-pack/plugins/infra/tsconfig.json +++ b/x-pack/plugins/infra/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/ingest_pipelines/tsconfig.json b/x-pack/plugins/ingest_pipelines/tsconfig.json index a248bc9f337fe3..5917b94caf76b3 100644 --- a/x-pack/plugins/ingest_pipelines/tsconfig.json +++ b/x-pack/plugins/ingest_pipelines/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -11,7 +11,6 @@ "common/**/*", "public/**/*", "server/**/*", - "__jest__/**/*", "../../../typings/**/*" ], "references": [ diff --git a/x-pack/plugins/lens/tsconfig.json b/x-pack/plugins/lens/tsconfig.json index 134f0b4185b840..69ef52535dd9d9 100644 --- a/x-pack/plugins/lens/tsconfig.json +++ b/x-pack/plugins/lens/tsconfig.json @@ -1,6 +1,6 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -38,4 +38,4 @@ { "path": "../../../src/plugins/embeddable/tsconfig.json"}, { "path": "../../../src/plugins/presentation_util/tsconfig.json"}, ] - } \ No newline at end of file + } diff --git a/x-pack/plugins/license_management/tsconfig.json b/x-pack/plugins/license_management/tsconfig.json index e6cb0101ee838b..925049ca924cfb 100644 --- a/x-pack/plugins/license_management/tsconfig.json +++ b/x-pack/plugins/license_management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/licensing/tsconfig.json b/x-pack/plugins/licensing/tsconfig.json index 6118bcd81d342c..2d744e57c1895a 100644 --- a/x-pack/plugins/licensing/tsconfig.json +++ b/x-pack/plugins/licensing/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/logstash/tsconfig.json b/x-pack/plugins/logstash/tsconfig.json index 6f21cfdb0b1919..6430248e46396c 100644 --- a/x-pack/plugins/logstash/tsconfig.json +++ b/x-pack/plugins/logstash/tsconfig.json @@ -1,6 +1,6 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/maps/public/components/validated_number_input.tsx b/x-pack/plugins/maps/public/components/validated_number_input.tsx index cd525cf1ee2c97..942f31074000f9 100644 --- a/x-pack/plugins/maps/public/components/validated_number_input.tsx +++ b/x-pack/plugins/maps/public/components/validated_number_input.tsx @@ -6,8 +6,8 @@ */ import React, { Component, ChangeEvent, ReactNode } from 'react'; -// @ts-expect-error -import { EuiFieldNumber, EuiFormRow, EuiFormRowDisplayKeys } from '@elastic/eui'; +import { EuiFieldNumber, EuiFormRow } from '@elastic/eui'; +import type { EuiFormRowDisplayKeys } from '@elastic/eui/src/components/form/form_row/form_row'; import { i18n } from '@kbn/i18n'; import _ from 'lodash'; diff --git a/x-pack/plugins/maps/tsconfig.json b/x-pack/plugins/maps/tsconfig.json index 1b74b7ee7566a8..59af94bea0b683 100644 --- a/x-pack/plugins/maps/tsconfig.json +++ b/x-pack/plugins/maps/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/maps_legacy_licensing/tsconfig.json b/x-pack/plugins/maps_legacy_licensing/tsconfig.json index 30a547b18a8312..3b8102b5205a88 100644 --- a/x-pack/plugins/maps_legacy_licensing/tsconfig.json +++ b/x-pack/plugins/maps_legacy_licensing/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/ml/server/routes/apidoc_scripts/tsconfig.json b/x-pack/plugins/ml/server/routes/apidoc_scripts/tsconfig.json index 6d01a853698b8e..599dee1e56c0f8 100644 --- a/x-pack/plugins/ml/server/routes/apidoc_scripts/tsconfig.json +++ b/x-pack/plugins/ml/server/routes/apidoc_scripts/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../../../tsconfig.base.json", + "extends": "../../../../../../tsconfig.project.json", "compilerOptions": { "outDir": "./target", "target": "es6", diff --git a/x-pack/plugins/ml/tsconfig.json b/x-pack/plugins/ml/tsconfig.json index 6b396b1c596429..b1135b867dc08d 100644 --- a/x-pack/plugins/ml/tsconfig.json +++ b/x-pack/plugins/ml/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/monitoring/tsconfig.json b/x-pack/plugins/monitoring/tsconfig.json index d0fb7e1a88dcfe..b1999101f7c122 100644 --- a/x-pack/plugins/monitoring/tsconfig.json +++ b/x-pack/plugins/monitoring/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/observability/tsconfig.json b/x-pack/plugins/observability/tsconfig.json index 6833948b86b18d..083c35a26c20bf 100644 --- a/x-pack/plugins/observability/tsconfig.json +++ b/x-pack/plugins/observability/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/osquery/tsconfig.json b/x-pack/plugins/osquery/tsconfig.json index 291b0f7c607cf1..03c9e451f3b52b 100644 --- a/x-pack/plugins/osquery/tsconfig.json +++ b/x-pack/plugins/osquery/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/painless_lab/tsconfig.json b/x-pack/plugins/painless_lab/tsconfig.json index a869b21e06d4d5..2519206b0fcdb6 100644 --- a/x-pack/plugins/painless_lab/tsconfig.json +++ b/x-pack/plugins/painless_lab/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/remote_clusters/tsconfig.json b/x-pack/plugins/remote_clusters/tsconfig.json index 0bee6300cf0b29..b48933bc9f1ecc 100644 --- a/x-pack/plugins/remote_clusters/tsconfig.json +++ b/x-pack/plugins/remote_clusters/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/reporting/tsconfig.json b/x-pack/plugins/reporting/tsconfig.json index 88e8d343f4700f..4f252743ed078b 100644 --- a/x-pack/plugins/reporting/tsconfig.json +++ b/x-pack/plugins/reporting/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/rollup/tsconfig.json b/x-pack/plugins/rollup/tsconfig.json index 9b994d1710ffc2..bf589c62713d6d 100644 --- a/x-pack/plugins/rollup/tsconfig.json +++ b/x-pack/plugins/rollup/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/runtime_fields/tsconfig.json b/x-pack/plugins/runtime_fields/tsconfig.json index a1efe4c9cf2dd6..e1ad141f1c702b 100644 --- a/x-pack/plugins/runtime_fields/tsconfig.json +++ b/x-pack/plugins/runtime_fields/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/saved_objects_tagging/tsconfig.json b/x-pack/plugins/saved_objects_tagging/tsconfig.json index d00156ad1277ca..5c37481f982d91 100644 --- a/x-pack/plugins/saved_objects_tagging/tsconfig.json +++ b/x-pack/plugins/saved_objects_tagging/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/searchprofiler/tsconfig.json b/x-pack/plugins/searchprofiler/tsconfig.json index f8ac3a61f7812a..57cd882422b391 100644 --- a/x-pack/plugins/searchprofiler/tsconfig.json +++ b/x-pack/plugins/searchprofiler/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/security/tsconfig.json b/x-pack/plugins/security/tsconfig.json index 6c3fd1851a8cbe..4ace497dbd5ad6 100644 --- a/x-pack/plugins/security/tsconfig.json +++ b/x-pack/plugins/security/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/security_solution/cypress/tsconfig.json b/x-pack/plugins/security_solution/cypress/tsconfig.json index 270d877a362a6d..bd8d9aa058bc3b 100644 --- a/x-pack/plugins/security_solution/cypress/tsconfig.json +++ b/x-pack/plugins/security_solution/cypress/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.base.json", + "extends": "../../../../tsconfig.project.json", "exclude": [], "include": [ "./**/*" diff --git a/x-pack/plugins/snapshot_restore/tsconfig.json b/x-pack/plugins/snapshot_restore/tsconfig.json index 39beda02977e1d..c496847e4dd9bc 100644 --- a/x-pack/plugins/snapshot_restore/tsconfig.json +++ b/x-pack/plugins/snapshot_restore/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -8,11 +8,9 @@ "declarationMap": true }, "include": [ - "__jest__/**/*", "common/**/*", "public/**/*", "server/**/*", - "test/**/*", "../../../typings/**/*", ], "references": [ diff --git a/x-pack/plugins/spaces/tsconfig.json b/x-pack/plugins/spaces/tsconfig.json index 95fbecaa909366..4c67cbe8912bd6 100644 --- a/x-pack/plugins/spaces/tsconfig.json +++ b/x-pack/plugins/spaces/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/stack_alerts/tsconfig.json b/x-pack/plugins/stack_alerts/tsconfig.json index c83935945c67b4..97eb9a9a05b86e 100644 --- a/x-pack/plugins/stack_alerts/tsconfig.json +++ b/x-pack/plugins/stack_alerts/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/task_manager/server/monitoring/workload_statistics.ts b/x-pack/plugins/task_manager/server/monitoring/workload_statistics.ts index c79b310822c3ec..70b4ba55c2393f 100644 --- a/x-pack/plugins/task_manager/server/monitoring/workload_statistics.ts +++ b/x-pack/plugins/task_manager/server/monitoring/workload_statistics.ts @@ -56,7 +56,7 @@ export interface WorkloadAggregation { scheduleDensity: { range: { field: string; - ranges: [{ from: string; to: string }]; + ranges: [{ from: number; to: number }]; }; aggs: { histogram: { @@ -86,7 +86,6 @@ export interface WorkloadAggregation { // The type of a bucket in the scheduleDensity range aggregation type ScheduleDensityResult = AggregationResultOf< - // @ts-expect-error AggregationRange reqires from: number WorkloadAggregation['aggs']['idleTasks']['aggs']['scheduleDensity'], {} >['buckets'][0]; diff --git a/x-pack/plugins/task_manager/tsconfig.json b/x-pack/plugins/task_manager/tsconfig.json index a72b678da1f7c1..95a098e54619e6 100644 --- a/x-pack/plugins/task_manager/tsconfig.json +++ b/x-pack/plugins/task_manager/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/telemetry_collection_xpack/tsconfig.json b/x-pack/plugins/telemetry_collection_xpack/tsconfig.json index 476f5926f757a4..80488bd74617d1 100644 --- a/x-pack/plugins/telemetry_collection_xpack/tsconfig.json +++ b/x-pack/plugins/telemetry_collection_xpack/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/transform/tsconfig.json b/x-pack/plugins/transform/tsconfig.json index 2717f92c7a4df1..30da887cc1c431 100644 --- a/x-pack/plugins/transform/tsconfig.json +++ b/x-pack/plugins/transform/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/triggers_actions_ui/tsconfig.json b/x-pack/plugins/triggers_actions_ui/tsconfig.json index 8202449b222987..b7a63d7043f496 100644 --- a/x-pack/plugins/triggers_actions_ui/tsconfig.json +++ b/x-pack/plugins/triggers_actions_ui/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/ui_actions_enhanced/tsconfig.json b/x-pack/plugins/ui_actions_enhanced/tsconfig.json index 39318770126e58..1513669cdc1ad0 100644 --- a/x-pack/plugins/ui_actions_enhanced/tsconfig.json +++ b/x-pack/plugins/ui_actions_enhanced/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/upgrade_assistant/tsconfig.json b/x-pack/plugins/upgrade_assistant/tsconfig.json index 0d65c8ddd8fed0..08e45bebf125b5 100644 --- a/x-pack/plugins/upgrade_assistant/tsconfig.json +++ b/x-pack/plugins/upgrade_assistant/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/uptime/public/components/certificates/cert_monitors.test.tsx b/x-pack/plugins/uptime/public/components/certificates/cert_monitors.test.tsx index 5dfc11837b72d6..719c90574b0887 100644 --- a/x-pack/plugins/uptime/public/components/certificates/cert_monitors.test.tsx +++ b/x-pack/plugins/uptime/public/components/certificates/cert_monitors.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { CertMonitors } from './cert_monitors'; -import { renderWithRouter, shallowWithRouter } from '../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../lib/helper/enzyme_helpers'; describe('CertMonitors', () => { const certMons = [ diff --git a/x-pack/plugins/uptime/public/components/certificates/cert_search.test.tsx b/x-pack/plugins/uptime/public/components/certificates/cert_search.test.tsx index a991634de22a6c..a0166fc5737544 100644 --- a/x-pack/plugins/uptime/public/components/certificates/cert_search.test.tsx +++ b/x-pack/plugins/uptime/public/components/certificates/cert_search.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithRouter, shallowWithRouter } from '../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../lib/helper/enzyme_helpers'; import { CertificateSearch } from './cert_search'; describe('CertificatesSearch', () => { diff --git a/x-pack/plugins/uptime/public/components/certificates/cert_status.test.tsx b/x-pack/plugins/uptime/public/components/certificates/cert_status.test.tsx index e331a6e5c34fea..999d76f6908672 100644 --- a/x-pack/plugins/uptime/public/components/certificates/cert_status.test.tsx +++ b/x-pack/plugins/uptime/public/components/certificates/cert_status.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithRouter, shallowWithRouter } from '../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../lib/helper/enzyme_helpers'; import { CertStatus } from './cert_status'; import * as redux from 'react-redux'; import moment from 'moment'; diff --git a/x-pack/plugins/uptime/public/components/certificates/certificates_list.test.tsx b/x-pack/plugins/uptime/public/components/certificates/certificates_list.test.tsx index ec6a5d91a67c33..8ae0cdb791d9b1 100644 --- a/x-pack/plugins/uptime/public/components/certificates/certificates_list.test.tsx +++ b/x-pack/plugins/uptime/public/components/certificates/certificates_list.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithRouter } from '../../lib'; +import { shallowWithRouter } from '../../lib/helper/enzyme_helpers'; import { CertificateList, CertSort } from './certificates_list'; describe('CertificateList', () => { diff --git a/x-pack/plugins/uptime/public/components/certificates/fingerprint_col.test.tsx b/x-pack/plugins/uptime/public/components/certificates/fingerprint_col.test.tsx index 1affd1f990f90b..550b7f75623f0d 100644 --- a/x-pack/plugins/uptime/public/components/certificates/fingerprint_col.test.tsx +++ b/x-pack/plugins/uptime/public/components/certificates/fingerprint_col.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithRouter, shallowWithRouter } from '../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../lib/helper/enzyme_helpers'; import { FingerprintCol } from './fingerprint_col'; import moment from 'moment'; diff --git a/x-pack/plugins/uptime/public/components/common/charts/duration_charts.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/duration_charts.test.tsx index d7ae92a0e76544..72b1145a9f34e2 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/duration_charts.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/duration_charts.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import DateMath from '@elastic/datemath'; import { DurationChartComponent } from './duration_chart'; import { MonitorDurationResult } from '../../../../common/types'; -import { shallowWithRouter } from '../../../lib'; +import { shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; describe('MonitorCharts component', () => { let dateMathSpy: any; diff --git a/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.test.tsx index 792b357b3baba8..b11595eafae4fb 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.test.tsx @@ -7,7 +7,8 @@ import React from 'react'; import { MonitorBarSeries, MonitorBarSeriesProps } from './monitor_bar_series'; -import { renderWithRouter, shallowWithRouter, MountWithReduxProvider } from '../../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; +import { MountWithReduxProvider } from '../../../lib/helper/helper_with_redux'; import { HistogramPoint } from '../../../../common/runtime_types'; describe('MonitorBarSeries component', () => { diff --git a/x-pack/plugins/uptime/public/components/common/header/page_header.test.tsx b/x-pack/plugins/uptime/public/components/common/header/page_header.test.tsx index 6e04648a817f0c..bede71b8ba03d8 100644 --- a/x-pack/plugins/uptime/public/components/common/header/page_header.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/header/page_header.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import moment from 'moment'; import { PageHeader } from './page_header'; import { Ping } from '../../../../common/runtime_types'; -import { renderWithRouter } from '../../../lib'; +import { renderWithRouter } from '../../../lib/helper/enzyme_helpers'; import { mockReduxHooks } from '../../../lib/helper/test_helpers'; describe('PageHeader', () => { diff --git a/x-pack/plugins/uptime/public/components/common/monitor_tags.test.tsx b/x-pack/plugins/uptime/public/components/common/monitor_tags.test.tsx index fdb5498969d39d..63465aefcdd433 100644 --- a/x-pack/plugins/uptime/public/components/common/monitor_tags.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/monitor_tags.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { MemoryRouter } from 'react-router-dom'; import { MonitorTags } from './monitor_tags'; import * as hooks from '../../hooks/use_url_params'; -import { renderWithRouter, shallowWithRouter } from '../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../lib/helper/enzyme_helpers'; describe('MonitorTags component', () => { const summaryPing = { diff --git a/x-pack/plugins/uptime/public/components/common/uptime_date_picker.test.tsx b/x-pack/plugins/uptime/public/components/common/uptime_date_picker.test.tsx index 4bfe7de33cba58..d433e7fccd1b8e 100644 --- a/x-pack/plugins/uptime/public/components/common/uptime_date_picker.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/uptime_date_picker.test.tsx @@ -10,9 +10,9 @@ import { UptimeDatePicker } from './uptime_date_picker'; import { renderWithRouter, shallowWithRouter, - MountWithReduxProvider, mountWithRouterRedux, -} from '../../lib'; +} from '../../lib/helper/enzyme_helpers'; +import { MountWithReduxProvider } from '../../lib/helper/helper_with_redux'; import { UptimeStartupPluginsContextProvider } from '../../contexts'; import { startPlugins } from '../../lib/__mocks__/uptime_plugin_start_mock'; import { ClientPluginsStart } from '../../apps/plugin'; diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/ml_integerations.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/ml_integerations.test.tsx index f29be50633fab7..16d96148af3404 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/ml_integerations.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/ml_integerations.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { MLIntegrationComponent } from './ml_integeration'; -import { renderWithRouter, shallowWithRouter } from '../../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; import * as redux from 'react-redux'; import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; import { coreMock } from 'src/core/public/mocks'; diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/ml_manage_job.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/ml_manage_job.test.tsx index 15a537a49ccf38..6bff0b61d7349e 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/ml_manage_job.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/ml_manage_job.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { coreMock } from 'src/core/public/mocks'; import { ManageMLJobComponent } from './manage_ml_job'; import * as redux from 'react-redux'; -import { renderWithRouter, shallowWithRouter } from '../../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; const core = coreMock.createStart(); diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_charts.test.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_charts.test.tsx index 3f107581c1eea7..a1be391833bc3f 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_charts.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_charts.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import DateMath from '@elastic/datemath'; import { MonitorCharts } from './monitor_charts'; -import { shallowWithRouter } from '../../lib'; +import { shallowWithRouter } from '../../lib/helper/enzyme_helpers'; describe('MonitorCharts component', () => { let dateMathSpy: any; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_title.test.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_title.test.tsx index dabc0021898eb8..682be99b9b4186 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_title.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_title.test.tsx @@ -10,7 +10,7 @@ import moment from 'moment'; import * as reactRouterDom from 'react-router-dom'; import { Ping } from '../../../common/runtime_types'; import { MonitorPageTitle } from './monitor_title'; -import { renderWithRouter } from '../../lib'; +import { renderWithRouter } from '../../lib/helper/enzyme_helpers'; import { mockReduxHooks } from '../../lib/helper/test_helpers'; jest.mock('react-router-dom', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/monitor_status.bar.test.tsx b/x-pack/plugins/uptime/public/components/monitor/status_details/monitor_status.bar.test.tsx index af3c47b9caf30b..ba0853b5b1b60a 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/monitor_status.bar.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/monitor_status.bar.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { MonitorStatusBar } from './status_bar'; import { Ping } from '../../../../common/runtime_types'; import * as redux from 'react-redux'; -import { renderWithRouter } from '../../../lib'; +import { renderWithRouter } from '../../../lib/helper/enzyme_helpers'; import { createMemoryHistory } from 'history'; describe('MonitorStatusBar component', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/ssl_certificate.test.tsx b/x-pack/plugins/uptime/public/components/monitor/status_details/ssl_certificate.test.tsx index 03ce292e63621a..0cb7ff7168404d 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/ssl_certificate.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/ssl_certificate.test.tsx @@ -11,7 +11,11 @@ import { EuiIcon } from '@elastic/eui'; import { Tls } from '../../../../common/runtime_types'; import { MonitorSSLCertificate } from './status_bar'; import * as redux from 'react-redux'; -import { mountWithRouter, renderWithRouter, shallowWithRouter } from '../../../lib'; +import { + mountWithRouter, + renderWithRouter, + shallowWithRouter, +} from '../../../lib/helper/enzyme_helpers'; import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; describe('SSL Certificate component', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.test.tsx b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.test.tsx index a617ba0db1eb33..c751e6a0c24fa0 100644 --- a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EmptyStateComponent } from './empty_state'; import { StatesIndexStatus } from '../../../../common/runtime_types'; import { HttpFetchError, IHttpFetchError } from 'src/core/public'; -import { mountWithRouter, shallowWithRouter } from '../../../lib'; +import { mountWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; describe('EmptyState component', () => { let statesIndexStatus: StatesIndexStatus; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/enable_alert.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/enable_alert.test.tsx index a325edc2431291..a4e7f10d97bfc7 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/enable_alert.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/enable_alert.test.tsx @@ -12,7 +12,7 @@ import { mountWithRouterRedux, renderWithRouterRedux, shallowWithRouterRedux, -} from '../../../../lib'; +} from '../../../../lib/helper/enzyme_helpers'; import { EuiPopover, EuiText } from '@elastic/eui'; import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../../common/constants'; import { ReactRouterEuiLink } from '../../../common/react_router_helpers'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/filter_status_button.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/filter_status_button.test.tsx index 4d0e82dc8a2969..c95e3cd61c5fd7 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/filter_status_button.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/filter_status_button.test.tsx @@ -7,7 +7,8 @@ import React from 'react'; import { FilterStatusButton, FilterStatusButtonProps } from './filter_status_button'; -import { renderWithRouter, shallowWithRouter, MountWithReduxProvider } from '../../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; +import { MountWithReduxProvider } from '../../../lib/helper/helper_with_redux'; describe('FilterStatusButton', () => { let props: FilterStatusButtonProps; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.test.tsx index 39f9b20624b630..f7a2ad9a536bd1 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.test.tsx @@ -15,7 +15,7 @@ import { MonitorSummary, } from '../../../../common/runtime_types'; import { MonitorListComponent, noItemsMessage } from './monitor_list'; -import { renderWithRouter, shallowWithRouter } from '../../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; import * as redux from 'react-redux'; import moment from 'moment'; import { IHttpFetchError } from '../../../../../../../src/core/public'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx index d044ad4e6a3a28..39c6d6bd9215d5 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx @@ -9,7 +9,7 @@ import 'jest'; import React from 'react'; import { MonitorListDrawerComponent } from './monitor_list_drawer'; import { MonitorDetails, MonitorSummary, makePing } from '../../../../../common/runtime_types'; -import { shallowWithRouter } from '../../../../lib'; +import { shallowWithRouter } from '../../../../lib/helper/enzyme_helpers'; describe('MonitorListDrawer component', () => { let summary: MonitorSummary; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/status_filter.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/status_filter.test.tsx index bbc4e13c9eca2c..c2515ab55b126b 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/status_filter.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/status_filter.test.tsx @@ -10,8 +10,8 @@ import { mountWithRouter, renderWithRouter, shallowWithRouter, - MountWithReduxProvider, -} from '../../../lib'; +} from '../../../lib/helper/enzyme_helpers'; +import { MountWithReduxProvider } from '../../../lib/helper/helper_with_redux'; import { createMemoryHistory } from 'history'; import { StatusFilter } from './status_filter'; import { FilterStatusButton } from './filter_status_button'; diff --git a/x-pack/plugins/uptime/public/components/settings/certificate_form.test.tsx b/x-pack/plugins/uptime/public/components/settings/certificate_form.test.tsx index 84c9923bfc4192..051c4166d0fddf 100644 --- a/x-pack/plugins/uptime/public/components/settings/certificate_form.test.tsx +++ b/x-pack/plugins/uptime/public/components/settings/certificate_form.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { CertificateExpirationForm } from './certificate_form'; -import { shallowWithRouter, mountWithRouter } from '../../lib'; +import { shallowWithRouter, mountWithRouter } from '../../lib/helper/enzyme_helpers'; describe('CertificateForm', () => { it('shallow renders expected elements for valid props', () => { diff --git a/x-pack/plugins/uptime/public/components/settings/indices_form.test.tsx b/x-pack/plugins/uptime/public/components/settings/indices_form.test.tsx index 67ca142d8a8ea8..fc2567ea98c451 100644 --- a/x-pack/plugins/uptime/public/components/settings/indices_form.test.tsx +++ b/x-pack/plugins/uptime/public/components/settings/indices_form.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { IndicesForm } from './indices_form'; -import { shallowWithRouter } from '../../lib'; +import { shallowWithRouter } from '../../lib/helper/enzyme_helpers'; describe('CertificateForm', () => { it('shallow renders expected elements for valid props', () => { diff --git a/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx b/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx index 6fc98fbaf1f5b0..7aeac9706af58c 100644 --- a/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx +++ b/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx @@ -8,10 +8,11 @@ import { ChromeBreadcrumb } from 'kibana/public'; import React from 'react'; import { Route } from 'react-router-dom'; -import { mountWithRouter } from '../lib'; +import { mountWithRouter } from '../lib/helper/enzyme_helpers'; import { OVERVIEW_ROUTE } from '../../common/constants'; import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; -import { UptimeUrlParams, getSupportedUrlParams, MountWithReduxProvider } from '../lib/helper'; +import { UptimeUrlParams, getSupportedUrlParams } from '../lib/helper'; +import { MountWithReduxProvider } from '../lib/helper/helper_with_redux'; import { makeBaseBreadcrumb, useBreadcrumbs } from './use_breadcrumbs'; describe('useBreadcrumbs', () => { diff --git a/x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx b/x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx index 3ce112b1cb835a..31580ec22d48cd 100644 --- a/x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx +++ b/x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx @@ -9,7 +9,8 @@ import DateMath from '@elastic/datemath'; import React, { useState, Fragment } from 'react'; import { useUrlParams, UptimeUrlParamsHook } from './use_url_params'; import { UptimeRefreshContext } from '../contexts'; -import { mountWithRouter, MountWithReduxProvider } from '../lib'; +import { MountWithReduxProvider } from '../lib/helper/helper_with_redux'; +import { mountWithRouter } from '../lib/helper/enzyme_helpers'; import { createMemoryHistory } from 'history'; interface MockUrlParamsComponentProps { diff --git a/x-pack/plugins/uptime/public/lib/helper/index.ts b/x-pack/plugins/uptime/public/lib/helper/index.ts index 2fce3cc0e54dc6..6546b5f9ae6c45 100644 --- a/x-pack/plugins/uptime/public/lib/helper/index.ts +++ b/x-pack/plugins/uptime/public/lib/helper/index.ts @@ -10,4 +10,3 @@ export * from './observability_integration'; export { getChartDateLabel } from './charts'; export { seriesHasDownValues } from './series_has_down_values'; export { UptimeUrlParams, getSupportedUrlParams } from './url_params'; -export { MountWithReduxProvider } from './helper_with_redux'; diff --git a/x-pack/plugins/uptime/public/lib/index.ts b/x-pack/plugins/uptime/public/lib/index.ts deleted file mode 100644 index 9added9af65926..00000000000000 --- a/x-pack/plugins/uptime/public/lib/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { MountWithReduxProvider } from './helper'; -export * from './helper/enzyme_helpers'; diff --git a/x-pack/plugins/uptime/public/pages/certificates.test.tsx b/x-pack/plugins/uptime/public/pages/certificates.test.tsx index ff5f1afcaa2902..1218a1882b3bf8 100644 --- a/x-pack/plugins/uptime/public/pages/certificates.test.tsx +++ b/x-pack/plugins/uptime/public/pages/certificates.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithRouter } from '../lib'; +import { shallowWithRouter } from '../lib/helper/enzyme_helpers'; import { CertificatesPage } from './certificates'; describe('CertificatesPage', () => { diff --git a/x-pack/plugins/uptime/public/pages/monitor.test.tsx b/x-pack/plugins/uptime/public/pages/monitor.test.tsx index 80fcfcc271964d..2664f73d260757 100644 --- a/x-pack/plugins/uptime/public/pages/monitor.test.tsx +++ b/x-pack/plugins/uptime/public/pages/monitor.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { MonitorPage } from './monitor'; -import { shallowWithRouter } from '../lib'; +import { shallowWithRouter } from '../lib/helper/enzyme_helpers'; describe('MonitorPage', () => { it('shallow renders expected elements for valid props', () => { diff --git a/x-pack/plugins/uptime/public/pages/not_found.test.tsx b/x-pack/plugins/uptime/public/pages/not_found.test.tsx index 8d5b20e45303d6..cc9ea1a62cd0f4 100644 --- a/x-pack/plugins/uptime/public/pages/not_found.test.tsx +++ b/x-pack/plugins/uptime/public/pages/not_found.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithRouter } from '../lib'; +import { shallowWithRouter } from '../lib/helper/enzyme_helpers'; import { NotFoundPage } from './not_found'; describe('NotFoundPage', () => { diff --git a/x-pack/plugins/uptime/public/pages/overview.test.tsx b/x-pack/plugins/uptime/public/pages/overview.test.tsx index cfc140e6b22a31..b4949a84a6e367 100644 --- a/x-pack/plugins/uptime/public/pages/overview.test.tsx +++ b/x-pack/plugins/uptime/public/pages/overview.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { OverviewPageComponent } from './overview'; -import { shallowWithRouter } from '../lib'; +import { shallowWithRouter } from '../lib/helper/enzyme_helpers'; describe('MonitorPage', () => { const indexPattern = { diff --git a/x-pack/plugins/uptime/tsconfig.json b/x-pack/plugins/uptime/tsconfig.json index 531ee2ecd8d2b1..0b982040017537 100644 --- a/x-pack/plugins/uptime/tsconfig.json +++ b/x-pack/plugins/uptime/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -12,7 +12,6 @@ "public/**/*", "public/components/monitor/status_details/location_map/embeddables/low_poly_layer.json", "server/**/*", - "server/lib/requests/__fixtures__/monitor_charts_mock.json", "../../../typings/**/*" ], "references": [ diff --git a/x-pack/plugins/watcher/tsconfig.json b/x-pack/plugins/watcher/tsconfig.json index e8dabe8cd40a9c..41bcb015d2d94a 100644 --- a/x-pack/plugins/watcher/tsconfig.json +++ b/x-pack/plugins/watcher/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/xpack_legacy/tsconfig.json b/x-pack/plugins/xpack_legacy/tsconfig.json index 3bfc78b72cb3ef..fdac21a3913130 100644 --- a/x-pack/plugins/xpack_legacy/tsconfig.json +++ b/x-pack/plugins/xpack_legacy/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types",