在JavaScript源代码中自动插入分号的实用工具? [英] Utility to auto insert semicolons in javascript source code?

查看:210
本文介绍了在JavaScript源代码中自动插入分号的实用工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题很自我解释。

我正在使用来自多个开发人员的代码。其中一些用户使用分号不一致,我只是希望他们在每一行之后保持一致(并防止任何错误的掩盖)。

我使用Aptana来格式化我的源代码,但不会为您添加分号AFAIK。



谢谢。

解决方案

啊......刚发现YUI压缩机有一个保留分号的选项,实际上将分号添加到适当的行中。然后,只需要通过aptana格式化程序发送缩小的未被隔离的版本即可。



如果有人想出了一个更简单的解决方案,请发帖。 b $ b

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.

解决方案

Ah ... just discovered YUI compressor has a preserve semicolons options that will actually add the semicolons to the appropriate lines. Then it's just a matter of sending the minified, unmunged version back thru the aptana formatter.

If someone comes up with a simpler solution, please post.

这篇关于在JavaScript源代码中自动插入分号的实用工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