Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Typescript compiler output disregarded as part of normal path build commands #1660

Open
CPTNB opened this issue Jun 2, 2022 · 10 comments
Labels
bug Something isn't working low priority OUI compliance Issues and PRs to maximize OUI usage and remove style and component hacks technical debt If not paid, jeapardizes long-term success and maintainability of the repository.

Comments

@CPTNB
Copy link
Contributor

CPTNB commented Jun 2, 2022

Standard build scripts run tsc but do not fail on or show typescript errors. This has led to a confusing relationship with typescript and allowed 700+ typescript compilation errors to creep into the project.

Expected:

You can demonstrate this by adding in the following erroneous code to a .ts file and trying any of the standard build commands (yarn start, yarn build, yarn osd bootstrap).

type X = true;
function returnX (): X { }

This should generate the error: error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.

Actual:

No error is surfaced in the console, and the build commands proceed as if the code compiled correctly.

Research

It looks like we're effectively using typescript as a babel passthrough. There are a few scripts in src/dev/typescript that look for local tsconfig.json files and execute tsc inside those directories. I spent some time fiddling with these scripts yesterday and got to the point where I could run tsc against a new plugin with only 9 errors not originating in the new plugin, which feels much more tractable.

I did that by creating a local tsconfig.json inside the plugin and running:

node scripts/type_check.js --skip-lib-check --project src/plugins/wizard/tsconfig.json 

It's not totally 💯 though since I did have to hard-code my baseUrl. More research needs to be done to see how we can run the typescript compiler targeted at plugins in an automated way.

Ideal State

I came into the project with the assumption that if I wrote incorrect typescript the project wouldn't build and the CI system would reject my changes. I think that's a very reasonable assumption, and we should try to meet it.

Suggested path forward

Since we have quite a few errors it's probably not tractable to fix them all to get back to a completely healthy state. Also, there may be other prohibitive factors that led previous maintainers to opt out of type checking.

I think we can quickly get to a place where we can opt plugins into type checking via config, then we can incrementally reintroduce type checking.

Another path would be to mark all errors today as known and prevent PRs from adding errors. This is probably cleaner in aggregate but I imagine it'd take more code to integrate into builds. It might be as easy as (pseudocode):

const tsc = require('typescript');
const allowedErrors = new Set([908127128903, 09812309180923, 109238091823, ...]);
const { errors } = tsc.runOnTheProject();
const newErrors = errors
  .filter(error => !allowedErrors.has(anErrorHashFunction(error)));
if (newErrors.length > 0) {
  newErrors.forEach(e => console.log(e));
  process.exit(1);
}
@CPTNB CPTNB added bug Something isn't working untriaged labels Jun 2, 2022
@ashwin-pc
Copy link
Member

I wonder if we can add this to our coverage reporter and track it there? hat way we can make sure that our errors is steadily reducing instead of looking for specific error codes

@CPTNB
Copy link
Contributor Author

CPTNB commented Jun 2, 2022

If you flatten this into a numeric metric you can't distinguish new vs old errors. An advantage of hitting tare on the scale and saying "today we have '0' errors" is we get to act like typescript is a crisp boolean thing going forward. We could do both and try to push the accepted errors to 0 over time...

@joshuarrrr
Copy link
Member

Could we use betterer to help us both prevent regressions and make incremental progress? https://dev.to/phenomnominal/stricter-typescript-compilation-with-betterer-dp7

I know it can help with migrating to stricter typescript configurations, but I think it could also work for this use case.

@kavilla kavilla added technical debt If not paid, jeapardizes long-term success and maintainability of the repository. and removed untriaged labels Jun 14, 2022
@kavilla
Copy link
Member

kavilla commented Jun 14, 2022

[Triage]: add this in the mean time: #1745

@tmarkley
Copy link
Contributor

tmarkley commented Dec 2, 2022

I recently dove into this and noticed that a lot of type errors were introduced in new features such as #2334. This needs to be prioritized.

@tmarkley
Copy link
Contributor

tmarkley commented Dec 3, 2022

Current state:

$ tsc --noEmit
...
Found 517 errors in 260 files.

