JsLint is a well-know JavaScript validation library developed by Douglas Crockford.  The library allows developer to validate JavaScript against a set of best practices that have been developed over the years.  RockstarApps has brought this functionality to Eclipse. JsLint can be easily activated by an Editor Action in any JavaScript file or from the "Navigator" view. The image below shows how to activate the JsLint validator from an Editor.  

JsLint Activation

Users can activate the JsLint functionality from the any of the following places:

  1. Right clicking with in an editor.  Select the [RockstarApps -> Validate with JsLint...] menu item. Validates the file being edited.
  2. Right click on one or more JavaScript files in the "Navigator" view. 
  3. Right click on one or more Folders or a Project to validate all the JavaScript files contained with in the selected items.

 

JsLint Properties

Once the menu item is clicked a dialog will open that displays a list of the properties that can be configured. To see what each Checkbox means, click here to see the JsLint documentation.

Users can change the number of errors that will be returned by the JsLint validator by modifying the [Maximum # of errors] field in the Properties Dialog.

Editor Makers

After JsLint has validated the JavaScript, markers will be added to the file for each validation error that was found. To see a complete list of all the errors, open the "Problems" view in eclipse.  From the "Problems" view, users can click on an error to jump directly to the line in the JavaScript file.

Clear Markers

Users can clear JsLint validation markers from the any of the following places:

  1. Right clicking with in an editor.  Select the [RockstarApps -> Clear JsLint Errors] menu item. Validates the file being edited.
  2. Right click on one or more JavaScript files in the "Navigator" view. 
  3. Right click on one or more Folders or a Project to clear markers on all the JavaScript files contained with in them.

 

Click here to download the JsLint Plugin