From f7f683794b185eed95f9c7521c8760c3ce820e06 Mon Sep 17 00:00:00 2001
From: restrry <restrry@gmail.com>
Date: Fri, 26 Mar 2021 17:12:02 +0100
Subject: [PATCH 01/18] add base config for all the TS projects

---
 tsconfig.project.json | 51 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 tsconfig.project.json

diff --git a/tsconfig.project.json b/tsconfig.project.json
new file mode 100644
index 0000000000000..78cbd1c29ab9a
--- /dev/null
+++ b/tsconfig.project.json
@@ -0,0 +1,51 @@
+{
+  "extends": "./tsconfig.base.json",
+  "compilerOptions": {
+    "composite": true,
+    "emitDeclarationOnly": true,
+    "declaration": true,
+    "declarationMap": true
+  },
+  "exclude": [
+    // tests
+    "**/*.test.ts",
+    "**/*.test.tsx",
+    "**/integration_tests/*",
+    "**/tests/*",
+    "**/__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",
+    "**/*/test_helpers.tsx",
+    // apm uses non-standard file casing
+    "**/*/testHelpers.tsx",
+
+    // stubs
+    "**/*/stubs.ts",
+    "**/*.stub.ts",
+    "**/*.stories.tsx",
+    "**/*/_mock_handler_arguments.ts"
+  ],
+  "types": [
+    "node",
+    "flot",
+  ]
+}

From c25a34c428092f80d9be6ae87812017c2119a649 Mon Sep 17 00:00:00 2001
From: restrry <restrry@gmail.com>
Date: Fri, 26 Mar 2021 17:13:13 +0100
Subject: [PATCH 02/18] all the project use new tsconfig.project.json

