简体   繁体   English

Eclipse Javascript如何关闭丢失的分号警告?

[英]Eclipse Javascript how to switch off missing semicolon warning?

Having used Groovy for many years, I have developed a large node & JS v.6 project without any semicolons with Notepad++. 使用Groovy多年,我使用Notepad ++开发了一个大型节点和JS v.6项目,而没有任何分号。 It is a huge time saver and liberating, as, for me at least, semicolons are a complete waste of time and space. 这是节省大量时间并释放的时间,因为至少对我而言,分号完全浪费时间和空间。 I have not yet come across a case where not having them in my Groovy nor js code has caused a single problem in 8 years. 我还没有遇到过这样的情况,即在我的Groovy和js代码中都没有它们已经导致了8年的单一问题。

Unfortunately, Eclipse + nodeclipse plugin don't see it that way. 不幸的是,Eclipse + nodeclipse插件并不这么认为。 It complains about every line missing a semicolon. 它抱怨每行缺少分号。 I tried switching it off in two ways: 我尝试通过两种方式将其关闭:

  1. window->preferences->Javascript->Validator->Errors/Warnings->Potential programming problems->Optional semi-colon=Ignore. 窗口->首选项-> Javascript->验证程序->错误/警告->潜在的编程问题->可选的分号=忽略。
  2. unticked "Enable javascript semantic validation" 取消选中“启用JavaScript语义验证”

Neither helped, plus I don't want to disable any of the other validation as this is the only benefit Eclipse + nodeclipse offers over Notepad++ (that I can find at least). 两者都无济于事,而且我不想禁用任何其他验证,因为这是Eclipse + nodeclipse提供的优于Notepad ++的唯一好处(至少可以找到)。 In fact, Notepad++ offers significantly better completion than eclipse, as it remembers what you typed before, but eclipse does none, it only does highlighting. 实际上,Notepad ++的完成度比eclipse好得多,因为它可以记住您之前键入的内容,但是eclipse则不执行任何操作,而是仅进行突出显示。

Anyone have any ideas on how to stop the semicolon warnings? 有人对如何停止分号警告有任何想法吗?

Go to Configuration(alt+enter), in JSHint/Configuration , you have to set or edit the following key to tolerate Automatic Semicolon Insertion: 转到“配置”(alt + enter),在“ JSHint /配置”中,您必须设置或编辑以下项以允许自动分号插入:

"asi" : true “ asi”:正确

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM