问题
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