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
// Should fail:val foo:List<String> =listOf()
val bar = listOf<String>()
// Should pass:val baz:List<String> = emptyList()
val boo = emptyList<String>()
val far = mutableListOf<String>()
val faz =listOf("foo")
I have some doubts whether this should be a Ktlint rule. It is not really related to lint/formatting but more an inspection kind of rule. If such a rule would be added it should be a bit more generic and also take setOf() and mapOf into account. As this is not mentioned in the style guides, it can only be added and activated by default in ktlint_official code style. For other code styles it will need to be enabled explicitly.
Expected Rule behavior
Additional information
emptyList
is not mentioned in the Kotlin Coding Conventions or Android Kotlin Style Guide)The text was updated successfully, but these errors were encountered: