Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable checking for specific JavaScript error in Eclipse

I'm trying to use Eclipse for JavaScript (the "Eclipse IDE for Java EE Developers" package).

My project uses Bluebird (a promises implementation), and so it has a lot of lines like:

somePromise.catch(function(err){...

Eclipse considers this to be an error, probably because it thinks that "catch" is a reserved keyword that cannot be used as a method name. Same for the promise.finaly method. Maybe it's right, but I'd rather not switch to a different library just because of this.

Is there a way to make it ignore these specific errors (but keep reporting other errors in the same files)?

like image 436
user3742276 Avatar asked Jun 15 '14 13:06

user3742276


1 Answers

This has been reported and fixed not long ago in this bug :https://bugs.eclipse.org/bugs/show_bug.cgi?id=443876

Go into Preferences->Javascript->Validator->Errors/Warnings and uncheck a new option "Strict validation of JavaScript keywords usage". That should fix it.

I had the same problem before and had implemented a plugin that manipulated bytecode of JSDT at load time to silence this error. Now such hacks are not needed.

like image 88
Michał Grzejszczak Avatar answered Sep 27 '22 20:09

Michał Grzejszczak