diff --git a/compose-lint-checks/src/main/java/slack/lint/compose/ViewModelInjectionDetector.kt b/compose-lint-checks/src/main/java/slack/lint/compose/ViewModelInjectionDetector.kt index 97d92816..0d3b8755 100644 --- a/compose-lint-checks/src/main/java/slack/lint/compose/ViewModelInjectionDetector.kt +++ b/compose-lint-checks/src/main/java/slack/lint/compose/ViewModelInjectionDetector.kt @@ -72,8 +72,8 @@ constructor(private val allowedNames: StringSetLintOption = StringSetLintOption( property .findDirectChildrenByClass() .filter { - KnownViewModelFactories.contains(it.calleeExpression?.text) || - allowedNames.value.contains(it.calleeExpression?.text) + val allFactoryNames = KnownViewModelFactories + allowedNames.value + it.calleeExpression?.text in allFactoryNames } .map { property to it.calleeExpression!!.text } }