Our application allows users to upload javascript, CSS, and HTML files. We need a way to validate these files against CSS and JS lint, as well as record any errors associated with them (file name, line, etc). This needs to be done “realtime,” or at the least passed off to a delayed job process to work in the background. The requirements won’t allow us to hook into a third-party online service (like the online w3c validator).
I’ve found jshint_on_rails and jslint_on_rails, which seems like they could work. They are reliant on rake tasks, however, and I’m not sure how I would get their output into a database. I have thus far not found anything similar for css lint. Are there packages like this out there that I could hook into?
Thanks
What I ended up doing was installing the Node.js versions of JSHint and CSSLint, and then calling them through Rails and parsing the output, like so: