Skip to content

[8.x] [Discover] Enable consistent-type-imports eslint rule (#212293)#214641

Merged
davismcphee merged 2 commits intoelastic:8.xfrom
davismcphee:backport/8.x/pr-212293
Mar 14, 2025
Merged

[8.x] [Discover] Enable consistent-type-imports eslint rule (#212293)#214641
davismcphee merged 2 commits intoelastic:8.xfrom
davismcphee:backport/8.x/pr-212293

Conversation

@davismcphee
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

## Summary

This PR enables the `@typescript-eslint/consistent-type-imports` eslint
rule for the Discover and saved search plugins. The benefits are that it
keeps things a bit cleaner, but more importantly ensures we aren't
accidentally importing more than types when all we need is types, which
can cause side effects.

I've added `backport:prev-major` and `backport:prev-minor` labels to the
PR because I figure backporting this is safe and would reduce merge
conflicts in future backports.

We should consider enabling this for all of our plugins and packages,
although that list might harder to maintain. I'm also curious if anyone
knows of other eslint rules we don't currently use that we'd benefit
from enabling.

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit c398102)

# Conflicts:
#	src/platform/plugins/shared/discover/public/application/context/context_app.tsx
#	src/platform/plugins/shared/discover/public/application/context/context_app_content.test.tsx
#	src/platform/plugins/shared/discover/public/application/context/context_app_content.tsx
#	src/platform/plugins/shared/discover/public/application/doc/components/doc.test.tsx
#	src/platform/plugins/shared/discover/public/application/main/components/layout/discover_layout.tsx
#	src/platform/plugins/shared/discover/public/application/main/components/loading_spinner/loading_spinner.tsx
#	src/platform/plugins/shared/discover/public/application/main/components/top_nav/on_save_search.tsx
#	src/platform/plugins/shared/discover/public/application/main/data_fetching/update_search_source.ts
#	src/platform/plugins/shared/discover/public/application/main/discover_main_route.test.tsx
#	src/platform/plugins/shared/discover/public/application/main/discover_main_route.tsx
#	src/platform/plugins/shared/discover/public/application/main/state_management/discover_state.ts
#	src/platform/plugins/shared/discover/public/application/main/state_management/utils/get_state_defaults.ts
#	src/platform/plugins/shared/discover/public/components/data_types/traces/summary_column.tsx
#	src/platform/plugins/shared/discover/public/context_awareness/profile_providers/observability/traces_data_source_profile/accessors/get_doc_viewer.tsx
#	src/platform/plugins/shared/discover/public/context_awareness/profile_providers/observability/traces_data_source_profile/profile.test.ts
#	src/platform/plugins/shared/discover/public/context_awareness/profile_providers/observability/traces_data_source_profile/profile.ts
#	src/platform/plugins/shared/discover/public/context_awareness/profile_providers/security/accessors/get_cell_renderer_accessor.test.tsx
#	src/platform/plugins/shared/discover/public/context_awareness/profile_providers/security/accessors/get_cell_renderer_accessor.tsx
#	src/platform/plugins/shared/discover/public/context_awareness/profile_providers/security/security_root_profile/profile.tsx
#	src/platform/plugins/shared/discover/public/embeddable/components/search_embeddable_grid_component.tsx
#	src/platform/plugins/shared/discover/public/plugin.tsx
#	src/platform/plugins/shared/discover/server/locator/columns_from_locator.ts
@davismcphee davismcphee added the backport This PR is a backport of another PR label Mar 14, 2025
@davismcphee davismcphee enabled auto-merge (squash) March 14, 2025 18:35
@davismcphee davismcphee self-assigned this Mar 14, 2025
@davismcphee davismcphee added the Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// label Mar 14, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 965.3KB 965.3KB -4.0B

cc @davismcphee

@davismcphee davismcphee merged commit a7d0bd8 into elastic:8.x Mar 14, 2025
9 checks passed
@davismcphee davismcphee deleted the backport/8.x/pr-212293 branch March 16, 2025 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t//

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants