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)?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With