I am using eclipse on my project and while messing around with my eclipse settings, I turned on Javascript support. Now eclipse complains that JQuery library has errors in it and is not letting me compile the project. Does anyone know how to turn javascript validation off?
8 Answers
I actually like MY JavaScript files to be validated, but I definitely don't want to validate and deal with trivial warnings with third party libraries.
That's why I think that turning off validation all together is too drastic. Fortunately with Eclipse, you can selectively remove some JavaScript sources from validation.
- Right-click your project.
- Navigate to: Properties → JavaScript → Include Path
- Select Source tab. (It looks identical to Java Build Path Source tab.)
- Expand JavaScript source folder.
- Highlight
Excluded
pattern. - Press the Edit button.
- Press the Add button next to
Exclusion patterns
box. - You may either type Ant-style wildcard pattern, or click
Browse
button to mention the JavaScript source by name.
The information about JavaScript source inclusion/exclusion is saved into .settings/.jsdtscope
file. Do not forget to add it to your SCM.
Here is how configuration looks with jQuery files removed from validation:
Another reason could be that you acidentically added a Javascript nature to your project unintentionally (i just did this by accident) which enables javascript error checking.
removing this ....javascriptnature from your project fixes that.
(this is ofcourse only if you dont want eclipse to realise you have any JS)
In addition, if you are using Tern eclipse IDE or IBM Node.js Tools for Eclipse, you may need to disable JSHint and other libraries that you don't want.
To disable this, Project Properties > Tern > Modules > JSHint or any other library that you don't want.