Egor Pavlikhin
Egor Pavlikhin

Reputation: 18011

Validate JavaScript syntax in IDE (Editor)?

Are there any JavaScript editors that can validate JavaScript syntax on the fly? Things like missing brackets, etc.

Upvotes: 6

Views: 2649

Answers (7)

ChaosPandion
ChaosPandion

Reputation: 78312

I recommend Visual Web Developer Express 2010.

Upvotes: 1

fmark
fmark

Reputation: 58667

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.

Upvotes: 3

selfawaresoup
selfawaresoup

Reputation: 15842

Eclipse (or it's web specialized form Aptana) and Netbeans offer syntax checking on the fly.

Upvotes: 2

Robusto
Robusto

Reputation: 31913

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.

Upvotes: 2

Sam Hanes
Sam Hanes

Reputation: 2849

If you use Eclipse, the JSDT project provides a JavaScript nature. Like most of Eclipse's language natures, it provides a context engine with realtime validation, syntax highlighting, completion, etc.

Upvotes: 0

Ray
Ray

Reputation: 12441

Here is another idea of validating your .js with c# in VS http://madskristensen.net/post/Verify-JavaScript-syntax-using-C.aspx

Upvotes: 0

Jamie Wong
Jamie Wong

Reputation: 18350

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

Upvotes: 4

Related Questions