index.js
function (cb) {

      // If the hook has been deactivated, just return
      if (!sails.config[this.configKey].check) {
        sails.log.verbose('Eslint hook deactivated.');
        return cb();
      } else {

        var format = sails.config[this.configKey].formatter || 'stylish';

        var patterns = sails.config[this.configKey].patterns || ['api', 'config'];

        patterns.forEach(function (pattern) {
          if (glob.hasMagic(pattern)) {
            glob.sync(pattern).forEach(function (file) {
              runLint(file, format);
            });
          } else {
            runLint(pattern, format);
          }
        });

        return cb();
      }

    }
function (cb) {

      // If the hook has been deactivated, just return
      if (!sails.config[this.configKey].check) {
        sails.log.verbose('Eslint hook deactivated.');
        return cb();
      } else {

        var format = sails.config[this.configKey].formatter || 'stylish';

        var patterns = sails.config[this.configKey].patterns || ['api', 'config'];

        patterns.forEach(function (pattern) {
          if (glob.hasMagic(pattern)) {
            glob.sync(pattern).forEach(function (file) {
              runLint(file, format);
            });
          } else {
            runLint(pattern, format);
          }
        });

        return cb();
      }

    }
function ( cb ) { // If the hook has been deactivated, just return if ( ! sails . config [ this . configKey ] . check ) { sails . log . verbose ( 'Eslint hook deactivated.' ) ; return cb ( ) ; } else { var format = sails . config [ this . configKey ] . formatter || 'stylish' ; var patterns = sails . config [ this . configKey ] . patterns || [ 'api' , 'config' ] ; patterns . forEach ( function ( pattern ) { if ( glob . hasMagic ( pattern ) ) { glob . sync ( pattern ) . forEach ( function ( file ) { runLint ( file , format ) ; } ) ; } else { runLint ( pattern , format ) ; } } ) ; return cb ( ) ; } }
Initialize the hook
@param  {Function} cb Callback for when we're done initializing
Initialize the hook