简体   繁体   中英

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++. 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.

Unfortunately, Eclipse + nodeclipse plugin don't see it that way. 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.
  2. unticked "Enable javascript semantic validation"

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). In fact, Notepad++ offers significantly better completion than eclipse, as it remembers what you typed before, but eclipse does none, it only does highlighting.

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:

"asi" : true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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