---
 src/core/tsconfig.json                                       | 2 +-
 src/plugins/advanced_settings/tsconfig.json                  | 2 +-
 src/plugins/apm_oss/tsconfig.json                            | 2 +-
 src/plugins/bfetch/tsconfig.json                             | 2 +-
 src/plugins/charts/tsconfig.json                             | 2 +-
 src/plugins/console/tsconfig.json                            | 2 +-
 src/plugins/dashboard/tsconfig.json                          | 2 +-
 src/plugins/data/tsconfig.json                               | 2 +-
 src/plugins/dev_tools/tsconfig.json                          | 2 +-
 src/plugins/discover/tsconfig.json                           | 2 +-
 src/plugins/embeddable/tsconfig.json                         | 2 +-
 src/plugins/es_ui_shared/tsconfig.json                       | 2 +-
 src/plugins/expressions/tsconfig.json                        | 2 +-
 src/plugins/home/tsconfig.json                               | 2 +-
 src/plugins/index_pattern_field_editor/tsconfig.json         | 2 +-
 src/plugins/index_pattern_management/tsconfig.json           | 2 +-
 src/plugins/input_control_vis/tsconfig.json                  | 2 +-
 src/plugins/inspector/tsconfig.json                          | 2 +-
 src/plugins/kibana_legacy/tsconfig.json                      | 2 +-
 src/plugins/kibana_overview/tsconfig.json                    | 2 +-
 src/plugins/kibana_react/tsconfig.json                       | 2 +-
 src/plugins/kibana_usage_collection/tsconfig.json            | 2 +-
 src/plugins/kibana_utils/tsconfig.json                       | 2 +-
 src/plugins/legacy_export/tsconfig.json                      | 2 +-
 src/plugins/management/tsconfig.json                         | 2 +-
 src/plugins/maps_ems/tsconfig.json                           | 2 +-
 src/plugins/maps_legacy/tsconfig.json                        | 2 +-
 src/plugins/navigation/tsconfig.json                         | 2 +-
 src/plugins/newsfeed/tsconfig.json                           | 2 +-
 src/plugins/presentation_util/tsconfig.json                  | 2 +-
 src/plugins/region_map/tsconfig.json                         | 2 +-
 src/plugins/saved_objects/tsconfig.json                      | 2 +-
 src/plugins/saved_objects_management/tsconfig.json           | 2 +-
 src/plugins/saved_objects_tagging_oss/tsconfig.json          | 2 +-
 src/plugins/security_oss/tsconfig.json                       | 2 +-
 src/plugins/share/tsconfig.json                              | 2 +-
 src/plugins/spaces_oss/tsconfig.json                         | 2 +-
 src/plugins/telemetry/tsconfig.json                          | 2 +-
 src/plugins/telemetry_collection_manager/tsconfig.json       | 2 +-
 src/plugins/telemetry_management_section/tsconfig.json       | 2 +-
 src/plugins/tile_map/tsconfig.json                           | 2 +-
 src/plugins/timelion/tsconfig.json                           | 2 +-
 src/plugins/ui_actions/tsconfig.json                         | 2 +-
 src/plugins/url_forwarding/tsconfig.json                     | 2 +-
 src/plugins/usage_collection/tsconfig.json                   | 2 +-
 src/plugins/vis_default_editor/tsconfig.json                 | 2 +-
 src/plugins/vis_type_markdown/tsconfig.json                  | 2 +-
 src/plugins/vis_type_metric/tsconfig.json                    | 2 +-
 src/plugins/vis_type_table/tsconfig.json                     | 2 +-
 src/plugins/vis_type_tagcloud/tsconfig.json                  | 2 +-
 src/plugins/vis_type_timelion/tsconfig.json                  | 2 +-
 src/plugins/vis_type_timeseries/tsconfig.json                | 2 +-
 src/plugins/vis_type_vega/tsconfig.json                      | 2 +-
 src/plugins/vis_type_vislib/tsconfig.json                    | 2 +-
 src/plugins/vis_type_xy/tsconfig.json                        | 2 +-
 src/plugins/visualizations/tsconfig.json                     | 2 +-
 src/plugins/visualize/tsconfig.json                          | 2 +-
 x-pack/plugins/actions/tsconfig.json                         | 2 +-
 x-pack/plugins/alerting/tsconfig.json                        | 2 +-
 x-pack/plugins/apm/e2e/tsconfig.json                         | 2 +-
 x-pack/plugins/apm/ftr_e2e/tsconfig.json                     | 4 ++--
 x-pack/plugins/apm/scripts/optimize-tsconfig/optimize.js     | 2 +-
 x-pack/plugins/apm/scripts/optimize-tsconfig/paths.js        | 2 +-
 x-pack/plugins/apm/tsconfig.json                             | 2 +-
 x-pack/plugins/banners/tsconfig.json                         | 2 +-
 x-pack/plugins/beats_management/tsconfig.json                | 2 +-
 x-pack/plugins/canvas/storybook/addon/tsconfig.json          | 2 +-
 x-pack/plugins/canvas/tsconfig.json                          | 2 +-
 x-pack/plugins/cloud/tsconfig.json                           | 2 +-
 x-pack/plugins/console_extensions/tsconfig.json              | 2 +-
 x-pack/plugins/cross_cluster_replication/tsconfig.json       | 2 +-
 x-pack/plugins/dashboard_enhanced/tsconfig.json              | 2 +-
 x-pack/plugins/dashboard_mode/tsconfig.json                  | 2 +-
 x-pack/plugins/data_enhanced/tsconfig.json                   | 2 +-
 x-pack/plugins/discover_enhanced/tsconfig.json               | 2 +-
 x-pack/plugins/drilldowns/url_drilldown/tsconfig.json        | 2 +-
 x-pack/plugins/embeddable_enhanced/tsconfig.json             | 2 +-
 x-pack/plugins/encrypted_saved_objects/tsconfig.json         | 2 +-
 x-pack/plugins/enterprise_search/tsconfig.json               | 2 +-
 x-pack/plugins/event_log/tsconfig.json                       | 2 +-
 x-pack/plugins/features/tsconfig.json                        | 2 +-
 x-pack/plugins/file_upload/tsconfig.json                     | 2 +-
 x-pack/plugins/fleet/tsconfig.json                           | 2 +-
 x-pack/plugins/global_search/tsconfig.json                   | 2 +-
 x-pack/plugins/global_search_bar/tsconfig.json               | 2 +-
 x-pack/plugins/global_search_providers/tsconfig.json         | 2 +-
 x-pack/plugins/graph/tsconfig.json                           | 4 ++--
 x-pack/plugins/grokdebugger/tsconfig.json                    | 2 +-
 x-pack/plugins/index_lifecycle_management/tsconfig.json      | 2 +-
 x-pack/plugins/index_management/tsconfig.json                | 2 +-
 x-pack/plugins/infra/tsconfig.json                           | 2 +-
 x-pack/plugins/ingest_pipelines/tsconfig.json                | 2 +-
 x-pack/plugins/lens/tsconfig.json                            | 4 ++--
 x-pack/plugins/license_management/tsconfig.json              | 2 +-
 x-pack/plugins/licensing/tsconfig.json                       | 2 +-
 x-pack/plugins/logstash/tsconfig.json                        | 2 +-
 x-pack/plugins/maps/tsconfig.json                            | 2 +-
 x-pack/plugins/maps_legacy_licensing/tsconfig.json           | 2 +-
 x-pack/plugins/ml/server/routes/apidoc_scripts/tsconfig.json | 2 +-
 x-pack/plugins/ml/tsconfig.json                              | 2 +-
 x-pack/plugins/monitoring/tsconfig.json                      | 2 +-
 x-pack/plugins/observability/tsconfig.json                   | 2 +-
 x-pack/plugins/osquery/tsconfig.json                         | 2 +-
 x-pack/plugins/painless_lab/tsconfig.json                    | 2 +-
 x-pack/plugins/remote_clusters/tsconfig.json                 | 2 +-
 x-pack/plugins/reporting/tsconfig.json                       | 2 +-
 x-pack/plugins/rollup/tsconfig.json                          | 2 +-
 x-pack/plugins/runtime_fields/tsconfig.json                  | 2 +-
 x-pack/plugins/saved_objects_tagging/tsconfig.json           | 2 +-
 x-pack/plugins/searchprofiler/tsconfig.json                  | 2 +-
 x-pack/plugins/security/tsconfig.json                        | 2 +-
 x-pack/plugins/security_solution/cypress/tsconfig.json       | 2 +-
 x-pack/plugins/snapshot_restore/tsconfig.json                | 2 +-
 x-pack/plugins/spaces/tsconfig.json                          | 2 +-
 x-pack/plugins/stack_alerts/tsconfig.json                    | 2 +-
 x-pack/plugins/task_manager/tsconfig.json                    | 2 +-
 x-pack/plugins/telemetry_collection_xpack/tsconfig.json      | 2 +-
 x-pack/plugins/transform/tsconfig.json                       | 2 +-
 x-pack/plugins/triggers_actions_ui/tsconfig.json             | 2 +-
 x-pack/plugins/ui_actions_enhanced/tsconfig.json             | 2 +-
 x-pack/plugins/upgrade_assistant/tsconfig.json               | 2 +-
 x-pack/plugins/uptime/tsconfig.json                          | 2 +-
 x-pack/plugins/watcher/tsconfig.json                         | 2 +-
 x-pack/plugins/xpack_legacy/tsconfig.json                    | 2 +-
 124 files changed, 127 insertions(+), 127 deletions(-)

