I've worked on JS projects where we set a maximum line number on files. It worked well -- it was a gentle reminder that a module had grown and would benefit from splitting up. (I think this would definitely work in other languages, but probably with a higher line threshold.)