ESlint keyword-spacing, no-multi-spaces

This commit is contained in:
Peter Jaszkowiak
2017-02-18 01:52:56 -07:00
parent a5a3f3089a
commit 604358ecc4
116 changed files with 210 additions and 210 deletions

View File

@@ -240,14 +240,14 @@ module.exports = function (Posts) {
function (posts, next) {
// Parse out flag data into its own object inside each post hash
async.map(posts, function (postObj, next) {
for(var prop in postObj) {
for (var prop in postObj) {
postObj.flagData = postObj.flagData || {};
if (postObj.hasOwnProperty(prop) && prop.startsWith('flag:')) {
postObj.flagData[prop.slice(5)] = postObj[prop];
if (prop === 'flag:state') {
switch(postObj[prop]) {
switch (postObj[prop]) {
case 'open':
postObj.flagData.labelClass = 'info';
break;
@@ -296,14 +296,14 @@ module.exports = function (Posts) {
}
// Track new additions
for(prop in flagObj) {
for (prop in flagObj) {
if (flagObj.hasOwnProperty(prop) && !postData.hasOwnProperty('flag:' + prop) && flagObj[prop].length) {
changes.push(prop);
}
}
// Track changed items
for(prop in postData) {
for (prop in postData) {
if (
postData.hasOwnProperty(prop) && prop.startsWith('flag:') &&
flagObj.hasOwnProperty(prop.slice(5)) &&
@@ -324,7 +324,7 @@ module.exports = function (Posts) {
var history = JSON.parse(postData['flag:history'] || '[]');
changes.forEach(function (property) {
switch(property) {
switch (property) {
case 'assignee': // intentional fall-through
case 'state':
history.unshift({

View File

@@ -68,7 +68,7 @@ module.exports = function (Posts) {
content = content.slice(0, current.index + 6) + absolute + content.slice(current.index + 6 + current[1].length);
}
} catch(err) {
} catch (err) {
winston.verbose(err.messsage);
}
}

View File

@@ -136,7 +136,7 @@ module.exports = function (Posts) {
function toObject(key, data) {
var obj = {};
for(var i = 0; i < data.length; i += 1) {
for (var i = 0; i < data.length; i += 1) {
obj[data[i][key]] = data[i];
}
return obj;

View File

@@ -30,7 +30,7 @@ module.exports = function (Posts) {
function (deleted, next) {
if (parseInt(deleted, 10) === 1 && isDelete) {
return next(new Error('[[error:post-already-deleted]]'));
} else if(parseInt(deleted, 10) !== 1 && !isDelete) {
} else if (parseInt(deleted, 10) !== 1 && !isDelete) {
return next(new Error('[[error:post-already-restored]]'));
}