We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
i have code like this:
import a.b.Class import a.b.c.Class as Class1 import a.b.c.Class as Class2 ... code that uses Class1 ... code that uses Class2
and while this is pretty strange its valid and works.
when i reformat that code with ktlint the second import is just removed, so the code no longer compiles.
If ktlint really wants to remove the duplicate import it should probably change all usages of Class2 to Class1 in the body of the file.
I hope this is obvious and easy to reproduce, if not i can try to create a sample project to reproduce it.
The text was updated successfully, but these errors were encountered:
Nice find.
Ktlint should keep both imports in my opinion. Rewriting the code to eliminate one of the imports is not what people would expect from a linter.
Sorry, something went wrong.
Imports for the same class should not be removed in case different al…
140b45e
…iases are used Closes pinterest#1243
Successfully merging a pull request may close this issue.
Expected Behavior
i have code like this:
and while this is pretty strange its valid and works.
Observed Behavior
when i reformat that code with ktlint the second import is just removed, so the code no longer compiles.
If ktlint really wants to remove the duplicate import it should probably change all usages of Class2 to Class1 in the body of the file.
I hope this is obvious and easy to reproduce, if not i can try to create a sample project to reproduce it.
The text was updated successfully, but these errors were encountered: