Your comments

That's not really "compiling", it's merely linting. There's a good package called SublimeLinter which will do as-you-type linting for a range of different languages, including Javascript (using JSHint)
how do you mean "compile"?
This function also exists in Komodo, where it is called "Smart Caps". Works great, and I'm missing it in ST!