From 80cb0cf7e04018f23ab617cf16a6e8f41125bb3f Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 4 Jul 2014 14:43:03 -0400 Subject: [PATCH] plugins.js jslint --- src/plugins.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/plugins.js b/src/plugins.js index f35cc2e2a9..f9c97bb180 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -1,3 +1,5 @@ +'use strict'; + var fs = require('fs'), path = require('path'), async = require('async'), @@ -8,7 +10,7 @@ var fs = require('fs'), db = require('./database'), meta = require('./meta'), - utils = require('./../public/src/utils'), + utils = require('../public/src/utils'), pkg = require('../package.json'); (function(Plugins) { @@ -23,7 +25,7 @@ var fs = require('fs'), Plugins.initialized = false; // Events - Plugins.readyEvent = new eventEmitter; + Plugins.readyEvent = new eventEmitter(); Plugins.init = function() { if (Plugins.initialized) { @@ -89,7 +91,9 @@ var fs = require('fs'), }); }, function(next) { - if (global.env === 'development') winston.info('[plugins] Sorting hooks to fire in priority sequence'); + if (global.env === 'development') { + winston.info('[plugins] Sorting hooks to fire in priority sequence'); + } Object.keys(Plugins.loadedHooks).forEach(function(hook) { var hooks = Plugins.loadedHooks[hook]; hooks = hooks.sort(function(a, b) { @@ -270,7 +274,9 @@ var fs = require('fs'), if (data.hook && data.method && typeof data.method === 'string' && data.method.length > 0) { data.id = id; - if (!data.priority) data.priority = 10; + if (!data.priority) { + data.priority = 10; + } method = data.method.split('.').reduce(function(memo, prop) { if (memo !== null && memo[prop]) { return memo[prop]; @@ -292,7 +298,7 @@ var fs = require('fs'), Plugins.loadedHooks[data.hook].push(data); callback(); - } else return; + } }; Plugins.hasListeners = function(hook) { @@ -613,7 +619,9 @@ var fs = require('fs'), }); } ], function(err, config) { - if (err) return next(); // Silently fail + if (err) { + return next(); // Silently fail + } plugins.push(config); next();