The best way to keep your JS files tidy is using the free online JavaScript formatter program.