TypeScript compiler's formatting of arrays

Topics: General
Apr 1, 2013 at 6:46 AM
Is there a way to make the TypeScript compiler retain the original formatting (like in the TypeScript source files it compiled) of an array in the JavaScript files it outputs?

I wrote a simple implementation of Conway's Game of Life using the canvas element (https://github.com/user1911431/typescriptConwaysGameOfLife) and I copied a "Gosper Glider Gun" pattern into a 40 by 40 multi-dimensional array and the compiler took 200 lines of typescript and turned it into 1800 lines of JavaScript (one element of the multi-dimensional array per line).
Apr 1, 2013 at 2:31 PM
I believe the Typescript team is working on preserving whitespace (and non-whitespace). It likely won't be out very soon though, as it's probably not at the top of their priority list. Your best bet is to get a Javascript formatter that you like and apply that to the generated code. If you're using Visual Studio (or another decent IDE), you can make the IDE automatically run the formatter as a post-build event.