Fix lint errors in lint error fix.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2020-04-22 21:00:31 +03:00
parent e7603298d7
commit 9e95c06415
9 changed files with 47 additions and 49 deletions

View file

@ -1297,7 +1297,10 @@ if (Meteor.isServer) {
// Insert new board at last position in sort order.
Boards.before.insert((userId, doc) => {
const lastBoard = Boards.findOne({ sort: { $exists: true } }, { sort: { sort: -1 } });
const lastBoard = Boards.findOne(
{ sort: { $exists: true } },
{ sort: { sort: -1 } },
);
if (lastBoard && typeof lastBoard.sort !== 'undefined') {
doc.sort = lastBoard.sort + 1;
}

View file

@ -732,7 +732,7 @@ Cards.helpers({
parentString(sep) {
return this.parentList()
.map(function (elem) {
.map(function(elem) {
return elem.title;
})
.join(sep);
@ -1050,13 +1050,13 @@ Cards.helpers({
voteMemberPositive() {
if (this.vote && this.vote.positive)
return Users.find({ _id: { $in: this.vote.positive } })
return []
return Users.find({ _id: { $in: this.vote.positive } });
return [];
},
voteMemberNegative() {
if (this.vote && this.vote.negative)
return Users.find({ _id: { $in: this.vote.negative } })
return []
return Users.find({ _id: { $in: this.vote.negative } });
return [];
},
getId() {
@ -1475,12 +1475,12 @@ Cards.mutations({
},
};
},
setVoteQuestion(question, public_) {
setVoteQuestion(question, public) {
return {
$set: {
vote: {
question,
public_,
public,
positive: [],
negative: [],
},
@ -1929,7 +1929,7 @@ if (Meteor.isServer) {
});
//New activity for card moves
Cards.after.update(function (userId, doc, fieldNames) {
Cards.after.update(function(userId, doc, fieldNames) {
const oldListId = this.previous.listId;
const oldSwimlaneId = this.previous.swimlaneId;
const oldBoardId = this.previous.boardId;
@ -1975,7 +1975,7 @@ if (Meteor.isServer) {
// change list modifiedAt, when user modified the key values in timingaction array, if it's endAt, put the modifiedAt of list back to one year ago for sorting purpose
const modifiedAt = new Date(
new Date(value).getTime() -
(action === 'endAt' ? 365 * 24 * 3600 * 1e3 : 0),
(action === 'endAt' ? 365 * 24 * 3600 * 1e3 : 0),
); // set it as 1 year before
const boardId = list.boardId;
Lists.direct.update(
@ -2029,7 +2029,7 @@ if (Meteor.isServer) {
JsonRoutes.add(
'GET',
'/api/boards/:boardId/swimlanes/:swimlaneId/cards',
function (req, res) {
function(req, res) {
const paramBoardId = req.params.boardId;
const paramSwimlaneId = req.params.swimlaneId;
Authentication.checkBoardAccess(req.userId, paramBoardId);
@ -2039,7 +2039,7 @@ if (Meteor.isServer) {
boardId: paramBoardId,
swimlaneId: paramSwimlaneId,
archived: false,
}).map(function (doc) {
}).map(function(doc) {
return {
_id: doc._id,
title: doc.title,
@ -2063,7 +2063,7 @@ if (Meteor.isServer) {
* title: string,
* description: string}]
*/
JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function (
JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function(
req,
res,
) {
@ -2076,7 +2076,7 @@ if (Meteor.isServer) {
boardId: paramBoardId,
listId: paramListId,
archived: false,
}).map(function (doc) {
}).map(function(doc) {
return {
_id: doc._id,
title: doc.title,
@ -2098,7 +2098,7 @@ if (Meteor.isServer) {
JsonRoutes.add(
'GET',
'/api/boards/:boardId/lists/:listId/cards/:cardId',
function (req, res) {
function(req, res) {
const paramBoardId = req.params.boardId;
const paramListId = req.params.listId;
const paramCardId = req.params.cardId;
@ -2130,7 +2130,7 @@ if (Meteor.isServer) {
* @param {string} [assignees] the array of maximum one ID of assignee of the new card
* @return_type {_id: string}
*/
JsonRoutes.add('POST', '/api/boards/:boardId/lists/:listId/cards', function (
JsonRoutes.add('POST', '/api/boards/:boardId/lists/:listId/cards', function(
req,
res,
) {
@ -2237,7 +2237,7 @@ if (Meteor.isServer) {
JsonRoutes.add(
'PUT',
'/api/boards/:boardId/lists/:listId/cards/:cardId',
function (req, res) {
function(req, res) {
Authentication.checkUserId(req.userId);
const paramBoardId = req.params.boardId;
const paramCardId = req.params.cardId;
@ -2536,7 +2536,7 @@ if (Meteor.isServer) {
JsonRoutes.add(
'DELETE',
'/api/boards/:boardId/lists/:listId/cards/:cardId',
function (req, res) {
function(req, res) {
Authentication.checkUserId(req.userId);
const paramBoardId = req.params.boardId;
const paramListId = req.params.listId;

View file

@ -338,7 +338,6 @@ if (Meteor.isServer) {
isPasswordLoginDisabled() {
return process.env.PASSWORD_LOGIN_ENABLED === 'false';
},
});
}

View file

@ -1,4 +1,4 @@
const DateString = Match.Where(function (dateAsString) {
const DateString = Match.Where(function(dateAsString) {
check(dateAsString, String);
return moment(dateAsString, moment.ISO_8601).isValid();
});
@ -299,13 +299,13 @@ export class TrelloCreator {
}
}
return true;
})
});
if (positiveVotes.length > 0) {
cardToCreate.vote = {
question: cardToCreate.title,
public: true,
positive: positiveVotes,
}
};
}
}
@ -369,7 +369,7 @@ export class TrelloCreator {
// so we make it server only, and let UI catch up once it is done, forget about latency comp.
const self = this;
if (Meteor.isServer) {
file.attachData(att.url, function (error) {
file.attachData(att.url, function(error) {
file.boardId = boardId;
file.cardId = cardId;
file.userId = self._user(att.idMemberCreator);