How do I remove javascript validation from my eclipse project?

JavascriptJqueryEclipseValidationSyntax

Javascript Problem Overview


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?

Javascript Solutions


Solution 1 - Javascript

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.

  1. Right-click your project.
  2. Navigate to: Properties → JavaScript → Include Path
  3. Select Source tab. (It looks identical to Java Build Path Source tab.)
  4. Expand JavaScript source folder.
  5. Highlight Excluded pattern.
  6. Press the Edit button.
  7. Press the Add button next to Exclusion patterns box.
  8. 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:

Eclipse - Project Properties - JavaScript - Include Path

Solution 2 - Javascript

Turn off the JavaScript Validator in the "Builders" config for your project:

  1. Right click your project
  2. Select Properties -> Builders
  3. Uncheck the "JavaScript Validator"

Then either restart your Eclipse or/and rename the .js to something like .js_ then back again.

Solution 3 - Javascript

I removed the tag in the .project .

	<buildCommand>
		<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
		<arguments>
		</arguments>
	</buildCommand>

It's worked very well for me.

Solution 4 - Javascript

Window -> Preferences -> JavaScript -> Validator (also per project settings possible)

or

Window -> Preferences -> Validation (disable validations and configure their settings)

Solution 5 - Javascript

Go to Windows->Preferences->Validation.

There would be a list of validators with checkbox options for Manual & Build, go and individually disable the javascript validator there.

If you select the Suspend All Validators checkbox on the top it doesn't necessarily take affect.

Solution 6 - Javascript

I was able to exclude the jquery.mobile 1.1.1 in Juno by selecting Add Multiple next to the Exlusion Patterns, which brings up the tree, then drilling down to the jquery-mobile folder and selecting that.

This corrected all the warnings for the library!

Solution 7 - Javascript

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)

Solution 8 - Javascript

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. enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRitesh M NayakView Question on Stackoverflow
Solution 1 - JavascriptAlexander PogrebnyakView Answer on Stackoverflow
Solution 2 - JavascriptBrad MarchesseaultView Answer on Stackoverflow
Solution 3 - JavascriptcalraidenView Answer on Stackoverflow
Solution 4 - JavascriptRedlabView Answer on Stackoverflow
Solution 5 - JavascriptRahulView Answer on Stackoverflow
Solution 6 - JavascripttreocitiView Answer on Stackoverflow
Solution 7 - JavascriptpvgoddijnView Answer on Stackoverflow
Solution 8 - JavascriptSairam KrishView Answer on Stackoverflow