ESlint comma-dangle

This commit is contained in:
Peter Jaszkowiak
2017-02-17 19:31:21 -07:00
parent aa64ec7db1
commit bc1d70c126
345 changed files with 1974 additions and 1978 deletions

View File

@@ -11,7 +11,7 @@ blacklistController.get = function (req, res, next) {
}
res.render('admin/manage/ip-blacklist', {
rules: rules,
title: '[[pages:ip-blacklist]]'
title: '[[pages:ip-blacklist]]',
});
});
};

View File

@@ -19,15 +19,15 @@ cacheController.get = function (req, res, next) {
max: postCache.max,
itemCount: postCache.itemCount,
percentFull: percentFull,
avgPostSize: avgPostSize
avgPostSize: avgPostSize,
},
groupCache: {
length: groupCache.length,
max: groupCache.max,
itemCount: groupCache.itemCount,
percentFull: ((groupCache.length / groupCache.max) * 100).toFixed(2),
dump: req.query.debug ? JSON.stringify(groupCache.dump(), null, 4) : false
}
dump: req.query.debug ? JSON.stringify(groupCache.dump(), null, 4) : false,
},
});
};

View File

@@ -14,7 +14,7 @@ var categoriesController = {};
categoriesController.get = function (req, res, next) {
async.parallel({
category: async.apply(categories.getCategories, [req.params.category_id], req.user.uid),
privileges: async.apply(privileges.categories.list, req.params.category_id)
privileges: async.apply(privileges.categories.list, req.params.category_id),
}, function (err, data) {
if (err) {
return next(err);
@@ -32,7 +32,7 @@ categoriesController.get = function (req, res, next) {
data.category.name = translator.escape(String(data.category.name));
res.render('admin/manage/category', {
category: data.category,
privileges: data.privileges
privileges: data.privileges,
});
});
});
@@ -46,7 +46,7 @@ categoriesController.getAll = function (req, res, next) {
categoriesController.getAnalytics = function (req, res, next) {
async.parallel({
name: async.apply(categories.getCategoryField, req.params.category_id, 'name'),
analytics: async.apply(analytics.getCategoryAnalytics, req.params.category_id)
analytics: async.apply(analytics.getCategoryAnalytics, req.params.category_id),
}, function (err, data) {
if (err) {
return next(err);

View File

@@ -20,18 +20,18 @@ dashboardController.get = function (req, res, next) {
{
done: !meta.reloadRequired,
doneText: '[[admin/general/dashboard:restart-not-required]]',
notDoneText:'[[admin/general/dashboard:restart-required]]'
notDoneText:'[[admin/general/dashboard:restart-required]]',
},
{
done: plugins.hasListeners('filter:search.query'),
doneText: '[[admin/general/dashboard:search-plugin-installed]]',
notDoneText:'[[admin/general/dashboard:search-plugin-not-installed]]',
tooltip: '[[admin/general/dashboard:search-plugin-tooltip]]',
link:'/admin/extend/plugins'
}
link:'/admin/extend/plugins',
},
];
plugins.fireHook('filter:admin.notices', notices, next);
}
},
}, function (err, results) {
if (err) {
return next(err);
@@ -39,7 +39,7 @@ dashboardController.get = function (req, res, next) {
res.render('admin/general/dashboard', {
version: nconf.get('version'),
notices: results.notices,
stats: results.stats
stats: results.stats,
});
});
};
@@ -57,7 +57,7 @@ function getStats(callback) {
},
function (next) {
getStatsForSet('topics:tid', 'topicCount', next);
}
},
], function (err, results) {
if (err) {
return callback(err);
@@ -75,7 +75,7 @@ function getStatsForSet(set, field, callback) {
var terms = {
day: 86400000,
week: 604800000,
month: 2592000000
month: 2592000000,
};
var now = Date.now();
@@ -91,7 +91,7 @@ function getStatsForSet(set, field, callback) {
},
alltime: function (next) {
getGlobalField(field, next);
}
},
}, callback);
}

View File

@@ -24,7 +24,7 @@ databaseController.get = function (req, res, next) {
} else {
next();
}
}
},
}, function (err, results) {
if (err) {
return next(err);

View File

@@ -11,7 +11,7 @@ var errorsController = {};
errorsController.get = function (req, res, next) {
async.parallel({
'not-found': async.apply(meta.errors.get, true),
analytics: async.apply(analytics.getErrorAnalytics)
analytics: async.apply(analytics.getErrorAnalytics),
}, function (err, data) {
if (err) {
return next(err);
@@ -24,7 +24,7 @@ errorsController.get = function (req, res, next) {
errorsController.export = function (req, res, next) {
async.waterfall([
async.apply(meta.errors.get, false),
async.apply(json2csv)
async.apply(json2csv),
], function (err, csv) {
if (err) {
return next(err);

View File

@@ -22,7 +22,7 @@ eventsController.get = function (req, res, next) {
},
events: function (next) {
events.getEvents(start, stop, next);
}
},
}, function (err, results) {
if (err) {
return next(err);
@@ -33,7 +33,7 @@ eventsController.get = function (req, res, next) {
res.render('admin/advanced/events', {
events: results.events,
pagination: pagination.create(page, pageCount),
next: 20
next: 20,
});
});
};

View File

@@ -29,7 +29,7 @@ flagsController.get = function (req, res, next) {
analytics: function (next) {
analytics.getDailyStatsForSet('analytics:flags', Date.now(), 30, next);
},
assignees: async.apply(user.getAdminsandGlobalModsandModerators)
assignees: async.apply(user.getAdminsandGlobalModsandModerators),
}, function (err, results) {
if (err) {
return next(err);
@@ -39,7 +39,7 @@ flagsController.get = function (req, res, next) {
results.assignees = results.assignees.map(function (userObj) {
return {
uid: userObj.uid,
username: userObj.username
username: userObj.username,
};
});
@@ -94,7 +94,7 @@ function getFlagData(req, res, callback) {
}
posts.getFlags(sets, cid, req.uid, start, stop, next);
}
},
], callback);
}

View File

@@ -35,7 +35,7 @@ groupsController.list = function (req, res, next) {
},
function (groupData, next) {
next(null, {groups: groupData, pagination: pagination.create(page, pageCount)});
}
},
], function (err, data) {
if (err) {
return next(err);
@@ -44,7 +44,7 @@ groupsController.list = function (req, res, next) {
res.render('admin/manage/groups', {
groups: data.groups,
pagination: data.pagination,
yourid: req.uid
yourid: req.uid,
});
});
};
@@ -60,7 +60,7 @@ groupsController.get = function (req, res, callback) {
return callback();
}
groups.get(groupName, {uid: req.uid, truncateUserList: true, userListCount: 20}, next);
}
},
], function (err, group) {
if (err) {
return callback(err);

View File

@@ -25,11 +25,11 @@ homePageController.get = function (req, res, next) {
categoryData = categoryData.map(function (category) {
return {
route: 'category/' + category.slug,
name: 'Category: ' + category.name
name: 'Category: ' + category.name,
};
});
next(null, categoryData);
}
},
], function (err, categoryData) {
if (err || !categoryData) {
categoryData = [];
@@ -38,16 +38,16 @@ homePageController.get = function (req, res, next) {
plugins.fireHook('filter:homepage.get', {routes: [
{
route: 'categories',
name: 'Categories'
name: 'Categories',
},
{
route: 'recent',
name: 'Recent'
name: 'Recent',
},
{
route: 'popular',
name: 'Popular'
}
name: 'Popular',
},
].concat(categoryData)}, function (err, data) {
if (err) {
return next(err);
@@ -55,7 +55,7 @@ homePageController.get = function (req, res, next) {
data.routes.push({
route: '',
name: 'Custom'
name: 'Custom',
});
res.render('admin/general/homepage', data);

View File

@@ -49,7 +49,7 @@ function getNodeInfo(callback) {
title: process.title,
version: process.version,
memoryUsage: process.memoryUsage(),
uptime: process.uptime()
uptime: process.uptime(),
},
os: {
hostname: os.hostname(),
@@ -57,8 +57,8 @@ function getNodeInfo(callback) {
platform: os.platform(),
arch: os.arch(),
release: os.release(),
load: os.loadavg().map(function (load) { return load.toFixed(2); }).join(', ')
}
load: os.loadavg().map(function (load) { return load.toFixed(2); }).join(', '),
},
};
async.parallel({
@@ -67,7 +67,7 @@ function getNodeInfo(callback) {
},
gitInfo: function (next) {
getGitInfo(next);
}
},
}, function (err, results) {
if (err) {
return callback(err);
@@ -93,7 +93,7 @@ function getGitInfo(callback) {
},
branch: function (next) {
get('git rev-parse --abbrev-ref HEAD', next);
}
},
}, callback);
}

View File

@@ -17,7 +17,7 @@ languagesController.get = function (req, res, next) {
});
res.render('admin/general/languages', {
languages: languages
languages: languages,
});
});
};

View File

@@ -13,7 +13,7 @@ logsController.get = function (req, res, next) {
}
res.render('admin/advanced/logs', {
data: validator.escape(logs)
data: validator.escape(logs),
});
});
};

