Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove javascript validation from my eclipse project?

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?

like image 875
Ritesh M Nayak Avatar asked Jun 28 '10 11:06

Ritesh M Nayak


People also ask

How do I turn off validation in eclipse?

Click Window > Preferences and select Validation in the left pane. The Validation page of the Preferences window lists the validators available in your project and their settings. To disable individual validators, clear the check boxes next to each validator that you want to disable.

What is validate option in eclipse?

The Validation Component in the wst sub project provides an extendable framework that is used to develop new custom validators to validate resources in the workbench. The resources can be an eclipse Resource (IResource) or an EMF Resource (EObject).

Does Eclipse use JavaScript?

The JavaScript Development Tools (JSDT) provide plug-ins that implement an IDE supporting the development of JavaScript applications and JavaScript within web applications. It adds a JavaScript project type and perspective to the Eclipse Workbench as well as a number of views, editors, wizards, and builders.


2 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.

  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

like image 164
Alexander Pogrebnyak Avatar answered Oct 01 '22 01:10

Alexander Pogrebnyak


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.

like image 31
Brad Marchesseault Avatar answered Oct 01 '22 02:10

Brad Marchesseault