diff --git a/src/core/tsconfig.json b/src/core/tsconfig.json
index 855962070457e..f19e379482d3c 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/plugins/advanced_settings/tsconfig.json b/src/plugins/advanced_settings/tsconfig.json
index 4d62e410326b6..97a855959903d 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 aeb6837c69a99..ccb123aaec83b 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 173ff725d07d0..6c01479f1929e 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 a4f65d5937204..99edb2ffe3c16 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 34aca5021bac4..d9f49036be8f8 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 dd99119cfb457..452208b39af60 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/tsconfig.json b/src/plugins/data/tsconfig.json
index 21560b1328840..075f55e22f61c 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 c17b2341fd42f..f369396b17fbe 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 ec98199c3423e..96765d76a340b 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 27a887500fb68..eacfa831ecee5 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 9bcda2e0614de..3d102daaf3aaf 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/tsconfig.json b/src/plugins/expressions/tsconfig.json
index cce71013cefa5..fe76ba3050a3b 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 b2613eeecdfb0..b68b3491220da 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 559b1aaf0fc26..c638fd34c6bbb 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 37bd3e4aa5bbb..3c8fdb1cf6597 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 bef7bc394a6cc..c2f8d8783e822 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 2a9c41464532c..0e42e577428c6 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 709036c9e82f4..0b3f42cd3b57b 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 ac3ac109cb35f..3396861cb9179 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 eb9a24ca141f6..857b8cf83645c 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 d664d936f6667..100f1f03955d0 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 ae5e9b90af807..d9572707e8662 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 ec006d492499e..d6689ea1067db 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 ba3661666631a..3423299a53df7 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 b85c3da66b83a..7f44da00d47a4 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 f757e35f785af..c600024cc4a74 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 07cfe10d7d81f..bb86142e1c443 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 66244a22336c7..84626b2f3a6a8 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 37b9380f6f2b9..cb39c5fb36f56 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 899611d027465..385c31e6bd2d6 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 d9045b91b9dfa..46b3f9a5afcb6 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 99849dea38618..cb74b06179225 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 b0059c71424bf..ae566d9626895 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 530e01a034b00..156e4ffee9d79 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 985066915f1dd..62c0b3739f4b7 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 0cc82d7e5d124..96584842ec32b 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 bdced01d9eb6f..40370082f99e2 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 1bba81769f0dd..8bbc440fb1a54 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 48e40814b8570..c6a21733b2d6b 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 899611d027465..385c31e6bd2d6 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 5b96d69a878ea..bb8a48339d44e 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 a871d7215cdc5..89b66d18705c2 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 8e867a6bad14f..f1916e4ce5957 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 96b2c4d37e17c..b4a0721ef3672 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 27bb775c2d0e8..54a84e08224a8 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 d5ab89b98081b..f940c295e7cee 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 7441848d5a430..8cee918a3dc82 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 ccff3c349cf21..4f2e80575497b 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 18bbad2257466..f7f3688183a48 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 77f97de28366d..d29fb25b15315 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 7b2dd4b608c1c..edc2d25b867d1 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 4091dafcbe357..f375a2483e24f 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 74bc1440d9dbc..845628a6b86f9 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 5cb0bc8d0bc8e..7e23b07bd80f6 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 d7c5e6a4b4366..65de6908228b3 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 bc0891f391746..046202d82d1aa 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/x-pack/plugins/actions/tsconfig.json b/x-pack/plugins/actions/tsconfig.json
index d5c1105c99ad0..10ebd09235236 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 86ab00faeb5ad..4010688746901 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 c4587349c7ad7..0c13dd717991c 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 168801f782607..f699943a254fa 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 fed938119c4a6..613435fe186bf 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 dbc207c9e6d26..b501ec3a8eedf 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 ffbf11c23f63a..ae2085dc24003 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 85608a8a78ad5..6c4c80173208b 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 ad68cc900e638..398438712b26b 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 2ab1856de661a..b115d1c46546c 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 487b68ba3542b..679165f0a1b76 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 46e81aa7fa086..f6edb9fb7ccae 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 5ad28f230a0bb..edcd46c4fafc5 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 9c7590b9c2553..156a851abb8db 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 567c390edfa5a..f6acdddc6f997 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 6e4ed11ffa7ff..c4a11959ec3e3 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 216c115545a45..64a11cb5db9db 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 38a55e557909b..2a055bd0e0710 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 50fe41c49b0c8..99aea16a9aaba 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 6e9eb69585cbc..32754f2fd5524 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 2b51b313d34fc..9eae8b7366bea 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 6b4c50770b49f..a4f1c55463e75 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 9b7cde10da3d6..e21dbc93b7b47 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 1260af55fbff6..11e2dbc8f093f 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 bebb08e6dd5e3..1be7b68b70be2 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 a20d82de3c859..66849e017395b 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 2d05328f445df..2571f7c2e2935 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 266eecc35c84b..595d55c3c5a0d 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 f2759954a6845..9be9a681ee7c5 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 741c603e3aae4..ae0d143455d52 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 51d2d0b6db0ea..3e9e2f7870814 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 75bd775a36749..51e9a30a20262 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",
diff --git a/x-pack/plugins/index_management/tsconfig.json b/x-pack/plugins/index_management/tsconfig.json
index 81a96a77cef83..07dc4f5b08e1e 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",
diff --git a/x-pack/plugins/infra/tsconfig.json b/x-pack/plugins/infra/tsconfig.json
index 765af7974a2f1..b684e1866282f 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 a248bc9f337fe..25435342e71ad 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",
diff --git a/x-pack/plugins/lens/tsconfig.json b/x-pack/plugins/lens/tsconfig.json
index 134f0b4185b84..69ef52535dd9d 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 e6cb0101ee838..925049ca924cf 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 6118bcd81d342..2d744e57c1895 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 6f21cfdb0b191..6430248e46396 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/tsconfig.json b/x-pack/plugins/maps/tsconfig.json
index 1b74b7ee7566a..59af94bea0b68 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 30a547b18a831..3b8102b5205a8 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 6d01a853698b8..599dee1e56c0f 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 6b396b1c59642..b1135b867dc08 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 d0fb7e1a88dcf..b1999101f7c12 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 5c7528610a0b1..b253fad8be5b4 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 291b0f7c607cf..03c9e451f3b52 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 a869b21e06d4d..2519206b0fcdb 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 0bee6300cf0b2..b48933bc9f1ec 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 88e8d343f4700..4f252743ed078 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 9b994d1710ffc..bf589c62713d6 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 a1efe4c9cf2dd..e1ad141f1c702 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 d00156ad1277c..5c37481f982d9 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 f8ac3a61f7812..57cd882422b39 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 6c3fd1851a8cb..4ace497dbd5ad 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 270d877a362a6..bd8d9aa058bc3 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 39beda02977e1..d8ab4205f3dbe 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",
diff --git a/x-pack/plugins/spaces/tsconfig.json b/x-pack/plugins/spaces/tsconfig.json
index 95fbecaa90936..4c67cbe8912bd 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 c83935945c67b..97eb9a9a05b86 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/tsconfig.json b/x-pack/plugins/task_manager/tsconfig.json
index a72b678da1f7c..95a098e54619e 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 476f5926f757a..80488bd74617d 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 2717f92c7a4df..30da887cc1c43 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 8202449b22298..b7a63d7043f49 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 39318770126e5..1513669cdc1ad 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 0d65c8ddd8fed..08e45bebf125b 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/tsconfig.json b/x-pack/plugins/uptime/tsconfig.json
index 531ee2ecd8d2b..ca0fd17dea95a 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",
diff --git a/x-pack/plugins/watcher/tsconfig.json b/x-pack/plugins/watcher/tsconfig.json
index e8dabe8cd40a9..41bcb015d2d94 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 3bfc78b72cb3e..fdac21a391313 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",

