My formatting preference is to show opening and closing braces on a new line, so here's what you need to do in VS 2008:
- From the Tools menu, click Options.
- In the Options dialogue box, check Show All Settings in the bottom left corner. (BTW, it makes no sense for Microsoft to hide so many excellent tools.)
- Expand the Text Editor node, expand JScript and select Formatting.
- In the New Lines group box, check both Place Open Brace On New Line For Functions and Place Open Brace On New Line For Control Blocks.
- Click OK to close the Options dialogue box.
- In a .js page, press Ctrl+K, Ctrl+D (or, From the Edit menu, click Format Document).
This is one of those productivity improvements that makes the IDE indispensable.