JSHint is a tool to detect errors and potential problems in JavaScript code. [1]

[1] http://www.jshint.com/