You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The solution documented for IntelliJ isn't optimal for those of us who have .idea in .gitignore but still wish to synchronize these settings across the team.
Setting IntelliJ's Code Style settings and exported them to an .editorconfig file, yielding a file from which I added these to my .editorconfig:
# Disable wildcard imports
ij_kotlin_name_count_to_use_star_import = 2147483647
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
# For java.util., ... too
ij_kotlin_packages_to_use_import_on_demand = unset
Now when I use Optimize Imports in IntelliJ, the imports produced are in line with those expected by ktlint.
PS FWIW: I believe that together with the following setting, this .editorconfig defines the settings prescribed for .idea/codeStyles/Project.xml
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
I also have set this one:
insert_final_newline = true
The text was updated successfully, but these errors were encountered:
The solution documented for IntelliJ could very well be outdated. In newly created Kotlin projects, I do not see the .idea/codeStyles directory being created anymore. So I will update this page that those files should be deleted. I will add below to this page (and make a reference from the wildcard import page to this section):
The documentation for the no-wildcard-import rule documents the changes to
.editorconfig
to make ktlint wildcard imports compatible with IntelliJ, but not the reverse case.The solution documented for IntelliJ isn't optimal for those of us who have
.idea
in.gitignore
but still wish to synchronize these settings across the team.Setting IntelliJ's Code Style settings and exported them to an
.editorconfig
file, yielding a file from which I added these to my.editorconfig
:Now when I use Optimize Imports in IntelliJ, the imports produced are in line with those expected by ktlint.
PS FWIW: I believe that together with the following setting, this .editorconfig defines the settings prescribed for
.idea/codeStyles/Project.xml
I also have set this one:
The text was updated successfully, but these errors were encountered: