Skip to content

[eslint] add rule for auto-fixing unused imports#131772

Merged
spalger merged 10 commits intoelastic:mainfrom
spalger:implement/eslint/no-unused-imports
May 11, 2022
Merged

[eslint] add rule for auto-fixing unused imports#131772
spalger merged 10 commits intoelastic:mainfrom
spalger:implement/eslint/no-unused-imports

Conversation

@spalger
Copy link
Copy Markdown
Contributor

@spalger spalger commented May 6, 2022

Fixes #107233

Adds an ESLint rule that removes unused imports in CI and in the precommit hook. When run in editors a warning is logged and a suggestion is provided, but auto-fix is disabled to prevent ESLint ripping out imports when code is temporary removed.

@spalger spalger added Team:Operations Kibana-Operations Team release_note:skip Skip the PR/issue when compiling release notes v8.3.0 labels May 6, 2022
@spalger spalger force-pushed the implement/eslint/no-unused-imports branch 3 times, most recently from 9066cab to 9aede39 Compare May 7, 2022 02:17
@spalger spalger force-pushed the implement/eslint/no-unused-imports branch from 9aede39 to 5401cbf Compare May 7, 2022 02:25
@spalger spalger marked this pull request as ready for review May 7, 2022 04:29
@spalger spalger requested a review from a team May 7, 2022 04:29
@spalger spalger requested review from a team as code owners May 7, 2022 04:29
@spalger spalger requested review from a team, ashokaditya and dasansol92 May 7, 2022 04:29
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

Copy link
Copy Markdown
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app services changes lgtm

Copy link
Copy Markdown
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ML edits LGTM

Copy link
Copy Markdown
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kibana-gis changes LGTM
code review

Copy link
Copy Markdown

@zizhouW zizhouW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session view changes LGTM! Thanks for doing it!

Copy link
Copy Markdown
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes lgtm, left two small comments about some comments that I think we can also remove

Copy link
Copy Markdown
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core changes LGTM

Copy link
Copy Markdown
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security Solution changes LGTM

Copy link
Copy Markdown
Member

@ashokaditya ashokaditya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security_solution changes are good to go.

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
@kbn/eslint-plugin-imports 0 1 +1
@kbn/i18n-react 5 4 -1
crossClusterReplication 8 7 -1
total -1

Total ESLint disabled count

id before after diff
@kbn/eslint-plugin-imports 0 1 +1
@kbn/i18n-react 5 4 -1
crossClusterReplication 10 9 -1
total -1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@spalger spalger enabled auto-merge (squash) May 11, 2022 14:30
Copy link
Copy Markdown
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presentation team changes LGTM! Lots of unused imports to be removed, thanks!

Copy link
Copy Markdown
Contributor

@dasansol92 dasansol92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security_solution LGTM! Thanks for doing this cleaning!

@spalger spalger requested review from VladLasitsa and drewdaemon May 11, 2022 15:13
@spalger spalger disabled auto-merge May 11, 2022 16:16
@spalger spalger merged commit 67376ed into elastic:main May 11, 2022
@spalger spalger deleted the implement/eslint/no-unused-imports branch May 11, 2022 16:16
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Operations Kibana-Operations Team v8.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve DX: auto-fix unused imports