Submitted just the .ts part in r240128.
We don't properly support plain json files yet, AFAICT. Shouldn't be much of a change, but that should be separate.
Also, if we add it, it should be in sync with clang-format-diff.py and getLanguageByFileName().
You can run clang-format over JSON with -assume-filename=a.js, the result is ok-ish. But ack, people also might not want to be fancy in their JSON formatting and prefer a more regular +2 indent style.