Skip to content

Alphabetical import ordering enabled by default is a problem in Android Studio/IntelliJ #527

@dimsuz

Description

@dimsuz

In our project ktlint 0.34.0 now reports a lot of incorrect import ordering, although we use a default import layou of IDE. All our developers have "Optimize imports" enabled by default, but this still creates an order like the following (which seems to be default one of Kotlin IDE plugin):

import ru.example.a
import ru.example.b
import ru.example.c
import javax.inject.Inject

Notice that the last one comes in non alphabetical order.
The unfortunate thing is that this cannot be changed.

Import order editing is there only for Java CodeStyle, kotlin plugin seems not to provide it. Correct me if I'm wrong.

If you think that this is still something that should be default, then please close.

But currently I suspect that many Android Studio/IntelliJ users will be disabling this rule, otherwise they'll have an endless conflict between IDE autoformatter/ktlint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions