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

[Ops] Fix @kbn/imports/no_unused_imports rule #164870

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

delanni
Copy link
Contributor

@delanni delanni commented Aug 25, 2023

Summary

@jloleysens reported that ESLint breaks (probably in IDEs only) because of this bug. When there's an unused import, linting stops for the whole file.

By adding this flag, it no longer breaks on my machine, however, auto-fixing still doesn't work from the CLI. The IDE auto-fixes because it also recognizes it as a non-unsed variable.

  • add meta.hasSuggestions to @kbn/imports/no_unused_imports prevent ESLint from breaking

@delanni delanni added chore Team:Operations Team label for Operations Team backport:all-open Backport to all branches that could still receive a release labels Aug 25, 2023
@delanni delanni requested a review from a team as a code owner August 25, 2023 16:48
@elasticmachine
Copy link
Contributor

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

@delanni delanni added the release_note:skip Skip the PR/issue when compiling release notes label Aug 25, 2023
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

@delanni delanni merged commit d8d355d into elastic:main Aug 25, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 25, 2023
## Summary
@jloleysens reported that ESLint breaks (probably in IDEs only) because
of this bug. When there's an unused import, linting stops for the whole
file.

By adding this flag, it no longer breaks on my machine, however,
auto-fixing still doesn't work from the CLI. The IDE auto-fixes because
it also recognizes it as a non-unsed variable.

- add `meta.hasSuggestions` to `@kbn/imports/no_unused_imports` prevent
ESLint from breaking

(cherry picked from commit d8d355d)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 25, 2023
## Summary
@jloleysens reported that ESLint breaks (probably in IDEs only) because
of this bug. When there's an unused import, linting stops for the whole
file.

By adding this flag, it no longer breaks on my machine, however,
auto-fixing still doesn't work from the CLI. The IDE auto-fixes because
it also recognizes it as a non-unsed variable.

- add `meta.hasSuggestions` to `@kbn/imports/no_unused_imports` prevent
ESLint from breaking

(cherry picked from commit d8d355d)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
7.17 Backport failed because of merge conflicts
8.10
8.9

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 164870

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Aug 26, 2023
# Backport

This will backport the following commits from `main` to `8.10`:
- [[Ops] Fix @kbn/imports/no_unused_imports rule
(#164870)](#164870)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-25T23:13:57Z","message":"[Ops]
Fix @kbn/imports/no_unused_imports rule (#164870)\n\n##
Summary\r\n@jloleysens reported that ESLint breaks (probably in IDEs
only) because\r\nof this bug. When there's an unused import, linting
stops for the whole\r\nfile.\r\n\r\nBy adding this flag, it no longer
breaks on my machine, however,\r\nauto-fixing still doesn't work from
the CLI. The IDE auto-fixes because\r\nit also recognizes it as a
non-unsed variable.\r\n\r\n- add `meta.hasSuggestions` to
`@kbn/imports/no_unused_imports` prevent\r\nESLint from
breaking","sha":"d8d355dd7b4184127a760261178daf0f8a94af86","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","backport:all-open","v8.11.0"],"number":164870,"url":"https://github.com/elastic/kibana/pull/164870","mergeCommit":{"message":"[Ops]
Fix @kbn/imports/no_unused_imports rule (#164870)\n\n##
Summary\r\n@jloleysens reported that ESLint breaks (probably in IDEs
only) because\r\nof this bug. When there's an unused import, linting
stops for the whole\r\nfile.\r\n\r\nBy adding this flag, it no longer
breaks on my machine, however,\r\nauto-fixing still doesn't work from
the CLI. The IDE auto-fixes because\r\nit also recognizes it as a
non-unsed variable.\r\n\r\n- add `meta.hasSuggestions` to
`@kbn/imports/no_unused_imports` prevent\r\nESLint from
breaking","sha":"d8d355dd7b4184127a760261178daf0f8a94af86"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164870","number":164870,"mergeCommit":{"message":"[Ops]
Fix @kbn/imports/no_unused_imports rule (#164870)\n\n##
Summary\r\n@jloleysens reported that ESLint breaks (probably in IDEs
only) because\r\nof this bug. When there's an unused import, linting
stops for the whole\r\nfile.\r\n\r\nBy adding this flag, it no longer
breaks on my machine, however,\r\nauto-fixing still doesn't work from
the CLI. The IDE auto-fixes because\r\nit also recognizes it as a
non-unsed variable.\r\n\r\n- add `meta.hasSuggestions` to
`@kbn/imports/no_unused_imports` prevent\r\nESLint from
breaking","sha":"d8d355dd7b4184127a760261178daf0f8a94af86"}}]}]
BACKPORT-->

Co-authored-by: Alex Szabo <[email protected]>
kibanamachine added a commit that referenced this pull request Aug 26, 2023
# Backport

This will backport the following commits from `main` to `8.9`:
- [[Ops] Fix @kbn/imports/no_unused_imports rule
(#164870)](#164870)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-25T23:13:57Z","message":"[Ops]
Fix @kbn/imports/no_unused_imports rule (#164870)\n\n##
Summary\r\n@jloleysens reported that ESLint breaks (probably in IDEs
only) because\r\nof this bug. When there's an unused import, linting
stops for the whole\r\nfile.\r\n\r\nBy adding this flag, it no longer
breaks on my machine, however,\r\nauto-fixing still doesn't work from
the CLI. The IDE auto-fixes because\r\nit also recognizes it as a
non-unsed variable.\r\n\r\n- add `meta.hasSuggestions` to
`@kbn/imports/no_unused_imports` prevent\r\nESLint from
breaking","sha":"d8d355dd7b4184127a760261178daf0f8a94af86","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","backport:all-open","v8.11.0"],"number":164870,"url":"https://github.com/elastic/kibana/pull/164870","mergeCommit":{"message":"[Ops]
Fix @kbn/imports/no_unused_imports rule (#164870)\n\n##
Summary\r\n@jloleysens reported that ESLint breaks (probably in IDEs
only) because\r\nof this bug. When there's an unused import, linting
stops for the whole\r\nfile.\r\n\r\nBy adding this flag, it no longer
breaks on my machine, however,\r\nauto-fixing still doesn't work from
the CLI. The IDE auto-fixes because\r\nit also recognizes it as a
non-unsed variable.\r\n\r\n- add `meta.hasSuggestions` to
`@kbn/imports/no_unused_imports` prevent\r\nESLint from
breaking","sha":"d8d355dd7b4184127a760261178daf0f8a94af86"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164870","number":164870,"mergeCommit":{"message":"[Ops]
Fix @kbn/imports/no_unused_imports rule (#164870)\n\n##
Summary\r\n@jloleysens reported that ESLint breaks (probably in IDEs
only) because\r\nof this bug. When there's an unused import, linting
stops for the whole\r\nfile.\r\n\r\nBy adding this flag, it no longer
breaks on my machine, however,\r\nauto-fixing still doesn't work from
the CLI. The IDE auto-fixes because\r\nit also recognizes it as a
non-unsed variable.\r\n\r\n- add `meta.hasSuggestions` to
`@kbn/imports/no_unused_imports` prevent\r\nESLint from
breaking","sha":"d8d355dd7b4184127a760261178daf0f8a94af86"}}]}]
BACKPORT-->

Co-authored-by: Alex Szabo <[email protected]>
@delanni
Copy link
Contributor Author

delanni commented Aug 28, 2023

7.17 backport is not possible, the rule didn't exist, and it's not used in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:all-open Backport to all branches that could still receive a release chore release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v8.9.2 v8.10.0 v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants