[Javascript] Syntax Checking

Noah Sussman noah at onemorebug.com
Wed Jun 25 21:16:28 CDT 2008


On Wed, Jun 25, 2008 at 8:11 AM, Del Wegener <del at delweg.com> wrote:
> Is there a good syntax
> checker that I could use to find such errors?  A validation checker?
>
> On Wed, Jun 25, 2008 at 9:15 PM, Andrew Ip <andrewsyip at gmail.com> wrote:
> > You can try JSLint, which is by Douglas Crockford:
> >
> > http://www.jslint.com

If you'd like to run JSLint locally, you can do so with the aid of
Mozilla's Rhino

http://jslint.com/rhino/

The documentation is sparse, but here's how to install JSLint on your
local machine (assuming you already have Java installed):

1. Download jslint.js from http://jslint.com/rhino/jslint.js
    (make sure you use that particular jslint.js, as its specially
modified to work with Rhino).

2. Get the Rhino zip file from http://www.mozilla.org/rhino/download.html

3. Open the zip and grab js.jar

Then you should then be able to invoke JSLint on any JavaScript file,
from the command window (Mac/PC/Linux) like this:

java -jar js.jar jslint.js someFile.js



More information about the Javascript mailing list