There's an npm module called fixmyjs.
In "legacy mode" with JSHint:
var jshint = require('jshint').JSHINT
var fixmyjs = require('fixmyjs')
jshint(stringOfCode, objectOfOptions)
var stringFixedCode = fixmyjs(jshint.data(), stringOfCode, objectOfOptions).run()
Works great!
There is also a Sublime Text 2/3 Package.