src/index.js
function onStreamEnd(done) {
    Promise
      .all(lintPromiseList)
      .then(passLintResultsThroughReporters)
      .then(lintResults => {
        process.nextTick(() => {
          const errorCount = lintResults.reduce((sum, res) => {
            const errors = res.results[0].warnings.filter(isErrorSeverity);
            return sum + errors.length;
          }, 0);
          if (pluginOptions.failAfterError && errorCount > 0) {
            const errorMessage = `Failed with ${errorCount} ${errorCount === 1 ? 'error' : 'errors'}`;
            this.emit('error', new PluginError(pluginName, errorMessage));
          }
          done();
        });
      })
      .catch(error => {
        process.nextTick(() => {
          this.emit('error', new PluginError(pluginName, error, {
            showStack: Boolean(pluginOptions.debug)
          }));
          done();
        });
      });
  }
function onStreamEnd(done) {
    Promise
      .all(lintPromiseList)
      .then(passLintResultsThroughReporters)
      .then(lintResults => {
        process.nextTick(() => {
          const errorCount = lintResults.reduce((sum, res) => {
            const errors = res.results[0].warnings.filter(isErrorSeverity);
            return sum + errors.length;
          }, 0);
          if (pluginOptions.failAfterError && errorCount > 0) {
            const errorMessage = `Failed with ${errorCount} ${errorCount === 1 ? 'error' : 'errors'}`;
            this.emit('error', new PluginError(pluginName, errorMessage));
          }
          done();
        });
      })
      .catch(error => {
        process.nextTick(() => {
          this.emit('error', new PluginError(pluginName, error, {
            showStack: Boolean(pluginOptions.debug)
          }));
          done();
        });
      });
  }
function onStreamEnd ( done ) { Promise . all ( lintPromiseList ) . then ( passLintResultsThroughReporters ) . then ( lintResults => { process . nextTick ( ( ) => { const errorCount = lintResults . reduce ( ( sum , res ) => { const errors = res . results [ 0 ] . warnings . filter ( isErrorSeverity ) ; return sum + errors . length ; } , 0 ) ; if ( pluginOptions . failAfterError && errorCount > 0 ) { const errorMessage = ` ${ errorCount } ${ errorCount === 1 ? 'error' : 'errors' } ` ; this . emit ( 'error' , new PluginError ( pluginName , errorMessage ) ) ; } done ( ) ; } ) ; } ) . catch ( error => { process . nextTick ( ( ) => { this . emit ( 'error' , new PluginError ( pluginName , error , { showStack : Boolean ( pluginOptions . debug ) } ) ) ; done ( ) ; } ) ; } ) ; }
Resolves promises and provides accumulated report to reporters.
@param {Function} done - Stream completion callback.
@return {undefined} Nothing is returned (done callback is used instead).
Resolves promises and provides accumulated report to reporters .