Can JsLint be integrated into xCode?

强颜欢笑 提交于 2019-12-13 17:20:40

问题


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?


回答1:


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

Source code for the jslint rubygem



来源:https://stackoverflow.com/questions/7986815/can-jslint-be-integrated-into-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!