Back to Intellij Community

ObjectPropertyName

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

2025.3-rc-2727 B
Original Source

Reports properties that do not follow the naming conventions.

The following properties are reported:

  • Top-level properties
  • 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 uppercase letter, use camel case and no underscores.

Example:

// top-level property
  val USER_NAME_FIELD = "UserName"
  // top-level property holding reference to singleton object
  val PersonComparator: Comparator<Person> = /*...*/

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