如何从JavaScript中的JavaScript验证中排除Javascript文件 [英] How to exclude a Javascript file from Javascript Validation in Eclipse
问题描述
我不希望对下载的库发出警告。但是我想保留我的代码的警告。
我知道您可以在首选项>验证中排除文件验证 窗口,但 javascript验证不存在!我已经看过每个验证器,javascript验证器不在那里。
那么如何从验证中排除特定的文件?
以下是我的验证器列表:
截图
谢谢!
PS:我使用Eclipse PDT。
好吧,可能我已经设法做你需要的东西;)这有点棘手。所以我的步骤:
- 下载Eclipse PDT(确定
它适用于您,因为我使用
Eclipse for Java EE) - 创建项目TestJS(它是
JavaScript项目) - 创建了两个文件,test.js和
htmlparser.js(最后一个从
John Resig的网站复制) - 在这两个文件中键入破碎脚本,所以Eclipse告诉我,两个他们
- 转到项目属性>
JavaScript>包含路径>源,
有已排除 要突出显示和
按编辑按钮,这里您可以
添加您要排除的
(文件,文件夹,模式)。 - 我排除了test.js文件,按
申请... - ...得到一个快乐的结局:现在
Eclipse指出我在htmlparser.js中有
错误,但不是
test.js;)
ScreenShot:
真的希望它有帮助!
I have the javascript validation working good for my own code. I want to keep the validation. But when it comes to open source library, like jquery for example, the validation creates warnings.
I don't want warnings over a downloaded library. But I want to keep warnings for my code.
I know you can exclude files from validation in the "Preferences > Validation" window, but the javascript validation is not there ! I've looked each validator, the javascript validator is not there.
So how can I exclude specific files from the validation ?
Here is the list of validators I have : Screenshot
Thanks !
PS : I use Eclipse PDT.!
well, probably I've managed to do what you need ;) It is a bit tricky. So my steps:
- downloaded Eclipse PDT (to be sure that it works for you, because I use Eclipse for Java EE)
- created project TestJS (it was JavaScript project)
- created two files, test.js and htmlparser.js (last one copied from John Resig's site)
- typed "broken" script in both of them, so Eclipse told me that there were errors in both of them
- went to Project Properties > JavaScript > Include Path > Source, there is "Excluded" to highlight and press "Edit" button, here you are able to add what you want to exclude (file, folder, pattern).
- I excluded "test.js" file, pressed apply...
- ...and got a happy ending: now Eclipse point me out that there is error in htmlparser.js, but not in test.js ;)
ScreenShot:
Really hope that it helps!
这篇关于如何从JavaScript中的JavaScript验证中排除Javascript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!