The order here: https://kotlinlang.org/docs/reference/coding-conventions.html
- Property declarations and initializer blocks
- Secondary constructors
- Method declarations
- Companion object
I realize this isn’t a hard and fast rule, but I’m curious what drove it?
My team and I tend to use the companion object most for a logger and constants that are consumed in the class. When they are the bottom, any major syntax issues turn the file an angry red instead of just starting where the first error occurs, so I’d like to recommend we put the companion object near the top.