Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: Javascript validation disabled. But why is it still generating errors?

The validation in Eclipse is catching what it deems "errors" in the framework I've been using just fine.

  • Project -> Properties -> Validation -> "Suspend all validators" doesn't work.

  • Project -> Properties -> Javascript -> Validation -> Errors/Warnings -> [Unchecked] "Enable Javascript semantic validation" doesn't work either.

  • Enabling the above-mentioned checkbox and setting all validation issues to "Ignore" doesn't work either.

Each time one of these settings changes, it does a build and immediately all the "errors" are found and subsequently prevent an otherwise known-good build.

like image 598
Old McStopher Avatar asked Aug 18 '11 04:08

Old McStopher


4 Answers

  1. Right click your project
  2. Select Properties -> JavaScript -> Include
  3. Select Source tab (It looks similar to the Java Build Path Source tab)
  4. Expand source folder
  5. Highlight Excluded pattern
  6. Click Edit button
  7. Click Add button next to Exclusion patterns box.
  8. Click Browse button and select the JavaScript source by name.
like image 83
11101101b Avatar answered Nov 12 '22 22:11

11101101b


You actually have to disable the global builder settings , to do that :

Right Click Project => Build Path => Configure Build Path => Builders

In the right hand side , make sure JavaScript Validator is Unchecked, if not uncheck it.

Then Save the Configuration and make a clean build.

like image 30
Ramesh Lingappa Avatar answered Nov 12 '22 22:11

Ramesh Lingappa


If you want to remove the JavaScript validation from a project completely, you can just remove it from the .project file.

  • Open your project's .project file in a text editor.
  • Remove the line <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
  • Refresh your project

Now if you go into your project properties, you'll notice the JavaScript option is gone entirely.

like image 12
Michael Celey Avatar answered Nov 12 '22 20:11

Michael Celey


Validation of .js files is handled by the JavaScript Validator, but that's a Builder, not something that plugs into the general Validation Framework. If you change the Errors/Warnings preferences, a Clean and build should show you the results.

like image 5
nitind Avatar answered Nov 12 '22 22:11

nitind