From 500bb422355a2f8725b2cf0b241f927620ad99ec Mon Sep 17 00:00:00 2001
From: restrry <restrry@gmail.com>
Date: Fri, 26 Mar 2021 17:13:45 +0100
Subject: [PATCH 03/18] compile test files in the high-level tsconfig.json

---
 tsconfig.json | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/tsconfig.json b/tsconfig.json
index 18647153acb0a..61c6b631090b4 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -19,6 +19,68 @@
     "x-pack/plugins/cases/**/*",
     "x-pack/plugins/lists/**/*",
     "x-pack/plugins/security_solution/**/*",
+
+    // 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/**/integration_tests/*",
+    "x-pack/plugins/**/tests/*",
+    "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/**/*/test_helpers.tsx",
+    // apm uses non-standard file casing
+    "x-pack/plugins/**/*/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/**/*"

From 70f6c22e5bce4f35cf3970170a65aa3650830051 Mon Sep 17 00:00:00 2001
From: Mikhail Shustov <restrry@gmail.com>
Date: Sat, 27 Mar 2021 11:11:42 +0100
Subject: [PATCH 04/18] fix TS error in maps plugin

---
 .../plugins/maps/public/components/validated_number_input.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 cd525cf1ee2c9..942f31074000f 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';
 

From 34ca2d6217f6d1e1f835fb88cba2d8b5623677df Mon Sep 17 00:00:00 2001
From: Mikhail Shustov <restrry@gmail.com>
Date: Sat, 27 Mar 2021 11:12:05 +0100
Subject: [PATCH 05/18] fix TS error in infra plugin

---
 .../server/lib/infra_ml/queries/metrics_hosts_anomalies.ts      | 2 +-
 .../infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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 ab50986c3b3d5..b9bfcd302fb83 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 8fb8df5eef3d7..8dadcfe87c6f9 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,

From e3764cfbbc9ea4b0692f3c352b584ed6a15b93d3 Mon Sep 17 00:00:00 2001
From: Mikhail Shustov <restrry@gmail.com>
Date: Sat, 27 Mar 2021 11:13:49 +0100
Subject: [PATCH 06/18] exclude mote test and test until folders

---
 tsconfig.json         | 14 ++++++++++----
 tsconfig.project.json | 17 +++++++++++++++--
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/tsconfig.json b/tsconfig.json
index 61c6b631090b4..3ca9585110821 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -48,8 +48,10 @@
     // tests
     "x-pack/plugins/**/*.test.ts",
     "x-pack/plugins/**/*.test.tsx",
-    "x-pack/plugins/**/integration_tests/*",
+    "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__/*",
@@ -72,9 +74,13 @@
     "x-pack/plugins/**/*/test_utils.ts",
     "x-pack/plugins/**/*/test_helper.tsx",
     "x-pack/plugins/**/*/test_helpers.ts",
-    "x-pack/plugins/**/*/test_helpers.tsx",
-    // apm uses non-standard file casing
-    "x-pack/plugins/**/*/testHelpers.tsx",
+    "x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/test_data.tsx",
+    "x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/components/analytics_tables/shared_columns_tests.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",
diff --git a/tsconfig.project.json b/tsconfig.project.json
index 78cbd1c29ab9a..79b1acb17ab10 100644
--- a/tsconfig.project.json
+++ b/tsconfig.project.json
@@ -11,7 +11,9 @@
     "**/*.test.ts",
     "**/*.test.tsx",
     "**/integration_tests/*",
+    "**/test/*",
     "**/tests/*",
+    "**/tests_client_integration/*",
     "**/__fixtures__/*",
     "**/__stories__/*",
     "**/__jest__/**",
@@ -34,8 +36,19 @@
     "**/*/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",
+    // x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/components/analytics_tables/shared_columns_tests.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",
-    // apm uses non-standard file casing
+    // x-pack/plugins/apm/public/utils/testHelpers.tsx
     "**/*/testHelpers.tsx",
 
     // stubs
@@ -46,6 +59,6 @@
   ],
   "types": [
     "node",
-    "flot",
+    "flot"
   ]
 }

From 7fdd474b61dff90867d39c41a9ea6361ee1f4271 Mon Sep 17 00:00:00 2001
From: restrry <restrry@gmail.com>
Date: Sat, 27 Mar 2021 11:15:23 +0100
Subject: [PATCH 07/18] uptime. do not import test code within prod code

---
 .../public/components/certificates/cert_monitors.test.tsx   | 2 +-
 .../public/components/certificates/cert_search.test.tsx     | 2 +-
 .../public/components/certificates/cert_status.test.tsx     | 2 +-
 .../components/certificates/certificates_list.test.tsx      | 2 +-
 .../public/components/certificates/fingerprint_col.test.tsx | 2 +-
 .../components/common/charts/duration_charts.test.tsx       | 2 +-
 .../components/common/charts/monitor_bar_series.test.tsx    | 3 ++-
 .../public/components/common/header/page_header.test.tsx    | 2 +-
 .../uptime/public/components/common/monitor_tags.test.tsx   | 2 +-
 .../public/components/common/uptime_date_picker.test.tsx    | 4 ++--
 .../public/components/monitor/ml/ml_integerations.test.tsx  | 2 +-
 .../public/components/monitor/ml/ml_manage_job.test.tsx     | 2 +-
 .../public/components/monitor/monitor_charts.test.tsx       | 2 +-
 .../uptime/public/components/monitor/monitor_title.test.tsx | 2 +-
 .../monitor/status_details/monitor_status.bar.test.tsx      | 2 +-
 .../monitor/status_details/ssl_certificate.test.tsx         | 6 +++++-
 .../components/overview/empty_state/empty_state.test.tsx    | 2 +-
 .../overview/monitor_list/columns/enable_alert.test.tsx     | 2 +-
 .../overview/monitor_list/filter_status_button.test.tsx     | 3 ++-
 .../components/overview/monitor_list/monitor_list.test.tsx  | 2 +-
 .../monitor_list_drawer/monitor_list_drawer.test.tsx        | 2 +-
 .../components/overview/monitor_list/status_filter.test.tsx | 4 ++--
 .../public/components/settings/certificate_form.test.tsx    | 2 +-
 .../uptime/public/components/settings/indices_form.test.tsx | 2 +-
 x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx | 2 +-
 x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx  | 3 ++-
 x-pack/plugins/uptime/public/lib/index.ts                   | 1 -
 x-pack/plugins/uptime/public/pages/certificates.test.tsx    | 2 +-
 x-pack/plugins/uptime/public/pages/monitor.test.tsx         | 2 +-
 x-pack/plugins/uptime/public/pages/not_found.test.tsx       | 2 +-
 x-pack/plugins/uptime/public/pages/overview.test.tsx        | 2 +-
 x-pack/plugins/uptime/tsconfig.json                         | 1 -
 32 files changed, 39 insertions(+), 34 deletions(-)

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 5dfc11837b72d..719c90574b088 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 a991634de22a6..a0166fc573754 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 e331a6e5c34fe..999d76f690867 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 ec6a5d91a67c3..8ae0cdb791d9b 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 1affd1f990f90..550b7f75623f0 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 d7ae92a0e7654..72b1145a9f34e 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 792b357b3baba..ca8debb82d1af 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';
 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 6e04648a817f0..bede71b8ba03d 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 fdb5498969d39..63465aefcdd43 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 4bfe7de33cba5..b9a0f1fe2d411 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';
 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 f29be50633fab..16d96148af340 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 15a537a49ccf3..6bff0b61d7349 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 3f107581c1eea..a1be391833bc3 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 dabc0021898eb..682be99b9b418 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 af3c47b9caf30..ba0853b5b1b60 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 03ce292e63621..0cb7ff7168404 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 a617ba0db1eb3..c751e6a0c24fa 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 a325edc243129..a4e7f10d97bfc 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 4d0e82dc8a296..ff0a81747c556 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';
 
 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 39f9b20624b63..f7a2ad9a536bd 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 d044ad4e6a3a2..39c6d6bd9215d 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 bbc4e13c9eca2..255d62ee66e0c 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';
 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 84c9923bfc419..051c4166d0fdd 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 67ca142d8a8ea..fc2567ea98c45 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 6fc98fbaf1f5b..ce48b549d4db7 100644
