Validate JavaScript syntax in IDE (Editor)?

You can go grab Javascript Lint then do exactly what you want and use whatever editor you want:

Javascript Lint - http://www.javascriptlint.com/download.htm


Personally, I like to use emacs with flymake, which can use Spidermonkey, JsLint or Rhino to do the validation. This does the sort of on the fly syntax checking I think you are after. If you want a liberal validation, you might want to use Spidermonkey as it is the execution engine from firefox, so it will reject anything firefox rejects. If you want something a little stricter, Crockford's JsLint enforces good style.flymake with spidermonkey
(source: mnemonikk.org)

Emacs is not for everyone however. If you prefer something point-and-click, you might want to check out IntelliJ's IDEA. It can do on the fly syntax checking, along with a raft of other features. Sadly, javascript support is not available in the free version.

IntelliJ's javascript syntax checking
(source: jetbrains.com)

A free alternative to IntelliJ is Netbeans, which purports to offer the same javascript functionality baked into the core. I don't have experience with it, but it is free, open source, and reputedly improving in recent versions netbean's javascript syntax highlighting http://netbeans.org/images_www/articles/61/ide/javascript/background_parser.png

If you're a Windows or ASP.NET type developer you might be more interested in Microsoft Visual Web Developer Express 2010. It supports this features, and probably has better support for ASP.NET development than the other tools I've mentioned.


I use Komodo Edit from Activestate. It validates, has code completion, brace matching, etc., and not just for Javascript.

Edit: BTW I have a macro in Komodo Edit that calls JS_Beautify and does a spectacular job.

Tags:

Javascript

Ide