Errors  Files
     1  node_modules/@types/node/globals.d.ts:114
     1  node_modules/@types/styled-components/index.d.ts:119
     1  node_modules/react-use/lib/useGeolocation.d.ts:11
     3  node_modules/react-use/lib/usePermission.d.ts:2
     3  packages/osd-optimizer/src/common/bundle.ts:147
     2  packages/osd-optimizer/src/common/bundle_cache.ts:65
     1  packages/osd-optimizer/src/common/worker_config.ts:109
     1  packages/osd-optimizer/src/limits.ts:49
     2  packages/osd-optimizer/src/node/cache.ts:171
     1  packages/osd-optimizer/src/optimizer/cache_keys.ts:160
     1  packages/osd-optimizer/src/optimizer/optimizer_config.ts:68
     1  packages/osd-optimizer/src/run_optimizer.ts:58
     1  packages/osd-pm/src/commands/watch.ts:94
     1  packages/osd-pm/src/run.ts:85
     2  packages/osd-pm/src/utils/bootstrap_cache_file.ts:77
     2  packages/osd-pm/src/utils/child_process.ts:85
     2  packages/osd-pm/src/utils/fs.ts:52
     1  packages/osd-pm/src/utils/yarn_lock.ts:70
     1  packages/osd-test/src/functional_test_runner/cli.ts:113
     1  packages/osd-test/src/functional_test_runner/functional_test_runner.ts:170
     4  packages/osd-test/src/functional_test_runner/lib/docker_servers/docker_servers_service.ts:102
     2  packages/osd-test/src/functional_test_runner/lib/lifecycle_phase.ts:47
     2  packages/osd-test/src/functional_test_runner/lib/load_tracer.ts:72
     1  packages/osd-test/src/functional_test_runner/lib/providers/provider_collection.ts:71
     1  src/cli/cluster/cluster_manager.ts:268
     2  src/cli/serve/integration_tests/reload_logging_config.test.ts:136
     1  src/dev/build/lib/build.test.ts:41
     2  src/dev/build/lib/download.ts:49
     2  src/dev/build/lib/fs.ts:148
     1  src/dev/build/lib/runner.test.ts:75
     1  src/dev/build/lib/runner.ts:74
     1  src/dev/build/lib/scan_delete.ts:85
     2  src/dev/build/lib/watch_stdio_for_line.ts:83
     1  src/dev/build/tasks/nodejs/download_node_builds_task.test.ts:64
     1  src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts:73
     1  src/dev/build/tasks/os_packages/create_os_package_tasks.test.ts:31
     2  src/dev/build/tasks/os_packages/docker_generator/run.ts:97
     4  src/dev/build/tasks/patch_native_modules_task.test.ts:37
     5  src/dev/i18n/integrate_locale_files.test.ts:38
     2  src/dev/i18n/integrate_locale_files.ts:112
     6  src/dev/i18n/utils/verify_icu_message.ts:43
     1  src/dev/npm/installed_packages.ts:63
     2  src/dev/prs/github_api.ts:53
     1  src/dev/prs/pr.ts:46
     4  src/dev/prs/run_update_prs_cli.ts:86
     1  src/dev/run_check_published_api_changes.ts:209
     8  src/dev/run_i18n_check.ts:92
     7  src/dev/run_i18n_extract.ts:62
     7  src/dev/run_i18n_integrate.ts:93
     1  src/dev/typescript/build_refs.ts:43
     4  src/optimize/bundles_route/dynamic_asset_response.ts:54
     1  src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx:39
     1  src/plugins/advanced_settings/public/management_app/components/field/field.tsx:277
     1  src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx:35
     1  src/plugins/advanced_settings/public/management_app/components/search/search.test.tsx:34
     2  src/plugins/advanced_settings/public/management_app/components/search/search.tsx:114
     1  src/plugins/bfetch/public/batching/create_streaming_batched_function.test.ts:44
     1  src/plugins/bfetch/server/streaming/create_ndjson_stream.ts:50
     1  src/plugins/console/public/application/hooks/use_data_init/use_data_init.ts:73
     4  src/plugins/console/public/application/hooks/use_send_current_request_to_opensearch/use_send_current_request_to_opensearch.ts:74
     1  src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.ts:260
     2  src/plugins/console/server/routes/api/console/proxy/create_handler.ts:180
     1  src/plugins/console/server/routes/api/console/proxy/tests/mocks.ts:62
     1  src/plugins/dashboard/public/application/dashboard_empty_screen.test.tsx:34
     1  src/plugins/dashboard/public/application/dashboard_state_manager.ts:508
     2  src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.tsx:183
     1  src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx:31
     1  src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx:57
     1  src/plugins/dashboard/public/application/tests/dashboard_container.test.tsx:31
     2  src/plugins/dashboard/public/attribute_service/attribute_service.tsx:129
     2  src/plugins/dashboard/server/saved_objects/migrations_730.ts:53
     1  src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts:99
     1  src/plugins/data/common/index_patterns/index_patterns/index_patterns.test.ts:182
     4  src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts:274
     3  src/plugins/data/common/opensearch_query/kuery/ast/ast.ts:73
     1  src/plugins/data/common/search/search_source/mocks.ts:37
     1  src/plugins/data/common/search/search_source/parse_json.ts:41
     1  src/plugins/data/public/query/filter_manager/lib/generate_mapping_chain.test.ts:122
     1  src/plugins/data/public/query/filter_manager/lib/map_filter.test.ts:100
     1  src/plugins/data/public/search/expressions/opensearchdsl.test.ts:69
     1  src/plugins/data/public/ui/filter_bar/filter_item.tsx:308
     1  src/plugins/data/public/ui/query_string_input/query_string_input.tsx:198
     1  src/plugins/data/public/ui/search_bar/lib/use_saved_query.ts:76
     1  src/plugins/data/public/ui/search_bar/search_bar.tsx:299
     1  src/plugins/data/public/ui/shard_failure_modal/shard_failure_open_modal_button.test.tsx:37
     1  src/plugins/data/server/autocomplete/value_suggestions_route.ts:91
     1  src/plugins/data/server/dql_telemetry/route.ts:63
     1  src/plugins/data/server/index_patterns/fetcher/lib/opensearch_api.ts:31
     1  src/plugins/data/server/index_patterns/fetcher/lib/resolve_time_pattern.ts:34
     4  src/plugins/data/server/index_patterns/routes.ts:91
     1  src/plugins/data/server/search/routes/call_msearch.ts:91
     4  src/plugins/data/server/search/routes/msearch.ts:84
     7  src/plugins/data/server/search/routes/search.ts:82
     1  src/plugins/data_source/server/audit/logging_auditor.ts:10
     1  src/plugins/data_source/server/client/configure_client.ts:16
     1  src/plugins/data_source/server/data_source_service.ts:7
     3  src/plugins/data_source/server/legacy/configure_legacy_client.ts:26
    13  src/plugins/data_source/server/saved_objects/data_source_saved_objects_client_wrapper.ts:148
     1  src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx:59
     6  src/plugins/data_source_management/public/components/edit_data_source/components/edit_form/edit_data_source_form.test.tsx:168
     4  src/plugins/data_source_management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx:67
     1  src/plugins/data_source_management/public/plugin.ts:48
     1  src/plugins/dev_tools/public/plugin.ts:74
     1  src/plugins/discover/public/application/angular/context/components/action_bar/action_bar.test.tsx:34
     1  src/plugins/discover/public/application/angular/doc_table/components/pager/tool_bar_pager_buttons.test.tsx:34
     1  src/plugins/discover/public/application/angular/doc_table/components/table_header/table_header.test.tsx:34
     1  src/plugins/discover/public/application/components/context_error_message/context_error_message.test.tsx:37
     1  src/plugins/discover/public/application/components/doc/doc.test.tsx:36
     2  src/plugins/discover/public/application/components/doc/use_opensearch_doc_search.ts:102
     1  src/plugins/discover/public/application/components/doc_viewer/doc_viewer.test.tsx:34
     1  src/plugins/discover/public/application/components/hits_counter/hits_counter.test.tsx:35
     1  src/plugins/discover/public/application/components/loading_spinner/loading_spinner.test.tsx:35
     1  src/plugins/discover/public/application/components/sidebar/change_indexpattern.tsx:116
     1  src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx:34
     1  src/plugins/discover/public/application/components/sidebar/discover_sidebar.test.tsx:33
     1  src/plugins/discover/public/application/components/table/table.test.tsx:33
     1  src/plugins/discover/public/application/components/timechart_header/timechart_header.test.tsx:36
     1  src/plugins/discover/public/application/embeddable/search_embeddable.ts:330
     1  src/plugins/discover/public/application/embeddable/search_embeddable_factory.ts:124
     2  src/plugins/embeddable/public/lib/containers/container.ts:189
     1  src/plugins/embeddable/public/lib/embeddables/embeddable_root.test.tsx:35
     1  src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx:35
     1  src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx:44
     1  src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx:128
     1  src/plugins/embeddable/public/lib/state_transfer/types.ts:66
     1  src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory.tsx:70
     1  src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx:31
     2  src/plugins/embeddable/public/tests/helpers.ts:49
     1  src/plugins/expressions/common/ast/parse.ts:43
     1  src/plugins/expressions/common/execution/execution.ts:263
     4  src/plugins/expressions/common/execution/execution_contract.ts:50
     1  src/plugins/expressions/common/expression_types/expression_type.test.ts:58
     1  src/plugins/expressions/common/mocks.ts:40
     1  src/plugins/expressions/public/render.test.ts:146
     1  src/plugins/home/public/application/components/add_data/add_data.tsx:80
     1  src/plugins/home/public/application/components/manage_data/manage_data.tsx:86
     2  src/plugins/home/public/application/components/solutions_section/solutions_section.tsx:104
     1  src/plugins/home/server/plugin.ts:52
     1  src/plugins/home/server/routes/fetch_opensearch_hits_status.ts:66
     1  src/plugins/home/server/services/sample_data/lib/load_data.ts:77
     3  src/plugins/home/server/services/sample_data/routes/install.ts:147
     3  src/plugins/home/server/services/sample_data/routes/list.ts:79
     4  src/plugins/home/server/services/sample_data/routes/uninstall.ts:78
     2  src/plugins/home/server/services/sample_data/usage/usage.ts:59
     2  src/plugins/home/server/services/tutorials/tutorials_registry.test.ts:54
     1  src/plugins/home/server/services/tutorials/tutorials_registry.ts:39
     3  src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.tsx:88
     1  src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.tsx:117
     1  src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/step_time_field.tsx:85
     2  src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/create_index_pattern_wizard.tsx:89
     1  src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/ensure_minimum_time.test.ts:50
     1  src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/get_indices.ts:288
     1  src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/default/default.tsx:57
     1  src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx:76
     1  src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx:153
     1  src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.test.tsx:35
     1  src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx:33
     2  src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx:116
     1  src/plugins/index_pattern_management/public/components/test_utils.tsx:46
     2  src/plugins/index_pattern_management/public/mocks.ts:42
     4  src/plugins/index_pattern_management/server/routes/preview_scripted_field.ts:74
     5  src/plugins/index_pattern_management/server/routes/resolve_index.ts:32
     1  src/plugins/input_control_vis/public/components/editor/controls_tab.test.tsx:33
     1  src/plugins/input_control_vis/public/components/editor/list_control_editor.test.tsx:35
     1  src/plugins/input_control_vis/public/components/editor/range_control_editor.test.tsx:36
     1  src/plugins/input_control_vis/public/components/vis/input_control_vis.test.tsx:35
     1  src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx:113
     2  src/plugins/input_control_vis/public/control/list_control_factory.ts:179
     2  src/plugins/input_control_vis/public/control/range_control_factory.ts:114
     1  src/plugins/maps_legacy/public/plugin.ts:44
     2  src/plugins/opensearch_dashboards_legacy/public/angular/angular_config.tsx:284
     1  src/plugins/opensearch_dashboards_legacy/public/angular/subscribe_with_scope.ts:52
     1  src/plugins/opensearch_dashboards_overview/public/components/add_data/add_data.tsx:93
     1  src/plugins/opensearch_dashboards_overview/public/components/manage_data/manage_data.tsx:97
     3  src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/rollups.ts:108
     2  src/plugins/opensearch_ui_shared/public/request/send_request.ts:60
     4  src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/components/use_field.tsx:39
     3  src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts:49
     1  src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/hooks/use_form.ts:201
     5  src/plugins/region_map/public/components/map_choice_options.test.tsx:9
     6  src/plugins/region_map/public/components/map_choice_options.tsx:7
     9  src/plugins/region_map/public/components/region_map_options.test.tsx:8
     5  src/plugins/region_map/public/components/style_options.test.tsx:8
     1  src/plugins/region_map/public/components/style_options.tsx:52
     2  src/plugins/saved_objects/public/saved_object/helpers/apply_opensearch_resp.ts:105
     1  src/plugins/saved_objects/public/saved_object/helpers/save_saved_object.ts:135
     2  src/plugins/saved_objects_management/public/lib/get_relationships.ts:52
     2  src/plugins/saved_objects_management/public/lib/parse_query.test.ts:37
     1  src/plugins/saved_objects_management/public/lib/parse_query.ts:61
     8  src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts:75
     1  src/plugins/saved_objects_management/public/management_section/objects_table/components/overwrite_modal.test.tsx:34
     1  src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.tsx:98
     2  src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx:33
     3  src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx:64
     1  src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx:148
     6  src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx:184
     1  src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx:59
     2  src/plugins/saved_objects_management/public/mocks.ts:42
     1  src/plugins/saved_objects_management/public/services/index.ts:54
     3  src/plugins/saved_objects_management/public/services/namespace_service.ts:12
     1  src/plugins/saved_objects_management/server/routes/find.ts:87
    11  src/plugins/saved_objects_management/server/routes/scroll_count.ts:62
     1  src/plugins/share/public/components/url_panel_content.tsx:325
     2  src/plugins/share/server/routes/lib/short_url_lookup.ts:60
     1  src/plugins/telemetry/public/plugin.ts:244
     2  src/plugins/telemetry/public/services/telemetry_service.ts:170
     1  src/plugins/telemetry/server/collectors/usage/telemetry_usage_collector.ts:84
     1  src/plugins/telemetry/server/routes/telemetry_opt_in.ts:127
     1  src/plugins/telemetry/server/routes/telemetry_usage_stats.ts:85
     8  src/plugins/telemetry/server/telemetry_collection/get_data_telemetry/get_data_telemetry.ts:286
     2  src/plugins/telemetry/server/telemetry_collection/get_local_license.ts:37
     1  src/plugins/telemetry/server/telemetry_collection/get_local_stats.test.ts:60
     1  src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts:74
     2  src/plugins/telemetry/server/telemetry_collection/get_opensearch_dashboards.ts:70
     1  src/plugins/telemetry/server/telemetry_repository/get_telemetry_saved_object.test.ts:65
     2  src/plugins/telemetry/server/telemetry_repository/get_telemetry_saved_object.ts:45
     1  src/plugins/telemetry/server/telemetry_repository/update_telemetry_saved_object.ts:41
     1  src/plugins/telemetry_management_section/public/components/opt_in_example_flyout.tsx:83
     1  src/plugins/telemetry_management_section/public/components/opt_in_security_example_flyout.tsx:77
     1  src/plugins/telemetry_management_section/public/components/telemetry_management_section.tsx:120
     1  src/plugins/timeline/public/panels/timechart/schema.ts:406
     5  src/plugins/ui_actions/public/actions/action_internal.ts:46
     1  src/plugins/ui_actions/public/service/ui_actions_execution_service.ts:77
     1  src/plugins/usage_collection/server/collector/collector_set.ts:153
     1  src/plugins/vis_builder/public/application/components/data_tab/field.tsx:48
     1  src/plugins/vis_builder/public/application/components/data_tab/field_selector.test.tsx:30
     1  src/plugins/vis_builder/public/application/components/data_tab/use/use_prefers_reduced_motion.ts:17
     8  src/plugins/vis_builder/public/application/components/searchable_dropdown.tsx:27
     3  src/plugins/vis_builder/public/application/utils/breadcrumbs.ts:13
     5  src/plugins/vis_builder/public/application/utils/get_top_nav_config.tsx:154
     3  src/plugins/vis_builder/public/application/utils/use/use_can_save.ts:23
     1  src/plugins/vis_builder/public/application/utils/use/use_saved_vis_builder_vis.ts:43
     1  src/plugins/vis_builder/public/application/utils/vis_builder_state_validation.ts:12
     1  src/plugins/vis_builder/public/embeddable/disabled_embeddable.tsx:11
     2  src/plugins/vis_builder/public/plugin.ts:135
     9  src/plugins/vis_builder/public/saved_visualizations/transforms.test.ts:17
     4  src/plugins/vis_builder/public/visualizations/table/components/table_viz_options.tsx:6
     1  src/plugins/vis_default_editor/public/components/agg.tsx:299
     2  src/plugins/vis_default_editor/public/components/agg_group.test.tsx:164
     2  src/plugins/vis_default_editor/public/components/agg_group.tsx:89
     2  src/plugins/vis_default_editor/public/components/agg_params.tsx:231
     1  src/plugins/vis_default_editor/public/components/controls/components/number_list/utils.ts:52
     1  src/plugins/vis_default_editor/public/components/controls/percentiles.test.tsx:34
     3  src/plugins/vis_type_table_new/public/components/table_vis_grid_columns.tsx:6
     1  src/plugins/vis_type_timeline/public/components/timeline_expression_input_helpers.ts:169
     1  src/plugins/vis_type_timeline/public/components/timeline_vis_component.tsx:200
     4  src/plugins/vis_type_timeline/public/helpers/timeline_request_handler.ts:131
     4  src/plugins/vis_type_timeline/server/routes/run.ts:118
     1  src/plugins/vis_type_timeseries/public/application/components/color_picker.test.tsx:36
     2  src/plugins/vis_type_timeseries/server/routes/vis.ts:61
     1  src/plugins/vis_type_vega/public/components/vega_vis_editor.tsx:68
     5  src/plugins/vis_type_vega/public/vega_inspector/vega_adapter.ts:93
     1  src/plugins/vis_type_vega/server/plugin.ts:44
     2  src/plugins/vis_type_vislib/public/components/options/heatmap/labels_panel.tsx:50
     1  src/plugins/vis_type_vislib/public/components/options/metrics_axes/label_options.tsx:55
     1  src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts:108
     1  src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx:173
     1  src/plugins/visualize/public/application/utils/get_top_nav_config.tsx:170
     2  src/plugins/visualize/public/application/utils/use/use_saved_vis_instance.ts:153
     1  src/plugins/visualize/public/application/utils/use/use_visualize_app_state.test.ts:214

@tmarkley
Copy link
Contributor

tmarkley commented Dec 4, 2022

I'm going to attempt to fix as many of the current errors that I can and then create follow-up issues to address the remaining ones. I think that the best long-term approach here is to just fix the issues now and enforce type checks in the build moving forward. It seems like some of the recent new features and changes are introducing many errors.

tmarkley added a commit to tmarkley/OpenSearch-Dashboards that referenced this issue Dec 4, 2022
* Reduces number of errors from 517 across 260 files to 216 across 115
files (~58% reduction).
* The remaining type errors are documented in opensearch-project#1660.

Signed-off-by: Tommy Markley <[email protected]>
tmarkley added a commit to tmarkley/OpenSearch-Dashboards that referenced this issue Dec 4, 2022
* Reduces number of errors from 517 across 260 files to 216 across 115
files (~58% reduction).
* The remaining type errors are documented in opensearch-project#1660.

Signed-off-by: Tommy Markley <[email protected]>
@tmarkley
Copy link
Contributor

tmarkley commented Dec 4, 2022

After #3022:

$ tsc --noEmit
...
Found 216 errors in 115 files.
...

Telemetry

Are we going to remove this plugin?

src/plugins/telemetry/server/telemetry_collection/get_data_telemetry/get_data_telemetry.ts:286:18 - error TS2532: Object is possibly 'undefined'.

286         isECS: !!indexMappings[name]?.mappings?.properties.ecs?.properties.version?.type,
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/telemetry/server/telemetry_collection/get_data_telemetry/get_data_telemetry.ts:286:18 - error TS2532: Object is possibly 'undefined'.

286         isECS: !!indexMappings[name]?.mappings?.properties.ecs?.properties.version?.type,
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/telemetry/server/telemetry_collection/get_data_telemetry/get_data_telemetry.ts:291:11 - error TS2532: Object is possibly 'undefined'.

291           indexMappings[name]?.mappings?.properties.data_stream?.properties.dataset?.value,
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/telemetry/server/telemetry_collection/get_data_telemetry/get_data_telemetry.ts:291:11 - error TS2532: Object is possibly 'undefined'.

291           indexMappings[name]?.mappings?.properties.data_stream?.properties.dataset?.value,
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/telemetry/server/telemetry_collection/get_data_telemetry/get_data_telemetry.ts:291:86 - error TS2339: Property 'value' does not exist on type 'MappingProperty'.
  Property 'value' does not exist on type 'MappingBinaryProperty'.

291           indexMappings[name]?.mappings?.properties.data_stream?.properties.dataset?.value,
                                                                                         ~~~~~

src/plugins/telemetry/server/telemetry_collection/get_data_telemetry/get_data_telemetry.ts:293:11 - error TS2532: Object is possibly 'undefined'.

293           indexMappings[name]?.mappings?.properties.data_stream?.properties.type?.value,
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/telemetry/server/telemetry_collection/get_data_telemetry/get_data_telemetry.ts:293:11 - error TS2532: Object is possibly 'undefined'.

293           indexMappings[name]?.mappings?.properties.data_stream?.properties.type?.value,
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/telemetry/server/telemetry_collection/get_data_telemetry/get_data_telemetry.ts:293:83 - error TS2339: Property 'value' does not exist on type 'MappingProperty'.
  Property 'value' does not exist on type 'MappingBinaryProperty'.

293           indexMappings[name]?.mappings?.properties.data_stream?.properties.type?.value,
                                                                                      ~~~~~

src/plugins/telemetry/server/telemetry_collection/get_local_license.ts:37:43 - error TS2339: Property 'license' does not exist on type 'OpenSearchClient'.

37   const { body } = await opensearchClient.license.get({
                                             ~~~~~~~

src/plugins/telemetry/server/telemetry_collection/get_local_license.ts:63:33 - error TS18046: 'clusterManagerError' is of type 'unknown'.

63         if ([400, 404].includes(clusterManagerError.statusCode)) {
                                   ~~~~~~~~~~~~~~~~~~~

src/plugins/telemetry/server/telemetry_collection/get_local_stats.test.ts:60:7 - error TS2741: Property '_nodes' is missing in type '{ cluster_name: string; nodes: { some_node_id: { timestamp: number; since: number; rest_actions: { nodes_usage_action: number; create_index_action: number; document_get_action: number; search_action: number; nodes_info_action: number; }; aggregations: { ...; }; }; }; }' but required in type 'NodesUsageResponse'.

60       body: {
         ~~~~

  node_modules/@opensearch-project/opensearch/api/types.d.ts:8657:3
    8657   _nodes: NodeStatistics
           ~~~~~~
    '_nodes' is declared here.

src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts:74:3 - error TS2322: Type 'NodesUsageResponse' is not assignable to type 'NodesFeatureUsageResponse'.
  Types of property 'nodes' are incompatible.
    Type 'Record<string, NodesUsageNodeUsage>' is not assignable to type '{ [key: string]: NodeObj; }'.
      'string' index signatures are incompatible.
        Type 'NodesUsageNodeUsage' is not assignable to type 'NodeObj'.
          Types of property 'timestamp' are incompatible.
            Type 'EpochMillis' is not assignable to type 'number'.
              Type 'string' is not assignable to type 'number'.

74   return body;
     ~~~~~~~~~~~~

src/plugins/telemetry_management_section/public/components/telemetry_management_section.tsx:120:13 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(props: Props | Readonly<Props>): OptInExampleFlyout', gave the following error.
    Type '() => Promise<void>' is not assignable to type '() => Promise<any[]>'.
      Type 'Promise<void>' is not assignable to type 'Promise<any[]>'.
        Type 'void' is not assignable to type 'any[]'.
  Overload 2 of 2, '(props: Props, context: any): OptInExampleFlyout', gave the following error.
    Type '() => Promise<void>' is not assignable to type '() => Promise<any[]>'.

120             fetchExample={telemetryService.fetchExample}
                ~~~~~~~~~~~~

  src/plugins/telemetry_management_section/public/components/opt_in_example_flyout.tsx:51:3
    51   fetchExample: () => Promise<any[]>;
         ~~~~~~~~~~~~
    The expected type comes from property 'fetchExample' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<OptInExampleFlyout> & Readonly<Props> & Readonly<...>'
  src/plugins/telemetry_management_section/public/components/opt_in_example_flyout.tsx:51:3
    51   fetchExample: () => Promise<any[]>;
         ~~~~~~~~~~~~
    The expected type comes from property 'fetchExample' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<OptInExampleFlyout> & Readonly<Props> & Readonly<...>'

Errors not related to sub-issues

node_modules/@types/node/globals.d.ts:114:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'AbortSignal' must be of type '{ new (): AbortSignal; prototype: AbortSignal; abort(reason?: any): AbortSignal; timeout(milliseconds: number): AbortSignal; }', but here has type '{ new (): AbortSignal; prototype: AbortSignal; }'.

114 declare var AbortSignal: {
                ~~~~~~~~~~~

  ../../home/codespace/.nvm/versions/node/v14.20.0/lib/node_modules/typescript/lib/lib.dom.d.ts:2071:13
    2071 declare var AbortSignal: {
                     ~~~~~~~~~~~
    'AbortSignal' was also declared here.

node_modules/@types/styled-components/index.d.ts:119:68 - error TS2344: Type 'P' does not satisfy the constraint '{ theme?: T | undefined; }'.

119 export type ThemedGlobalStyledClassProps<P, T> = WithOptionalTheme<P, T> & {
                                                                       ~

  node_modules/@types/styled-components/index.d.ts:119:42
    119 export type ThemedGlobalStyledClassProps<P, T> = WithOptionalTheme<P, T> & {
                                                 ~
    This type parameter might need an `extends { theme?: T | undefined; }` constraint.

node_modules/react-use/lib/useGeolocation.d.ts:11:21 - error TS2304: Cannot find name 'PositionError'.

11     error?: Error | PositionError;
                       ~~~~~~~~~~~~~

node_modules/react-use/lib/usePermission.d.ts:2:47 - error TS2552: Cannot find name 'DevicePermissionDescriptor'. Did you mean 'PermissionDescriptor'?

2 declare const usePermission: (permissionDesc: DevicePermissionDescriptor | PermissionDescriptor | MidiPermissionDescriptor | PushPermissionDescriptor) => State;
                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/react-use/lib/usePermission.d.ts:2:99 - error TS2552: Cannot find name 'MidiPermissionDescriptor'. Did you mean 'PermissionDescriptor'?

2 declare const usePermission: (permissionDesc: DevicePermissionDescriptor | PermissionDescriptor | MidiPermissionDescriptor | PushPermissionDescriptor) => State;
                                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/react-use/lib/usePermission.d.ts:2:126 - error TS2552: Cannot find name 'PushPermissionDescriptor'. Did you mean 'PermissionDescriptor'?

2 declare const usePermission: (permissionDesc: DevicePermissionDescriptor | PermissionDescriptor | MidiPermissionDescriptor | PushPermissionDescriptor) => State;
                                                                                                                               ~~~~~~~~~~~~~~~~~~~~~~~~

packages/osd-test/src/functional_test_runner/lib/lifecycle_phase.ts:47:37 - error TS2729: Property 'options' is used before its initialization.

47   private readonly afterSubj = this.options.singular
                                       ~~~~~~~

  packages/osd-test/src/functional_test_runner/lib/lifecycle_phase.ts:53:5
    53     private readonly options: {
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    54       singular?: boolean;
       ~~~~~~~~~~~~~~~~~~~~~~~~~
    55     } = {}
       ~~~~~~~~~~
    'options' is declared here.

packages/osd-test/src/functional_test_runner/lib/lifecycle_phase.ts:90:13 - error TS2322: Type '{} | undefined' is not assignable to type 'Error | undefined'.
  Type '{}' is missing the following properties from type 'Error': name, message

90             error = _error || undefined;
               ~~~~~

src/cli/cluster/cluster_manager.ts:268:7 - error TS2322: Type 'Timeout' is not assignable to type 'number'.

268       clearTimer = setTimeout(() => {
          ~~~~~~~~~~

src/dev/build/lib/fs.ts:148:44 - error TS2339: Property 'filter' does not exist on type 'Promise<string[]> & void'.

148   const foldersToDelete = emptyFoldersList.filter((folderToDelete: string) => {
                                               ~~~~~~

src/dev/build/lib/scan_delete.ts:85:27 - error TS18046: 'stat' is of type 'unknown'.

85       mergeMap((stat) => (stat.isDirectory() ? getChildPath$(path) : Rx.EMPTY)),

src/dev/prs/github_api.ts:53:16 - error TS2729: Property 'accessToken' is used before its initialization.

53       ...(this.accessToken ? { Authorization: `token ${this.accessToken} ` } : {}),
                  ~~~~~~~~~~~

  src/dev/prs/github_api.ts:57:15
    57   constructor(private accessToken?: string) {}
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'accessToken' is declared here.

src/dev/prs/github_api.ts:53:61 - error TS2729: Property 'accessToken' is used before its initialization.

53       ...(this.accessToken ? { Authorization: `token ${this.accessToken} ` } : {}),
                                                               ~~~~~~~~~~~

  src/dev/prs/github_api.ts:57:15
    57   constructor(private accessToken?: string) {}
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'accessToken' is declared here.

src/dev/prs/pr.ts:46:44 - error TS2729: Property 'number' is used before its initialization.

46   public readonly remoteRef = `pull/${this.number}/head`;
                                              ~~~~~~

  src/dev/prs/pr.ts:49:5
    49     public readonly number: number,
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'number' is declared here.

src/optimize/bundles_route/dynamic_asset_response.ts:66:69 - error TS2554: Expected 0-1 arguments, but got 2.

66   const supportedEncodings = Accept.encodings(acceptEncodingHeader, ['br', 'gzip']);
                                                                       ~~~~~~~~~~~~~~

src/plugins/console/server/routes/api/console/proxy/tests/mocks.ts:62:5 - error TS2322: Type '{ OpenSearchLegacyConfigService: OpenSearchLegacyConfigService; specDefinitionService: SpecDefinitionsService; }' is not assignable to type '{ opensearchLegacyConfigService: OpenSearchLegacyConfigService; specDefinitionService: SpecDefinitionsService; }'.
  Object literal may only specify known properties, but 'OpenSearchLegacyConfigService' does not exist in type '{ opensearchLegacyConfigService: OpenSearchLegacyConfigService; specDefinitionService: SpecDefinitionsService; }'. Did you mean to write 'opensearchLegacyConfigService'?

62     OpenSearchLegacyConfigService: new OpenSearchLegacyConfigService(),
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/dashboard/public/application/dashboard_state_manager.ts:508:19 - error TS2769: No overload matches this call.
  Overload 1 of 4, '(target: {}, source: any): any', gave the following error.
    Argument of type 'SavedDashboardPanel730ToLatest | undefined' is not assignable to parameter of type '{}'.
      Type 'undefined' is not assignable to type '{}'.
  Overload 2 of 4, '(target: object, ...sources: any[]): any', gave the following error.
    Argument of type 'SavedDashboardPanel730ToLatest | undefined' is not assignable to parameter of type 'object'.
      Type 'undefined' is not assignable to type 'object'.

508     Object.assign(foundPanel, panelAttributes);
                      ~~~~~~~~~~


src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.tsx:303:7 - error TS2769: No overload matches this call.
  Overload 2 of 2, '(props: PropsWithChildren<Omit<{ size: { width: number; }; isViewMode: boolean; layout: Layout[]; onLayoutChange: () => void; children: Element[]; maximizedPanelId: string; useMargins: boolean; }, "size"> & WithSizeProps>, context?: any): ReactElement<...> | ... 1 more ... | null', gave the following error.
    Type '(layout: PanelLayout[]) => void' is not assignable to type '() => void'.
  Overload 2 of 2, '(props: PropsWithChildren<Omit<{ size: { width: number; }; isViewMode: boolean; layout: Layout[]; onLayoutChange: () => void; children: Element[]; maximizedPanelId: string; useMargins: boolean; }, "size"> & WithSizeProps>, context?: any): ReactElement<...> | ... 1 more ... | null', gave the following error.
    Type 'string | undefined' is not assignable to type 'string'.
      Type 'undefined' is not assignable to type 'string'.

303       <ResponsiveSizedGrid
          ~~~~~~~~~~~~~~~~~~~~
304         isViewMode={isViewMode}
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
308         useMargins={this.state.useMargins}
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
309       >
    ~~~~~~~

  src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.tsx:79:3
    79   onLayoutChange: () => void;
         ~~~~~~~~~~~~~~
    The expected type comes from property 'onLayoutChange' which is declared here on type 'IntrinsicAttributes & Omit<{ size: { width: number; }; isViewMode: boolean; layout: Layout[]; onLayoutChange: () => void; children: Element[]; maximizedPanelId: string; useMargins: boolean; }, "size"> & WithSizeProps & { ...; }'
  src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.tsx:81:3
    81   maximizedPanelId: string;
         ~~~~~~~~~~~~~~~~
    The expected type comes from property 'maximizedPanelId' which is declared here on type 'IntrinsicAttributes & Omit<{ size: { width: number; }; isViewMode: boolean; layout: Layout[]; onLayoutChange: () => void; children: Element[]; maximizedPanelId: string; useMargins: boolean; }, "size"> & WithSizeProps & { ...; }'

src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx:31:33 - error TS2306: File '/workspaces/OpenSearch-Dashboards/node_modules/@elastic/eui/lib/test/index.d.ts' is not a module.

src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts:99:42 - error TS2345: Argument of type 'true' is not assignable to parameter of type 'false'.

99   } = stubbedSavedObjectIndexPattern(id, true);
                                            ~~~~

src/plugins/data/server/search/routes/call_msearch.ts:91:11 - error TS2322: Type 'string' is not assignable to type '(MsearchHeader | MsearchBody)[]'.

91           body,
             ~~~~

src/plugins/discover/public/application/components/sidebar/change_indexpattern.tsx:116:11 - error TS2322: Type '{ hidden?: boolean | undefined; color?: string | undefined; size?: number | undefined; style?: React.CSSProperties | undefined; height?: string | number | undefined; translate?: "yes" | ... 1 more ... | undefined; ... 292 more ...; isPreFiltered?: boolean | undefined; }' is not assignable to type 'Partial<EuiSelectableSearchProps<{ label: string; key: string; value: string; checked: "on" | undefined; }>>'.
  Types of property 'options' are incompatible.
    Type '((DisambiguateSet<EuiSelectableGroupLabelOption<{}>, EuiSelectableLIOption<{}>> & CommonProps & { ...; } & HTMLAttributes<...>) | (DisambiguateSet<...> & ... 2 more ... & { ...; }))[] | undefined' is not assignable to type '((DisambiguateSet<EuiSelectableGroupLabelOption<{ label: string; key: string; value: string; checked: "on" | undefined; }>, EuiSelectableLIOption<{ label: string; key: string; value: string; checked: "on" | undefined; }>> & CommonProps & { ...; } & HTMLAttributes<...> & { ...; }) | (DisambiguateSet<...> & ... 3 more...'.
      Type '((DisambiguateSet<EuiSelectableGroupLabelOption<{}>, EuiSelectableLIOption<{}>> & CommonProps & { ...; } & HTMLAttributes<...>) | (DisambiguateSet<...> & ... 2 more ... & { ...; }))[]' is not assignable to type '((DisambiguateSet<EuiSelectableGroupLabelOption<{ label: string; key: string; value: string; checked: "on" | undefined; }>, EuiSelectableLIOption<{ label: string; key: string; value: string; checked: "on" | undefined; }>> & CommonProps & { ...; } & HTMLAttributes<...> & { ...; }) | (DisambiguateSet<...> & ... 3 more...'.
        Type '(DisambiguateSet<EuiSelectableGroupLabelOption<{}>, EuiSelectableLIOption<{}>> & CommonProps & { ...; } & HTMLAttributes<...>) | (DisambiguateSet<...> & ... 2 more ... & { ...; })' is not assignable to type '(DisambiguateSet<EuiSelectableGroupLabelOption<{ label: string; key: string; value: string; checked: "on" | undefined; }>, EuiSelectableLIOption<{ label: string; key: string; value: string; checked: "on" | undefined; }>> & CommonProps & { ...; } & HTMLAttributes<...> & { ...; }) | (DisambiguateSet<...> & ... 3 more ...'.
          Type 'DisambiguateSet<EuiSelectableGroupLabelOption<{}>, EuiSelectableLIOption<{}>> & CommonProps & { ...; } & HTMLAttributes<...>' is not assignable to type '(DisambiguateSet<EuiSelectableGroupLabelOption<{ label: string; key: string; value: string; checked: "on" | undefined; }>, EuiSelectableLIOption<{ label: string; key: string; value: string; checked: "on" | undefined; }>> & CommonProps & { ...; } & HTMLAttributes<...> & { ...; }) | (DisambiguateSet<...> & ... 3 more ...'.
            Type 'DisambiguateSet<EuiSelectableGroupLabelOption<{}>, EuiSelectableLIOption<{}>> & CommonProps & { ...; } & HTMLAttributes<...>' is not assignable to type 'DisambiguateSet<EuiSelectableGroupLabelOption<{ label: string; key: string; value: string; checked: "on" | undefined; }>, EuiSelectableLIOption<{ label: string; key: string; value: string; checked: "on" | undefined; }>> & CommonProps & { ...; } & HTMLAttributes<...> & { ...; }'.
              Property 'value' is missing in type 'DisambiguateSet<EuiSelectableGroupLabelOption<{}>, EuiSelectableLIOption<{}>> & CommonProps & { ...; } & HTMLAttributes<...>' but required in type '{ label: string; key: string; value: string; checked: "on" | undefined; }'.

116           searchProps={{
              ~~~~~~~~~~~

  src/plugins/discover/public/application/components/sidebar/change_indexpattern.tsx:106:13
    106             value: id,
                    ~~~~~~~~~
    'value' is declared here.
  node_modules/@elastic/eui/oui.d.ts:29179:6
    29179      searchProps?: Partial<EuiSelectableSearchProps<T>>;
               ~~~~~~~~~~~
    The expected type comes from property 'searchProps' which is declared here on type 'IntrinsicAttributes & (IntrinsicClassAttributes<EuiSelectable<{ label: string; key: string; value: string; checked: "on" | undefined; }>> & ((Pick<...> & ... 1 more ... & Partial<...>) | (Pick<...> & ... 1 more ... & Partial<...>)))'

src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx:128:22 - error TS2801: This condition will always return true since this 'Promise<boolean>' is always defined.

128         (factory) => factory.isEditable() && !factory.isContainerType && factory.canCreateNew()
                         ~~~~~~~~~~~~~~~~~~~~

  src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx:128:22
    128         (factory) => factory.isEditable() && !factory.isContainerType && factory.canCreateNew()
                             ~~~~~~~~~~~~~~~~~~~~
    Did you forget to use 'await'?

src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory.tsx:70:23 - error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'Partial<ContactCardEmbeddableInput> | PromiseLike<Partial<ContactCardEmbeddableInput>>'.

70               resolve(undefined);
                         ~~~~~~~~~

src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx:31:33 - error TS2306: File '/workspaces/OpenSearch-Dashboards/node_modules/@elastic/eui/lib/test/index.d.ts' is not a module.

31 import { findTestSubject } from '@elastic/eui/lib/test';
                                   ~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/expressions/common/execution/execution_contract.ts:50:74 - error TS2344: Type 'InspectorAdapters' does not satisfy the constraint 'Adapters'.

50     protected readonly execution: Execution<ExtraContext, Input, Output, InspectorAdapters>
                                                                            ~~~~~~~~~~~~~~~~~

  src/plugins/expressions/common/execution/execution_contract.ts:41:3
    41   InspectorAdapters = unknown
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    This type parameter might need an `extends Adapters` constraint.

src/plugins/expressions/common/expression_types/expression_type.test.ts:58:7 - error TS2322: Type 'void' is not assignable to type '"render"'.

58       type: name,
         ~~~~

  src/plugins/expressions/common/expression_types/types.ts:34:3
    34   type: Type;
         ~~~~
    The expected type comes from property 'type' which is declared here on type 'ExpressionValueRender<T>'

src/plugins/home/public/application/components/add_data/add_data.tsx:80:3 - error TS2322: Type 'Requireable<(InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[]>' is not assignable to type 'Validator<FeatureCatalogueEntry[]>'.
  Types of property '[nominalTypeHack]' are incompatible.
    Type '{ type: (InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined; } | undefined' is not assignable to type '{ type: FeatureCatalogueEntry[]; } | undefined'.
      Type '{ type: (InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined; }' is not assignable to type '{ type: FeatureCatalogueEntry[]; }'.
        Types of property 'type' are incompatible.
          Type '(InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined' is not assignable to type 'FeatureCatalogueEntry[]'.
            Type 'undefined' is not assignable to type 'FeatureCatalogueEntry[]'.

80   features: PropTypes.arrayOf(
     ~~~~~~~~

src/plugins/home/public/application/components/manage_data/manage_data.tsx:86:3 - error TS2322: Type 'Requireable<(InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[]>' is not assignable to type 'Validator<FeatureCatalogueEntry[]>'.
  Types of property '[nominalTypeHack]' are incompatible.
    Type '{ type: (InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined; } | undefined' is not assignable to type '{ type: FeatureCatalogueEntry[]; } | undefined'.
      Type '{ type: (InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined; }' is not assignable to type '{ type: FeatureCatalogueEntry[]; }'.
        Types of property 'type' are incompatible.
          Type '(InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined' is not assignable to type 'FeatureCatalogueEntry[]'.
            Type 'undefined' is not assignable to type 'FeatureCatalogueEntry[]'.

86   features: PropTypes.arrayOf(
     ~~~~~~~~

src/plugins/home/public/application/components/solutions_section/solutions_section.tsx:104:3 - error TS2322: Type 'Requireable<(InferProps<{ id: Validator<string>; title: Validator<string>; subtitle: Requireable<string>; description: Validator<string>; icon: Validator<string>; ... 4 more ...; solutionId: Requireable<...>; }> | null | undefined)[]>' is not assignable to type 'Validator<FeatureCatalogueEntry[]>'.
  Types of property '[nominalTypeHack]' are incompatible.
    Type '{ type: (InferProps<{ id: Validator<string>; title: Validator<string>; subtitle: Requireable<string>; description: Validator<string>; icon: Validator<...>; ... 4 more ...; solutionId: Requireable<...>; }> | null | undefined)[] | null | undefined; } | undefined' is not assignable to type '{ type: FeatureCatalogueEntry[]; } | undefined'.
      Type '{ type: (InferProps<{ id: Validator<string>; title: Validator<string>; subtitle: Requireable<string>; description: Validator<string>; icon: Validator<...>; ... 4 more ...; solutionId: Requireable<...>; }> | null | undefined)[] | null | undefined; }' is not assignable to type '{ type: FeatureCatalogueEntry[]; }'.
        Types of property 'type' are incompatible.
          Type '(InferProps<{ id: Validator<string>; title: Validator<string>; subtitle: Requireable<string>; description: Validator<string>; icon: Validator<string>; ... 4 more ...; solutionId: Requireable<...>; }> | null | undefined)[] | null | undefined' is not assignable to type 'FeatureCatalogueEntry[]'.
            Type 'undefined' is not assignable to type 'FeatureCatalogueEntry[]'.

104   directories: PropTypes.arrayOf(
      ~~~~~~~~~~~

src/plugins/home/public/application/components/solutions_section/solutions_section.tsx:118:3 - error TS2322: Type 'Requireable<(InferProps<{ id: Validator<string>; title: Validator<string>; subtitle: Validator<string>; description: Requireable<string>; appDescriptions: Validator<...>; icon: Validator<...>; path: Validator<...>; order: Requireable<...>; }> | null | undefined)[]>' is not assignable to type 'Validator<FeatureCatalogueSolution[]>'.
  Types of property '[nominalTypeHack]' are incompatible.
    Type '{ type: (InferProps<{ id: Validator<string>; title: Validator<string>; subtitle: Validator<string>; description: Requireable<string>; appDescriptions: Validator<...>; icon: Validator<...>; path: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined; } | undefined' is not assignable to type '{ type: FeatureCatalogueSolution[]; } | undefined'.
      Type '{ type: (InferProps<{ id: Validator<string>; title: Validator<string>; subtitle: Validator<string>; description: Requireable<string>; appDescriptions: Validator<...>; icon: Validator<...>; path: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined; }' is not assignable to type '{ type: FeatureCatalogueSolution[]; }'.
        Types of property 'type' are incompatible.
          Type '(InferProps<{ id: Validator<string>; title: Validator<string>; subtitle: Validator<string>; description: Requireable<string>; appDescriptions: Validator<...>; icon: Validator<...>; path: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined' is not assignable to type 'FeatureCatalogueSolution[]'.
            Type 'undefined' is not assignable to type 'FeatureCatalogueSolution[]'.

118   solutions: PropTypes.arrayOf(
      ~~~~~~~~~

src/plugins/home/server/plugin.ts:52:69 - error TS2729: Property 'initContext' is used before its initialization.

52   private readonly sampleDataRegistry = new SampleDataRegistry(this.initContext);
                                                                       ~~~~~~~~~~~

  src/plugins/home/server/plugin.ts:50:15
    50   constructor(private readonly initContext: PluginInitializerContext) {}
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'initContext' is declared here.

src/plugins/home/server/services/tutorials/tutorials_registry.test.ts:54:3 - error TS2322: Type '{ id: string; category: TutorialsCategory; name: string; isBeta: false; shortDescription: string; euiIconType: string; longDescription: string; completionTimeMinutes: number; ... 6 more ...; savedObjectsInstallMsg: string; }' is not assignable to type 'TutorialSchema'.
  Object literal may only specify known properties, and 'OpenSearchCloud' does not exist in type 'TutorialSchema'.

54   OpenSearchCloud: { instructionSets: [], params: [] },
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/home/server/services/tutorials/tutorials_registry.test.ts:76:3 - error TS2322: Type '{ id: string; category: TutorialsCategory; name: string; moduleName: string; isBeta: false; shortDescription: string; euiIconType: string; longDescription: string; completionTimeMinutes: number; ... 6 more ...; savedObjectsInstallMsg: string; }' is not assignable to type 'TutorialSchema'.
  Object literal may only specify known properties, and 'OpenSearchCloud' does not exist in type 'TutorialSchema'.

76   OpenSearchCloud: { instructionSets: [], params: [] },
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx:113:60 - error TS2339: Property 'type' does not exist on type 'never'.

113         throw new Error(`Unhandled control type ${control!.type}`);
                                                               ~~~~

src/plugins/maps_legacy/public/plugin.ts:44:8 - error TS7016: Could not find a declaration file for module './opensearch_dashboards_services'. '/workspaces/OpenSearch-Dashboards/src/plugins/maps_legacy/public/opensearch_dashboards_services.js' implicitly has an 'any' type.

44 } from './opensearch_dashboards_services';
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/opensearch_dashboards_overview/public/components/add_data/add_data.tsx:93:3 - error TS2322: Type 'Requireable<(InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[]>' is not assignable to type 'Validator<FeatureCatalogueEntry[]>'.
  Types of property '[nominalTypeHack]' are incompatible.
    Type '{ type: (InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined; } | undefined' is not assignable to type '{ type: FeatureCatalogueEntry[]; } | undefined'.
      Type '{ type: (InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined; }' is not assignable to type '{ type: FeatureCatalogueEntry[]; }'.
        Types of property 'type' are incompatible.
          Type '(InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined' is not assignable to type 'FeatureCatalogueEntry[]'.
            Type 'undefined' is not assignable to type 'FeatureCatalogueEntry[]'.

93   features: PropTypes.arrayOf(
     ~~~~~~~~

src/plugins/opensearch_dashboards_overview/public/components/manage_data/manage_data.tsx:97:3 - error TS2322: Type 'Requireable<(InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[]>' is not assignable to type 'Validator<FeatureCatalogueEntry[]>'.
  Types of property '[nominalTypeHack]' are incompatible.
    Type '{ type: (InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined; } | undefined' is not assignable to type '{ type: FeatureCatalogueEntry[]; } | undefined'.
      Type '{ type: (InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined; }' is not assignable to type '{ type: FeatureCatalogueEntry[]; }'.
        Types of property 'type' are incompatible.
          Type '(InferProps<{ id: Validator<string>; title: Validator<string>; description: Validator<string>; icon: Validator<string>; path: Validator<string>; showOnHomePage: Validator<...>; category: Validator<...>; order: Requireable<...>; }> | null | undefined)[] | null | undefined' is not assignable to type 'FeatureCatalogueEntry[]'.
            Type 'undefined' is not assignable to type 'FeatureCatalogueEntry[]'.

97   features: PropTypes.arrayOf(
     ~~~~~~~~

src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/components/use_field.tsx:39:27 - error TS2344: Type 'FormType' does not satisfy the constraint 'FormData'.

39   config?: FieldConfig<T, FormType, I>;
                             ~~~~~~~~

  src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/components/use_field.tsx:37:27
    37 export interface Props<T, FormType = FormData, I = T> {
                                 ~~~~~~~~~~~~~~~~~~~
    This type parameter might need an `extends FormData` constraint.

src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/components/use_field.tsx:62:31 - error TS2344: Type 'FormType' does not satisfy the constraint 'FormData'.

62   const form = useFormContext<FormType>();
                                 ~~~~~~~~

  src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/components/use_field.tsx:49:36
    49 function UseFieldComp<T = unknown, FormType = FormData, I = T>(props: Props<T, FormType, I>) {
                                          ~~~~~~~~~~~~~~~~~~~
    This type parameter might need an `extends FormData` constraint.

src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/components/use_field.tsx:66:37 - error TS2344: Type 'FormType' does not satisfy the constraint 'FormData'.

66   const fieldConfig: FieldConfig<T, FormType, I> & { initialValue?: T } =
                                       ~~~~~~~~

  src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/components/use_field.tsx:49:36
    49 function UseFieldComp<T = unknown, FormType = FormData, I = T>(props: Props<T, FormType, I>) {
                                          ~~~~~~~~~~~~~~~~~~~
    This type parameter might need an `extends FormData` constraint.

src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/components/use_field.tsx:71:37 - error TS2344: Type 'FormType' does not satisfy the constraint 'FormData'.

71         } as Partial<FieldConfig<T, FormType, I>>);
                                       ~~~~~~~~

  src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/components/use_field.tsx:49:36
    49 function UseFieldComp<T = unknown, FormType = FormData, I = T>(props: Props<T, FormType, I>) {
                                          ~~~~~~~~~~~~~~~~~~~
    This type parameter might need an `extends FormData` constraint.

src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts:49:18 - error TS2344: Type 'FormType' does not satisfy the constraint 'FormData'.

49   form: FormHook<FormType>,
                    ~~~~~~~~

  src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts:48:29
    48 export const useField = <T, FormType = FormData, I = T>(
                                   ~~~~~~~~~~~~~~~~~~~
    This type parameter might need an `extends FormData` constraint.

src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts:51:26 - error TS2344: Type 'FormType' does not satisfy the constraint 'FormData'.

51   config: FieldConfig<T, FormType, I> & InternalFieldConfig<T> = {},
                            ~~~~~~~~

  src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts:48:29
    48 export const useField = <T, FormType = FormData, I = T>(
                                   ~~~~~~~~~~~~~~~~~~~
    This type parameter might need an `extends FormData` constraint.

src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts:141:73 - error TS2345: Argument of type 'FormType' is not assignable to parameter of type 'FormData'.

141       return formatters.reduce((output, formatter) => formatter(output, formData), inputValue) as T;
                                                                            ~~~~~~~~

  src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts:48:29
    48 export const useField = <T, FormType = FormData, I = T>(
                                   ~~~~~~~~~~~~~~~~~~~
    This type parameter might need an `extends FormData` constraint.

src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/hooks/use_form.ts:201:9 - error TS2794: Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'?

201         resolve();
            ~~~~~~~~~

  ../../home/codespace/.nvm/versions/node/v14.20.0/lib/node_modules/typescript/lib/lib.es2015.promise.d.ts:33:34
    33     new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~
    An argument for 'value' was not provided.

src/plugins/vis_default_editor/public/components/agg_params.tsx:231:12 - error TS2322: Type '{ aggParam: AggParam; indexedFields: ComboBoxGroupedOptions<IndexPatternField>; paramEditor: ComponentType<AggParamEditorProps<unknown, AggParam>>; ... 12 more ...; onChangeParamsState: Dispatch<...>; }' is not assignable to type 'DefaultEditorAggParamProps<unknown>'.
  The types of 'state.data' are incompatible between these types.
    Type 'VisData | undefined' is not assignable to type 'VisData'.
      Type 'undefined' is not assignable to type 'VisData'.

231           <DefaultEditorAggParam
               ~~~~~~~~~~~~~~~~~~~~~

src/plugins/vis_default_editor/public/components/agg_params.tsx:261:18 - error TS2322: Type '{ aggParam: AggParam; indexedFields: ComboBoxGroupedOptions<IndexPatternField>; paramEditor: ComponentType<AggParamEditorProps<unknown, AggParam>>; ... 12 more ...; onChangeParamsState: Dispatch<...>; }' is not assignable to type 'DefaultEditorAggParamProps<unknown>'.
  Types of property 'state' are incompatible.
    Type 'Partial<EditorVisState>' is not assignable to type 'EditorVisState'.

261                 <DefaultEditorAggParam
                     ~~~~~~~~~~~~~~~~~~~~~

src/plugins/vis_type_timeseries/public/application/components/color_picker.test.tsx:36:33 - error TS2306: File '/workspaces/OpenSearch-Dashboards/node_modules/@elastic/eui/lib/test/index.d.ts' is not a module.

36 import { findTestSubject } from '@elastic/eui/lib/test';
                                   ~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/vis_type_vega/public/vega_inspector/vega_adapter.ts:93:41 - error TS2339: Property 'data' does not exist on type 'Runtime'.

93         return Object.keys(runtimeScope.data || []).reduce((acc: InspectDataSets[], key) => {
                                           ~~~~

src/plugins/vis_type_vega/public/vega_inspector/vega_adapter.ts:94:38 - error TS2339: Property 'data' does not exist on type 'Runtime'.

94           const value = runtimeScope.data[key].values.value;
                                        ~~~~

src/plugins/vis_type_vega/public/vega_inspector/vega_adapter.ts:117:39 - error TS2339: Property 'signals' does not exist on type 'Runtime'.

117           ...Object.keys(runtimeScope.signals).map((key: string) =>
                                          ~~~~~~~

src/plugins/vis_type_vega/public/vega_inspector/vega_adapter.ts:140:42 - error TS2339: Property 'signals' does not exist on type 'Runtime'.

140           data: Object.keys(runtimeScope.signals).map((key: string) =>
                                             ~~~~~~~

src/plugins/vis_type_vega/public/vega_inspector/vega_adapter.ts:144:55 - error TS2339: Property 'signals' does not exist on type 'Runtime'.

144                 [vegaAdapterValueLabel]: runtimeScope.signals[key].value,
                                                          ~~~~~~~

src/plugins/vis_type_vega/server/plugin.ts:44:5 - error TS2322: Type 'Observable<Readonly<{ opensearchDashboards: Readonly<{ readonly index: string; readonly autocompleteTerminateAfter: Readonly<{ clone: () => Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: argThresholdOpts | undefined): string; (argThresholds?: argThresholdOpts | undefined): string; }; ......' is not assignable to type 'ConfigObservable'.
  Property 'kibana' is missing in type 'Readonly<{ opensearchDashboards: Readonly<{ readonly index: string; readonly autocompleteTerminateAfter: Readonly<{ clone: () => Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: argThresholdOpts | undefined): string; (argThresholds?: argThresholdOpts | undefined): string; }; ... 27 more .....' but required in type '{ kibana: { index: string; }; }'.

44     this.config = initializerContext.config.legacy.globalConfig$;
       ~~~~~~~~~~~

  src/plugins/vis_type_vega/server/types.ts:35:45
    35 export type ConfigObservable = Observable<{ kibana: { index: string } }>;
                                                   ~~~~~~
    'kibana' is declared here.

src/plugins/vis_type_vislib/public/components/options/heatmap/labels_panel.tsx:50:24 - error TS2367: This comparison appears to be unintentional because the types 'Rotates | undefined' and '270' have no overlap.

50   const rotateLabels = valueAxis.labels.rotate === VERTICAL_ROTATION;
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/vis_type_vislib/public/components/options/heatmap/labels_panel.tsx:68:37 - error TS2345: Argument of type '0 | 270' is not assignable to parameter of type 'Rotates | undefined'.
  Type '270' is not assignable to type 'Rotates | undefined'.

68       setValueAxisLabels(paramName, value ? VERTICAL_ROTATION : 0),
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/vis_type_vislib/public/components/options/metrics_axes/label_options.tsx:55:31 - error TS2345: Argument of type 'number' is not assignable to parameter of type 'Rotates | undefined'.

55       setAxisLabel(paramName, Number(value));
                                 ~~~~~~~~~~~~~

tmarkley added a commit to tmarkley/OpenSearch-Dashboards that referenced this issue Dec 4, 2022
* Reduces number of errors from 517 across 260 files to 216 across 115
files (~58% reduction).
* The remaining type errors are documented in opensearch-project#1660.

Signed-off-by: Tommy Markley <[email protected]>
tmarkley added a commit to tmarkley/OpenSearch-Dashboards that referenced this issue Dec 8, 2022
* Reduces number of errors from 517 across 260 files to 216 across 115
files (~58% reduction).
* The remaining type errors are documented in opensearch-project#1660.

Signed-off-by: Tommy Markley <[email protected]>
tmarkley added a commit to tmarkley/OpenSearch-Dashboards that referenced this issue Dec 9, 2022
* Reduces number of errors from 517 across 260 files to 216 across 115
files (~58% reduction).
* The remaining type errors are documented in opensearch-project#1660.

Signed-off-by: Tommy Markley <[email protected]>
tmarkley added a commit to tmarkley/OpenSearch-Dashboards that referenced this issue Jan 24, 2023
* Reduces number of errors from 517 across 260 files to 216 across 115
files (~58% reduction).
* The remaining type errors are documented in opensearch-project#1660.

Signed-off-by: Tommy Markley <[email protected]>
tmarkley added a commit to tmarkley/OpenSearch-Dashboards that referenced this issue Feb 1, 2023
* Reduces number of errors from 517 across 260 files to 216 across 115
files (~58% reduction).
* The remaining type errors are documented in opensearch-project#1660.

Signed-off-by: Tommy Markley <[email protected]>
@joshuarrrr joshuarrrr added the OUI compliance Issues and PRs to maximize OUI usage and remove style and component hacks label Jun 1, 2023
@ashwin-pc
Copy link
Member

We have since added more type errors to our code. Here is an updated list:

Errors  Files
     1  node_modules/@opensearch-project/opensearch/lib/aws/index.d.ts:13
     2  node_modules/@types/dompurify/node_modules/@types/trusted-types/index.d.ts:14
     1  node_modules/@types/react/global.d.ts:153
     2  node_modules/ip-cidr/index.d.ts:1
     1  node_modules/react-use/lib/useGeolocation.d.ts:11
     3  node_modules/react-use/lib/usePermission.d.ts:2
     2  src/plugins/charts/public/services/colors/mapped_colors.ts:84
     1  src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx:59
     1  src/plugins/dashboard/public/attribute_service/attribute_service.tsx:172
     1  src/plugins/dashboard/public/plugin.tsx:427
     1  src/plugins/data/public/plugin.ts:140
     1  src/plugins/data/public/ui/search_bar/index.tsx:45
     1  src/plugins/data/server/index_patterns/fetcher/lib/opensearch_api.ts:31
     1  src/plugins/data/server/index_patterns/fetcher/lib/resolve_time_pattern.ts:34
     1  src/plugins/data/server/search/opensearch_search/opensearch_search_strategy.ts:78
     2  src/plugins/data/server/search/routes/call_msearch.ts:91
     1  src/plugins/data_explorer/public/utils/state_management/metadata_slice.ts:36
     1  src/plugins/data_source/server/audit/logging_auditor.ts:10
     1  src/plugins/data_source/server/client/client_config.ts:65
     1  src/plugins/data_source/server/client/configure_client_utils.ts:49
     3  src/plugins/data_source/server/legacy/configure_legacy_client.ts:9
    11  src/plugins/data_source/server/saved_objects/data_source_saved_objects_client_wrapper.ts:151
     1  src/plugins/data_source/server/util/endpoint_validator.ts:6
    30  src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx:76
     1  src/plugins/data_source_management/public/components/create_data_source_wizard/create_data_source_wizard.tsx:143
     3  src/plugins/data_source_management/public/components/data_source_aggregated_view/data_source_aggregated_view.tsx:82
     2  src/plugins/data_source_management/public/components/data_source_item/data_source_item.tsx:19
     4  src/plugins/data_source_management/public/components/data_source_menu/data_source_menu.tsx:118
     1  src/plugins/data_source_management/public/components/data_source_multi_selectable/data_source_filter_group.tsx:156
     2  src/plugins/data_source_management/public/components/data_source_multi_selectable/data_source_multi_selectable.tsx:95
     1  src/plugins/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx:292
     3  src/plugins/data_source_management/public/components/data_source_selector/data_source_selector.tsx:205
     1  src/plugins/data_source_management/public/components/data_source_selector/index.ts:6
     1  src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx:407
     1  src/plugins/data_source_management/public/components/data_source_view/data_source_view.tsx:200
    22  src/plugins/data_source_management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx:81
     1  src/plugins/data_source_management/public/components/edit_data_source/components/update_aws_credential_modal/update_aws_credential_modal.tsx:101
     1  src/plugins/data_source_management/public/components/edit_data_source/edit_data_source.tsx:191
     2  src/plugins/data_source_management/public/plugin.ts:56
     2  src/plugins/discover/public/application/components/data_grid/data_grid_table_columns.tsx:83
     1  src/plugins/discover/public/application/components/doc_viewer/doc_viewer_render_tab.tsx:32
     1  src/plugins/discover/public/application/components/doc_views/context/api/anchor.ts:59
     1  src/plugins/discover/public/application/components/doc_views/context/api/context.ts:31
     4  src/plugins/discover/public/application/components/doc_views/context/utils/use_context_state.ts:32
     2  src/plugins/discover/public/application/components/sidebar/lib/get_index_pattern_field_list.ts:31
     1  src/plugins/discover/public/application/utils/state_management/discover_slice.tsx:106
     1  src/plugins/discover/public/application/view_components/utils/use_index_pattern.ts:63
     1  src/plugins/discover/public/embeddable/search_embeddable_factory.tsx:97
     2  src/plugins/discover/public/migrate_state.ts:18
     1  src/plugins/embeddable/public/lib/containers/container.ts:189
     1  src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx:128
     1  src/plugins/embeddable/public/lib/panel/panel_header/panel_header.tsx:68
     1  src/plugins/embeddable/public/lib/state_transfer/types.ts:66
     3  src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.tsx:96
     1  src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.tsx:118
     1  src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_time_field/step_time_field.tsx:85
     2  src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/create_index_pattern_wizard.tsx:88
     1  src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/lib/get_indices.ts:288
     1  src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx:57
     1  src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx:72
     1  src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx:94
     1  src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx:58
     1  src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.tsx:45
     1  src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx:76
     1  src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx:153
     1  src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx:33
     3  src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx:115
     1  src/plugins/index_pattern_management/public/management_app/mount_management_section.tsx:72
     1  src/plugins/maps_legacy/public/plugin.ts:44
     2  src/plugins/saved_objects/public/finder/saved_object_finder.tsx:181
     2  src/plugins/saved_objects_management/public/lib/import_file.ts:51
     6  src/plugins/saved_objects_management/public/lib/in_app_url.ts:37
     1  src/plugins/saved_objects_management/public/lib/resolve_import_errors.ts:100
     2  src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx:147
     1  src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.tsx:109
     4  src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx:65
     2  src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx:999
     1  src/plugins/saved_objects_management/public/services/index.ts:54
     3  src/plugins/saved_objects_management/public/services/namespace_service.ts:12
     1  src/plugins/saved_objects_management/public/services/types/action.ts:31
     1  src/plugins/ui_actions/public/actions/action.ts:68
     6  src/plugins/ui_actions/public/actions/action_internal.ts:46
    10  src/plugins/ui_actions/public/context_menu/build_eui_context_menu_panels.tsx:209
     1  src/plugins/ui_actions/public/service/ui_actions_service.ts:166
     2  src/plugins/vis_augmenter/public/actions/saved_object_delete_action.ts:51
     1  src/plugins/vis_augmenter/public/view_events_flyout/actions/open_events_flyout_action.ts:7
     1  src/plugins/vis_augmenter/public/view_events_flyout/flyout_state.ts:14
     1  src/plugins/vis_builder/public/application/components/data_tab/field.tsx:48
     1  src/plugins/vis_builder/public/application/components/data_tab/secondary_panel.tsx:175
     1  src/plugins/vis_builder/public/application/components/data_tab/use/use_prefers_reduced_motion.ts:17
     8  src/plugins/vis_builder/public/application/components/searchable_dropdown.tsx:27
     3  src/plugins/vis_builder/public/application/utils/breadcrumbs.ts:13
     1  src/plugins/vis_builder/public/application/utils/get_persisted_agg_params.ts:18
     5  src/plugins/vis_builder/public/application/utils/get_top_nav_config.tsx:156
     1  src/plugins/vis_builder/public/application/utils/handle_vis_event.ts:15
     1  src/plugins/vis_builder/public/application/utils/state_management/metadata_slice.ts:50
     1  src/plugins/vis_builder/public/application/utils/state_management/visualization_slice.ts:46
     3  src/plugins/vis_builder/public/application/utils/use/use_can_save.ts:23
     1  src/plugins/vis_builder/public/embeddable/vis_builder_embeddable.tsx:84
     2  src/plugins/vis_builder/public/plugin.ts:198
     1  src/plugins/vis_builder/public/saved_visualizations/_saved_vis.ts:13
     1  src/plugins/vis_default_editor/public/components/agg.tsx:299
     2  src/plugins/vis_default_editor/public/components/agg_group.tsx:89
     2  src/plugins/vis_default_editor/public/components/agg_params.tsx:231
     1  src/plugins/vis_type_table/public/components/table_vis_component.tsx:88
     1  src/plugins/vis_type_table/public/utils/convert_to_formatted_data.ts:71
     1  src/plugins/vis_type_vega/public/data_model/vega_parser.ts:40
     5  src/plugins/vis_type_vega/public/vega_inspector/vega_adapter.ts:93
     1  src/plugins/vis_type_vislib/public/plugin.ts:121
     1  src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts:90
     3  src/plugins/visualizations/public/embeddable/visualize_embeddable.ts:545
     1  src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx:123
     1  src/plugins/visualize/public/actions/visualize_field_action.ts:54

@ashwin-pc
Copy link
Member

You can run yarn run build:types to see the type errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority OUI compliance Issues and PRs to maximize OUI usage and remove style and component hacks technical debt If not paid, jeapardizes long-term success and maintainability of the repository.
Projects
None yet
Development

No branches or pull requests

5 participants