here’s a conversation starter on handling star imp...
# intellij
p
here’s a conversation starter on handling star imports in IntelliJ. It looks like the default setting for Kotlin is using star imports already for a few (3/5) cases from a given package, but it doesn’t match the default setting of ktlint which is a very popular Kotlin linter. Does anyone know if there’s an effort to bring the two behaviors in sync? It’s a small but annoying thing that keeps appearing, especially in new setups. context: https://kotlinlang.slack.com/archives/C02UUATR7RC/p1684128633483979
c
Have the below in .editorconfig:
Copy code
# as recommended by ktlint for consistency w/ IntelliJ: <https://pinterest.github.io/ktlint/rules/configuration-intellij-idea/>
ij_kotlin_packages_to_use_import_on_demand = java.util.*
ij_kotlin_name_count_to_use_star_import = 2147483647
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL

# ktlint configuration <https://pinterest.github.io/ktlint/rules/configuration-ktlint/>
ktlint_code_style = official
👀 1
p
thanks, this is roughly what we converged to in the mentioned thread. I’m getting a 404 for https://pinterest.github.io/ktlint/rules/configuration-intellij-idea/ - are you aware of a new URL?
c
ugh, hate it when you go to all the trouble to retain links/context - and then they are gone, with no obvious replacement (bad form - that link is #3 in google for “ktlint intellij sync”). Sorry, not aware of an alternative.
👍 1
e