function collect(fp, files, ignores, ext) {
  if (ignores && isIgnored(fp, ignores)) {
    return;
  }

  if (!fsUtils.exists(fp)) {
    cli.error("Can't open " + fp);
    return;
  }

  if (fsUtils.isDirectory(fp)) {
    fsUtils.readDirectory(fp).forEach(function(item) {
      var itempath = path.join(fp, item);
      if (fsUtils.isDirectory(itempath) || item.match(ext)) {
        collect(itempath, files, ignores, ext);
      }
    });

    return;
  }

  files.push(fp);
}
Recursively gather all files that need to be linted,
excluding those that user asked to ignore.

@param {string} fp      a path to a file or directory to lint
@param {array}  files   a pointer to an array that stores a list of files
@param {array}  ignores a list of patterns for files to ignore
@param {array}  ext     a list of non-dot-js extensions to lint