View File

@@ -24,7 +24,7 @@ pluginsController.get = function (req, res, next) {
next(null, plugins);
});
}
},
}, function (err, payload) {
if (err) {
return next(err);
@@ -48,7 +48,7 @@ pluginsController.get = function (req, res, next) {
}),
incompatible: payload.all.filter(function (plugin) {
return compatiblePkgNames.indexOf(plugin.name) === -1;
})
}),
});
});
};

View File

@@ -47,11 +47,11 @@ function renderEmail(req, res, next) {
path: path,
fullpath: email,
text: text,
original: original.toString()
original: original.toString(),
});
});
}, next);
}
},
], function (err, emails) {
if (err) {
return next(err);
@@ -61,7 +61,7 @@ function renderEmail(req, res, next) {
emails: emails,
sendable: emails.filter(function (email) {
return email.path.indexOf('_plaintext') === -1 && email.path.indexOf('partials') === -1;
})
}),
});
});
}

View File

@@ -12,7 +12,7 @@ socialController.get = function (req, res, next) {
}
res.render('admin/general/social', {
posts: posts
posts: posts,
});
});
};

View File

@@ -12,12 +12,12 @@ soundsController.get = function (req, res, next) {
sounds = Object.keys(sounds).map(function (name) {
return {
name: name
name: name,
};
});
res.render('admin/general/sounds', {
sounds: sounds
sounds: sounds,
});
});
};

View File

@@ -73,8 +73,8 @@ uploadsController.uploadTouchIcon = function (req, res, next) {
path: path.join(nconf.get('upload_path'), 'system', 'touchicon-' + size + '.png'),
extension: 'png',
width: size,
height: size
})
height: size,
}),
], next);
}, function (err) {
fs.unlink(uploadedFile.path, function (err) {

View File

@@ -18,7 +18,7 @@ var userFields = ['uid', 'username', 'userslug', 'email', 'postcount', 'joindate
usersController.search = function (req, res, next) {
res.render('admin/manage/users', {
search_display: '',
users: []
users: [],
});
};
@@ -97,14 +97,14 @@ usersController.registrationQueue = function (req, res, next) {
invites.invitations = invites.invitations.map(function (email, i) {
return {
email: email,
username: usernames[index][i] === '[[global:guest]]' ? '' : usernames[index][i]
username: usernames[index][i] === '[[global:guest]]' ? '' : usernames[index][i],
};
});
});
next(null, invitations);
}
},
], next);
}
},
}, function (err, data) {
if (err) {
return next(err);
@@ -142,9 +142,9 @@ function getUsers(set, section, min, max, req, res, next) {
},
function (uids, next) {
user.getUsersWithFields(uids, userFields, req.uid, next);
}
},
], next);
}
},
}, function (err, results) {
if (err) {
return next(err);
@@ -157,7 +157,7 @@ function getUsers(set, section, min, max, req, res, next) {
var data = {
users: results.users,
page: page,
pageCount: Math.max(1, Math.ceil(results.count / resultsPerPage))
pageCount: Math.max(1, Math.ceil(results.count / resultsPerPage)),
};
data[section] = true;
render(req, res, data);
@@ -181,7 +181,7 @@ usersController.getCSV = function (req, res, next) {
events.log({
type: 'getUsersCSV',
uid: req.user.uid,
ip: req.ip
ip: req.ip,
});
user.getUsersCSV(function (err, data) {