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

False positive for NoUnusedImports #3265

Closed
danikula opened this issue Dec 7, 2020 · 1 comment
Closed

False positive for NoUnusedImports #3265

danikula opened this issue Dec 7, 2020 · 1 comment

Comments

@danikula
Copy link

danikula commented Dec 7, 2020

Expected Behavior

Detekt should not report NoUnusedImports for used import.

Steps to Reproduce

Bar.kt

package detekt.bar

fun `is`() = Unit

Foo.kt

package detekt

import detekt.bar.`is` as is2

fun foo() = is2()

Detekt reports issue NoUnusedImports in line import detekt.bar.`is` as is2

Your Environment

  • Version of detekt used: 1.15.0-RC1
  • Operating System and version: Mac OS 10.15.7
@cortinico
Copy link
Member

The NoUnusedImports rule is a rule that we mirror from KtLint: https://github.com/pinterest/ktlint/blob/master/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/NoUnusedImportsRule.kt

You should open a similar issue on https://github.com/pinterest/ktlint (perhaps they already have a similar issue resolved pinterest/ktlint#910).

Closing as this is unrelated to us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants