please check Wikia JS guide lines for code formatting rules:

https://github.com/Wikia/guidelines/blob/master/JavaScript/CodingConventions.md