--- a/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx
+++ b/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx
@@ -8,7 +8,7 @@
 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';
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 3ce112b1cb835..cb46e208d7d10 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';
+import { mountWithRouter } from '../lib/helper/enzyme_helpers';
 import { createMemoryHistory } from 'history';
 
 interface MockUrlParamsComponentProps {
diff --git a/x-pack/plugins/uptime/public/lib/index.ts b/x-pack/plugins/uptime/public/lib/index.ts
index 9added9af6592..1aa4af87cf4e5 100644
--- a/x-pack/plugins/uptime/public/lib/index.ts
+++ b/x-pack/plugins/uptime/public/lib/index.ts
@@ -6,4 +6,3 @@
  */
 
 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 ff5f1afcaa290..1218a1882b3bf 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 80fcfcc271964..2664f73d26075 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 8d5b20e45303d..cc9ea1a62cd0f 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 cfc140e6b22a3..b4949a84a6e36 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 ca0fd17dea95a..0b98204001753 100644
--- a/x-pack/plugins/uptime/tsconfig.json
+++ b/x-pack/plugins/uptime/tsconfig.json
@@ -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": [

From 9482cf4f117423d5155e3f0bec6b01bf7acef75f Mon Sep 17 00:00:00 2001
From: restrry <restrry@gmail.com>
Date: Sat, 27 Mar 2021 11:15:52 +0100
Subject: [PATCH 08/18] expressions. do not import test code within prod code

---
 src/plugins/expressions/common/util/index.ts | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/plugins/expressions/common/util/index.ts b/src/plugins/expressions/common/util/index.ts
index 470dfc3c2d436..5f83d962d5aea 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';

From c92c3ce5d6464cd00e7f827e37fbd0fbf54130fb Mon Sep 17 00:00:00 2001
From: restrry <restrry@gmail.com>
Date: Sun, 28 Mar 2021 15:05:36 +0200
Subject: [PATCH 09/18] data: export mocks from high level folder

---
 .../data/common/search/expressions/exists_filter.test.ts        | 2 +-
 .../data/common/search/expressions/kibana_filter.test.ts        | 2 +-
 .../data/common/search/expressions/phrase_filter.test.ts        | 2 +-
 src/plugins/data/common/search/expressions/range_filter.test.ts | 2 +-
 src/plugins/expressions/common/mocks.ts                         | 2 ++
 5 files changed, 6 insertions(+), 4 deletions(-)

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 e3b53b2281398..60e8a9c7a09ce 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 ac8ae55492cc0..56a9e1ce660cd 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 39bd907513a0d..90e471e166f5e 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 92670f8a044ba..129e6bd82e16a 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/expressions/common/mocks.ts b/src/plugins/expressions/common/mocks.ts
index eaeebd8e53492..20bdbca07f008 100644
--- a/src/plugins/expressions/common/mocks.ts
+++ b/src/plugins/expressions/common/mocks.ts
@@ -34,3 +34,5 @@ export const createMockExecutionContext = <ExtraContext extends object = object>
     ...extraContext,
   };
 };
+
+export { createMockContext } from './util/test_utils';

From a7ab3c5c48447a2a957dbfcbad7127591166af85 Mon Sep 17 00:00:00 2001
From: restrry <restrry@gmail.com>
Date: Sun, 28 Mar 2021 17:09:31 +0200
Subject: [PATCH 10/18] task_manager: comply with es client typings

---
 .../task_manager/server/monitoring/workload_statistics.ts      | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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 c79b310822c3e..70b4ba55c2393 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];

From cec2e04332bfa6c2aefddfdfa356f14704f345a4 Mon Sep 17 00:00:00 2001
From: restrry <restrry@gmail.com>
Date: Mon, 29 Mar 2021 10:25:07 +0200
Subject: [PATCH 11/18] infra: remove unused enzyme_helpers

---
 .../infra/public/utils/enzyme_helpers.tsx     | 87 -------------------
 1 file changed, 87 deletions(-)
 delete mode 100644 x-pack/plugins/infra/public/utils/enzyme_helpers.tsx

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 33fbbd03d790a..0000000000000
--- 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<Args, HookValue> {
-  /* 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 = <Args extends {}, HookValue extends any>(
-  body: (args: Args) => HookValue,
-  WrapperComponent?: React.ComponentType,
-  initialArgs: Args = {} as Args
-): ReactHookWrapper<Args, HookValue> => {
-  const hookValueCallback = jest.fn();
-  let component!: ReactWrapper;
-
-  const act: ReactHookWrapper<Args, HookValue>['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> = (args) =>
-    WrapperComponent ? (
-      <WrapperComponent>
-        <HookComponent {...args} />
-      </WrapperComponent>
-    ) : (
-      <HookComponent {...args} />
-    );
-
-  reactAct(() => {
-    component = mount(<TestComponent {...initialArgs} />);
-  });
-
-  return {
-    act,
-    component,
-    getLastHookValue,
-    hookValueCallback,
-  };
-};

From 46aeb89f3a81f34210c7acb9930d3bb6fc425f6a Mon Sep 17 00:00:00 2001
From: Mikhail Shustov <restrry@gmail.com>
Date: Mon, 29 Mar 2021 11:45:52 +0200
Subject: [PATCH 12/18] check_ts_project requires "include" key

---
 tsconfig.base.json    | 3 ++-
 tsconfig.project.json | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/tsconfig.base.json b/tsconfig.base.json
index 865806cffe5bb..1f6aec09e8e6f 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -54,5 +54,6 @@
       "jest-styled-components",
       "@testing-library/jest-dom"
     ]
-  }
+  },
+  "include": []
 }
diff --git a/tsconfig.project.json b/tsconfig.project.json
index 79b1acb17ab10..cd16753645551 100644
--- a/tsconfig.project.json
+++ b/tsconfig.project.json
@@ -57,6 +57,7 @@
     "**/*.stories.tsx",
     "**/*/_mock_handler_arguments.ts"
   ],
