what do people use to make sure the JavaScript they write is valid, as they write it. Not something I run on my code after the fact?
I recommend the 7.0 release candidate:
http://downloads.activestate.com/Komodo/releases/
More info:
http://www.activestate.com/komodo-ide http://www.activestate.com/komodo-edit
[1]: Original version: http://code.google.com/p/js2-mode/
[2]: Improved (IMO) fork: https://github.com/mooz/js2-mode
Additionally, you can configure JS[HL]int to use flymake[3]. The trick is to improve performance by having it talk to a running JavaScript process (e.g. a node server) instead of starting a new one each time.