Skip to content

Commit

Permalink
[Ops] Fix @kbn/imports/no_unused_imports rule (elastic#164870)
Browse files Browse the repository at this point in the history
## 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)
  • Loading branch information
delanni committed Aug 25, 2023
1 parent a768f1c commit 06a3d1c
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function isTsOrEslintIgnore(comment: Comment) {

export const NoUnusedImportsRule: Rule.RuleModule = {
meta: {
hasSuggestions: true,
fixable: 'code',
docs: {
url: 'https://github.com/elastic/kibana/blob/main/packages/kbn-eslint-plugin-imports/README.mdx#kbnimportsno_unused_imports',
Expand Down

0 comments on commit 06a3d1c

Please sign in to comment.