+  "include": [],
   "types": [
     "node",
     "flot"

From 4849b490bc1e591716d55f74aa61cee5fc436b84 Mon Sep 17 00:00:00 2001
From: Mikhail Shustov <restrry@gmail.com>
Date: Mon, 29 Mar 2021 12:15:58 +0200
Subject: [PATCH 13/18] ts_check should handle parent configs

---
 src/dev/typescript/project.ts | 37 ++++++++++++++++++++++++++++++-----
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/src/dev/typescript/project.ts b/src/dev/typescript/project.ts
index 8d92284e49637..04a5de945619b 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;
   }
 }

From fc814d00498fa47bc13229c1e642229fb5ff814c Mon Sep 17 00:00:00 2001
From: Mikhail Shustov <restrry@gmail.com>
Date: Mon, 29 Mar 2021 12:16:28 +0200
Subject: [PATCH 14/18] all ts configs should extend base one

---
 packages/kbn-storybook/tsconfig.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/kbn-storybook/tsconfig.json b/packages/kbn-storybook/tsconfig.json
index 814a3963c9f49..b3b3e109bd8b1 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": {
     "declaration": true,
     "outDir": "target",

From dee62cc72a6ace932e645ecb3a7b49561ad1faa4 Mon Sep 17 00:00:00 2001
From: Mikhail Shustov <restrry@gmail.com>
Date: Mon, 29 Mar 2021 12:17:12 +0200
Subject: [PATCH 15/18] exclude test folders from plugins

---
 x-pack/plugins/index_lifecycle_management/tsconfig.json | 1 -
 x-pack/plugins/index_management/tsconfig.json           | 2 --
 x-pack/plugins/ingest_pipelines/tsconfig.json           | 1 -
 x-pack/plugins/snapshot_restore/tsconfig.json           | 2 --
 4 files changed, 6 deletions(-)

