JsLint可以集成到xCode中吗? [英] Can JsLint be integrated into xCode?

查看:114
本文介绍了JsLint可以集成到xCode中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用XCode的编辑器编辑一些Javascript文件(我知道,您想问我为什么,但是请在这里忍受),并且我希望定期在我的编辑中运行lint.

I'm editing some Javascript files using XCode's editor (I know, you want to ask me why, but bear with me here), and I'd like to have lint run on my edits, regularly.

我没有真正的偏好-可能是每次保存文件时,每次编辑时,或者在最坏的情况下,当我按下生成"或运行"按钮时都会自动.

I don't have a real preference - it might be every time the file saves, or on each edit, or, worst case scenario, automatically when I hit the build or run button.

可以将沿这些方向的设置放在一起吗?有指针吗?

Can a setup along these lines be put together? Any pointers?

推荐答案

您可以使用jslint命令行实用程序(安装为ruby gem)并将预操作添加到您的构建方案中. 您已经在Mac OS X上安装了ruby和rubygems,所以

You could use the jslint command line utility (installed as a ruby gem) and add a pre-action to your build scheme. You already have ruby and rubygems installed on Mac OS X, so just

(sudo) gem install jslint

然后创建要运行的预操作

Then create a pre-action to run

jslint path/to/javascript/file.js

jslint ruby​​gem的源代码

这篇关于JsLint可以集成到xCode中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