#Setup JsHint in Eclipse
First make sure it is installed:
Help Installation Details
Alternative: **Help About Installation Details**
- Look for JsHint Eclipse Integration
- If not installed, drag icon from the marketplace
Now we need to make sure JsHint is properly configured for our project.
- Right click on your project in the Project Explorer
- Choose Properties
- Choose the JsHint page
- Add in files you want to cover: *.js
- Exclude directories or files you want to omit: jasmine, jquery, node_modules
Here we show how to configure JsHint so it ignores node_modules:
And here we see the results after we have ignored several other sets of files that are not important to us:
What we Gain
At the bottom of the Eclipse IDE you see a Problems folder. If you don’t see it:
Window Views Problems
- Or: Alt-Shift-Q, X
This problems window can get filled with JsHint errors seen in jQuery and other files over which you have no control. By excluding those files, we can start to make use of the Problems view once again. Now it shows only problems with our code, and not problems with libraries that support our code.
NOTE: Remember that many libraries that we use a intentionally condensed and stripped of all unnecessary syntax at the time they are published. They may or may not have passed JsHint during development, but we can’t be sure since we are looking at the puiblished files, not the development files.
Turn It In
Make sure you have excluded all the jsamine, node_modules, jquery and require files from your final project. In the .settings folder for your project you will find a filed with a name like:
Open the file in a text editor, block copy the contents, submit this assignment, and use the Text tool to paste in the content of that file.