title: Optimizing Gulp tasks
body: <p>I have the following tasks as part of my gulp file:</p>
  
  <pre><code>gulp.task('jshint', function() {
      return gulp.src(jsSrc)
          .pipe(jshint())
          .pipe(jshint.reporter('jshint-stylish'));
  });
  
  gulp.task('jscs', function() {
      return gulp.src(jsSrc)
          .pipe(jscs());
  });
  
  gulp.task('jslint', [ 'jshint', 'jscs' ]);
  </code></pre>
  
  <p>As I understand it, if I run <code>jslint</code> I'm not going to get the benefit of only reading from disc one. To do that, I would have to rewrite it to look like this:</p>
  
  <pre><code>gulp.task('jslint', function() {
      return gulp.src(jsSrc)
          .pipe(jshint())
          .pipe(jscs())
          .pipe(jshint.reporter('jshint-stylish'));
  });
  </code></pre>
  
  <p>This is fine, except that it doesn't allow me to run the <code>jshint</code> task independently of the <code>jscs</code> if I wanted to.</p>
  
  <p>Hence I'm wondering what best practice is around this? I was thinking that I could break things out into different functions and orchestrate things together, but that doesn't seem like the right approach.</p>