diff --git a/x-pack/plugins/index_lifecycle_management/tsconfig.json b/x-pack/plugins/index_lifecycle_management/tsconfig.json
index 51e9a30a20262..bf43817cbc407 100644
--- a/x-pack/plugins/index_lifecycle_management/tsconfig.json
+++ b/x-pack/plugins/index_lifecycle_management/tsconfig.json
@@ -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 07dc4f5b08e1e..0766839a230b9 100644
--- a/x-pack/plugins/index_management/tsconfig.json
+++ b/x-pack/plugins/index_management/tsconfig.json
@@ -8,11 +8,9 @@
     "declarationMap": true
   },
   "include": [
-    "__jest__/**/*",
     "common/**/*",
     "public/**/*",
     "server/**/*",
-    "test/**/*",
     "../../../typings/**/*",
   ],
   "references": [
diff --git a/x-pack/plugins/ingest_pipelines/tsconfig.json b/x-pack/plugins/ingest_pipelines/tsconfig.json
index 25435342e71ad..5917b94caf76b 100644
--- a/x-pack/plugins/ingest_pipelines/tsconfig.json
+++ b/x-pack/plugins/ingest_pipelines/tsconfig.json
@@ -11,7 +11,6 @@
     "common/**/*",
     "public/**/*",
     "server/**/*",
-    "__jest__/**/*",
     "../../../typings/**/*"
   ],
   "references": [
diff --git a/x-pack/plugins/snapshot_restore/tsconfig.json b/x-pack/plugins/snapshot_restore/tsconfig.json
index d8ab4205f3dbe..c496847e4dd9b 100644
--- a/x-pack/plugins/snapshot_restore/tsconfig.json
+++ b/x-pack/plugins/snapshot_restore/tsconfig.json
@@ -8,11 +8,9 @@
     "declarationMap": true
   },
   "include": [
-    "__jest__/**/*",
     "common/**/*",
     "public/**/*",
     "server/**/*",
-    "test/**/*",
     "../../../typings/**/*",
   ],
   "references": [

From 89912bf5839eb57ea409e76fbc9f9a881236cae5 Mon Sep 17 00:00:00 2001
From: Mikhail Shustov <restrry@gmail.com>
Date: Mon, 29 Mar 2021 12:17:34 +0200
Subject: [PATCH 16/18] update patterns to fix ts_check errors

---
 tsconfig.json         | 9 +++++++--
 tsconfig.project.json | 1 +
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tsconfig.json b/tsconfig.json
index 3ca9585110821..5f5d18e1c3cd3 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -20,6 +20,11 @@
     "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/*",
@@ -48,13 +53,13 @@
     // tests
     "x-pack/plugins/**/*.test.ts",
     "x-pack/plugins/**/*.test.tsx",
-    "x-pack/plugins/**/test/*",
+    "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__/*",
+    "x-pack/plugins/**/__jest__/**/*",
 
     // mocks
     "x-pack/plugins/**/__mocks__/*",
diff --git a/tsconfig.project.json b/tsconfig.project.json
index cd16753645551..758c021eff6a3 100644
--- a/tsconfig.project.json
+++ b/tsconfig.project.json
@@ -11,6 +11,7 @@
     "**/*.test.ts",
     "**/*.test.tsx",
     "**/integration_tests/*",
+    "**/test/**/*",
     "**/test/*",
     "**/tests/*",
     "**/tests_client_integration/*",

From d90fbe21bd95efdd5aeadda4bafa256151eda273 Mon Sep 17 00:00:00 2001
From: Mikhail Shustov <restrry@gmail.com>
Date: Tue, 30 Mar 2021 09:29:10 +0200
Subject: [PATCH 17/18] Apply suggestions from code review

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
---
 tsconfig.json         | 1 -
 tsconfig.project.json | 1 -
 2 files changed, 2 deletions(-)

diff --git a/tsconfig.json b/tsconfig.json
index 5f5d18e1c3cd3..14b373815584b 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -80,7 +80,6 @@
     "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/enterprise_search/public/applications/app_search/components/analytics/components/analytics_tables/shared_columns_tests.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",
diff --git a/tsconfig.project.json b/tsconfig.project.json
index 758c021eff6a3..174c3fdf0fd54 100644
--- a/tsconfig.project.json
+++ b/tsconfig.project.json
@@ -39,7 +39,6 @@
     "**/*/test_helpers.ts",
     // x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/test_data.tsx
     "**/*/test_data.tsx",
-    // x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/components/analytics_tables/shared_columns_tests.tsx
     "**/*/shared_columns_tests.tsx",
     // x-pack/plugins/uptime/server/lib/requests/helper.ts
     "**/*/requests/helper.ts",

From 04ca8da7758f18dcd72f8fd202192775840e2c6a Mon Sep 17 00:00:00 2001
From: restrry <restrry@gmail.com>
Date: Tue, 30 Mar 2021 10:23:58 +0200
Subject: [PATCH 18/18] uptime: MountWithReduxProvider to test helpers

---
 .../components/common/charts/monitor_bar_series.test.tsx  | 2 +-
 .../public/components/common/uptime_date_picker.test.tsx  | 2 +-
 .../overview/monitor_list/filter_status_button.test.tsx   | 2 +-
 .../overview/monitor_list/status_filter.test.tsx          | 2 +-
 .../plugins/uptime/public/hooks/use_breadcrumbs.test.tsx  | 3 ++-
 .../plugins/uptime/public/hooks/use_url_params.test.tsx   | 2 +-
 x-pack/plugins/uptime/public/lib/helper/index.ts          | 1 -
 x-pack/plugins/uptime/public/lib/index.ts                 | 8 --------
 8 files changed, 7 insertions(+), 15 deletions(-)
 delete mode 100644 x-pack/plugins/uptime/public/lib/index.ts

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 ca8debb82d1af..b11595eafae4f 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
@@ -8,7 +8,7 @@
 import React from 'react';
 import { MonitorBarSeries, MonitorBarSeriesProps } from './monitor_bar_series';
 import { renderWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers';
-import { MountWithReduxProvider } from '../../../lib';
+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/uptime_date_picker.test.tsx b/x-pack/plugins/uptime/public/components/common/uptime_date_picker.test.tsx
index b9a0f1fe2d411..d433e7fccd1b8 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
@@ -12,7 +12,7 @@ import {
   shallowWithRouter,
   mountWithRouterRedux,
 } from '../../lib/helper/enzyme_helpers';
-import { MountWithReduxProvider } from '../../lib';
+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/overview/monitor_list/filter_status_button.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/filter_status_button.test.tsx
index ff0a81747c556..c95e3cd61c5fd 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
@@ -8,7 +8,7 @@
 import React from 'react';
 import { FilterStatusButton, FilterStatusButtonProps } from './filter_status_button';
 import { renderWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers';
-import { MountWithReduxProvider } from '../../../lib';
+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/status_filter.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/status_filter.test.tsx
index 255d62ee66e0c..c2515ab55b126 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
@@ -11,7 +11,7 @@ import {
   renderWithRouter,
   shallowWithRouter,
 } from '../../../lib/helper/enzyme_helpers';
-import { MountWithReduxProvider } from '../../../lib';
+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/hooks/use_breadcrumbs.test.tsx b/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx
index ce48b549d4db7..7aeac9706af58 100644
--- a/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx
+++ b/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx
@@ -11,7 +11,8 @@ import { Route } from 'react-router-dom';
 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 cb46e208d7d10..31580ec22d48c 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,7 @@ import DateMath from '@elastic/datemath';
 import React, { useState, Fragment } from 'react';
 import { useUrlParams, UptimeUrlParamsHook } from './use_url_params';
 import { UptimeRefreshContext } from '../contexts';
-import { MountWithReduxProvider } from '../lib';
+import { MountWithReduxProvider } from '../lib/helper/helper_with_redux';
 import { mountWithRouter } from '../lib/helper/enzyme_helpers';
 import { createMemoryHistory } from 'history';
 
diff --git a/x-pack/plugins/uptime/public/lib/helper/index.ts b/x-pack/plugins/uptime/public/lib/helper/index.ts
index 2fce3cc0e54dc..6546b5f9ae6c4 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 1aa4af87cf4e5..0000000000000
--- a/x-pack/plugins/uptime/public/lib/index.ts
+++ /dev/null
@@ -1,8 +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';