Recent Changes - Search:

edit SideBar


JSLint is a bit too aggressive, so we are using JSHint

To install JSHint, use

  npm install jshint

In Ptolemy, the file has two rules:

  • ant jshint - Runs jshint and writes the results to stdout.
  • ant jshint-checkstyle - Runs jshint and generates checkstyle-compatibile output in $PTII/reports/jshintFixed.xml

See for the nightly build output.


Below the file-wide comment, there should be the following:

// Stop extra messages from jslint and jshint.  Note that there should
// be no space between the / and the * and global. See                        
/*globals addInputHandler, accessor, exports, get, removeInputHandler, require, send  */
/*jshint globalstrict: true*/
'use strict';

Comment (Ben): According to JSHint Documentation (, you can have spaces between `/*` and `globals`.

It is a best practice to customize the list of globals individually for each file. The idea is that not every global should be listed, instead list on the globals that are used in the file.

See Also

External References

Back to JS

Edit - History - Print - Recent Changes - Search
Page last modified on February 03, 2016, at 06:08 PM