Utility to auto insert semicolons in javascript so

2019-03-18 05:39发布

The question is pretty self explanatory.

I'm working with code from multiple developers. Some of whom are inconsistent in their use of semicolons, and I just want them after every line for consistency (and to prevent any masking of errors).

I use Aptana to format my source code, but it won't add semicolons for you AFAIK.

Thanks.

8条回答
该账号已被封号
2楼-- · 2019-03-18 06:29

I'm a Flash developer, and I stumbled across this while running a Google search. For fellow AS (a JS cousin) devs, if you're using Adobe Flash Professional (I'm using CS5), when you're editing an actionscript file, click "Tools" and "AutoFormat". The program will take care of the rest.

(Again, this answer is for ActionScript developers, as this is a common issue for us as well. Please don't downvote for irrelevance to JS.)

查看更多
神经病院院长
3楼-- · 2019-03-18 06:30

I would recommend you to encourage your developers to use JSLint to improve the overall quality of your code.

This tool will look for problems in your code based on a set of rules, and of course, it will detect missing semicolons.

And since you are using Aptana, is fairly easy to install the JSLint Eclipse Plugin.

查看更多
登录 后发表回答