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

## 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
This commit is contained in:
Alex Szabo 2023-08-26 01:13:57 +02:00 committed by GitHub
parent edca162329
commit d8d355dd7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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',