Roman Starkov
Roman Starkov

Reputation: 61510

Which tool can warn me of JavaScript semicolon insertion?

We use the Closure Compiler to spot syntax errors in JavaScript and window.onerror to spot all other runtime errors. Every file is augmented with "use strict". None of this catches semicolons that were "helpfully" inserted.

I have tried JSLint, but it has pretty specific ideas about how one should code in JavaScript, and so was less useful than I hoped. For example, with JsLint I can no longer use for (var i = ...) style; JsLint gives up as soon as it encounters one of these.

Is there some other static analysis tool for JavaScript that could warn me about semicolon insertion in particular?

Upvotes: 1

Views: 112

Answers (1)

stusmith
stusmith

Reputation: 14113

There is also JSHint:

http://www.jshint.com/

You can customize what you want it to warn over. It can be run as a standalone checker as part of your build process, or integrated into various editors.

Upvotes: 3

Related Questions