如何从 Eclipse 中的 Javascript 验证中排除 Javascript 文件
我的 javascript 验证对我自己的代码运行良好。我想保留验证。但是当涉及到开源库时,例如 jquery,验证会产生警告。
我不希望在下载的库时收到警告。但我想为我的代码保留警告。
我知道您可以在“首选项 > 验证”窗口中从验证中排除文件,但是不存在 javascript 验证< /强>!我查看了每个验证器,javascript 验证器不存在。
那么如何从验证中排除特定文件呢?
这是我拥有的验证器列表: 屏幕截图
谢谢!
PS:我使用Eclipse PDT。!
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.!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,也许我已经成功地做到了你所需要的;)这有点棘手。所以我的步骤:
它对你有用,因为我用
Eclipse for Java EE)
JavaScript 项目)
htmlparser.js(最后一个复制自
John Resig 的站点)
JavaScript >包含路径>来源,
有“排除”突出显示并
按“编辑”按钮,就到了
能够添加您想要排除的内容
(文件、文件夹、模式)。
申请...
Eclipse 指出我有
htmlparser.js 中出现错误,但不在
test.js ;)
屏幕截图:
真的希望它有帮助!
well, probably I've managed to do what you need ;) It is a bit tricky. So my steps:
that it works for you, because I use
Eclipse for Java EE)
JavaScript project)
htmlparser.js (last one copied from
John Resig's site)
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).
apply...
Eclipse point me out that there is
error in htmlparser.js, but not in
test.js ;)
ScreenShot:
Really hope that it helps!
根据 Maxym 的出色回答:由于我通常将所有 JavaScript 库放在一个位置,并且 Eclipse 验证器往往会发现异常错误(可能完全是误报),因此我使用了添加多个选项并选择了文件夹包含这些库。无需每次添加文件时都进行更新!
Following from Maxym's excellent answer: since I usually keep all my JavaScript libraries in one place and the Eclipse validator tends to find unusual errors (perhaps entirely false positives), I used the Add Multiple option and selected the folders that contained those libraries. No need to update each time you add a file!