Try the jshint-eclipse plugin. Also see this question asked earlier.
Quote from the JSHint page :
JSHint is a JSLint fork, a tool written and maintained by Douglas Crockford.
Initially, the project began by creating a more customized version of JSLint - one that does not apply one specific coding style for its users, and then turns into a separate static analysis tool with its own goals and ideals.
jshint-eclipse is an eclipse plugin that integrates JSHint with Eclipse.
Update site for jshint-eclipse:
http://github.eclipsesource.com/jshint-eclipse/updates/
Update
I wanted to post some snapshots to show the effect of installing this plugin on Javascript files.
Before
Note that the "Problems" view is empty.

After
The JSHint plugin needs some configuration that needs to be done after installation. This is also stated on the jshint-eclipse website :
In a project that contains JavaScript files, open the context menu and select Properties. On the JSHint page, enable JSHint for this project
I did the above and included JSHint for * .js files as follows:

After that, with the same JS file as before, errors are displayed in the "Problem" view:

source share