How to exclude Javascript file from Javascript check in Eclipse

I have a javascript checker working well for my own code. I want to keep checking. But when it comes to an open source library, such as jquery, for example, validation gives warnings.

I do not want to receive warnings through the loaded library. But I want to keep warnings for my code.

I know that you can exclude files from scanning in the "Settings> Scan" window, but javascript validation does not exist ! I looked at every validator, the javascript validator does not exist.

So, how can I exclude certain files from scanning?

Here is the list of validators I have: Screenshot

Thank!

PS: I am using Eclipse PDT.!

+86
javascript eclipse eclipse-pdt
Feb 01 2018-11-21T00:
source share
3 answers

Well, probably, I managed to do what you need;) It's a little complicated. So my steps are:

  • downloaded Eclipse PDT (of course that it works for you, because I use Eclipse for Java EE)
  • created the TestJS project (it was a JavaScript project)
  • two files were created: test.js and htmlparser.js (the last one is copied from John Resig)
  • typed a β€œbroken” script in both of them, so Eclipse told me that they had errors.
  • went to Project Properties> JavaScript> Include Path> Source , there is " Excluded " to highlight and click the "Edit" button, here you can add what you want to exclude (file, folder, template).
  • I excluded the test.js file, clicked apply ...
  • ... and got a happy ending: now Eclipse tells me that there is an error in htmlparser.js, but not in test.js;)

ScreenShot: enter image description here

Hope this helps!

+148
Feb 19 '11 at 18:10
source share

Following Maxym's excellent answer: since I usually store all my JavaScript libraries in one place, and the Eclipse validator tends to detect unusual errors (possibly completely false positives), I used the Add multiple option and selected folders containing these libraries. No need to update every time you add a file!

enter image description here

+16
Sep 10
source share

To the right, select Project β†’ Then select Properties β†’ MyEclipse β†’ Check - β†’ Excluded resource and check the js folder or select a specific js file enter image description here

0
Sep 12 '16 at 10:42 on
source share



All Articles