Back to Intellij Community

ObjectPrivatePropertyName

plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/ObjectPrivatePropertyName.html

2025.3-rc-2543 B
Original Source

Reports properties that do not follow the naming conventions.

The following properties are reported:

  • Private properties in objects and companion objects

You can specify the required pattern in the inspection options.

Recommended naming conventions: it has to start with an underscore or an uppercase letter, use camel case.

Example:

class Person {
    companion object {
      // property in companion object
      private val NO_NAME = Person()
    }
  }