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

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

问题描述

我正在处理来自多个开发人员的代码,其中一些开发人员在使用分号方面不一致,我只希望在每一行之后使用它们以保持一致性(并防止任何错误掩盖).

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

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

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

推荐答案

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

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天全站免登陆