/**
 * Proxy run function. Reaches out to jsxhint to transform
 * incoming stream or read files & transform.
 * @param  {Object}   opts Opts as created by JSHint.
 * @param  {Function} cb   Callback.
 */
function run(opts, cb){
  var files = jshintcli.gather(opts);

  if (opts.useStdin) {
    jsxhint.transformStream(process.stdin, cb);
  } else {
    jsxhint.transformFiles(files, cb);
  }
}
Пример #2
0
/**
 * Proxy run function. Reaches out to jsxhint to transform
 * incoming stream or read files & transform.
 * @param  {Object}   opts Opts as created by JSHint.
 * @param  {Function} cb   Callback.
 */
function run(opts, cb){
  opts.extensions = opts.extensions ? opts.extensions + ',.jsx' : '.jsx';
  var files = jshintcli.gather(opts);

  if (opts.useStdin) {
    jsxhint.transformStream(process.stdin, jsxhintOptions, cb);
  } else {
    jsxhint.transformFiles(files, jsxhintOptions, cb);
  }
}