Fix linting errors
This commit is contained in:
@ -35,12 +35,14 @@ const dasherize = utils.dasherize;
|
|||||||
const unDasherize = utils.unDasherize;
|
const unDasherize = utils.unDasherize;
|
||||||
const getMDNLinks = utils.getMDNLinks;
|
const getMDNLinks = utils.getMDNLinks;
|
||||||
|
|
||||||
|
/*
|
||||||
function makeChallengesUnique(challengeArr) {
|
function makeChallengesUnique(challengeArr) {
|
||||||
// clone and reverse challenges
|
// clone and reverse challenges
|
||||||
// then filter by unique id's
|
// then filter by unique id's
|
||||||
// then reverse again
|
// then reverse again
|
||||||
return _.uniq(challengeArr.slice().reverse(), 'id').reverse();
|
return _.uniq(challengeArr.slice().reverse(), 'id').reverse();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
function numberWithCommas(x) {
|
function numberWithCommas(x) {
|
||||||
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||||
}
|
}
|
||||||
@ -556,7 +558,7 @@ module.exports = function(app) {
|
|||||||
dashedName: dasherize(blockArray[0].block),
|
dashedName: dasherize(blockArray[0].block),
|
||||||
challenges: blockArray,
|
challenges: blockArray,
|
||||||
completed: completedCount / blockArray.length * 100,
|
completed: completedCount / blockArray.length * 100,
|
||||||
time: blockArray[0] && blockArray[0].time || "???"
|
time: blockArray[0] && blockArray[0].time || '???'
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter(({ name }) => name !== 'Hikes')
|
.filter(({ name }) => name !== 'Hikes')
|
||||||
@ -579,7 +581,9 @@ module.exports = function(app) {
|
|||||||
res.render('challengeMap/show', {
|
res.render('challengeMap/show', {
|
||||||
blocks,
|
blocks,
|
||||||
daysRunning,
|
daysRunning,
|
||||||
globalCompletedCount: numberWithCommas(5612952 + (Math.floor((Date.now() - 1446268581061) / 3000))),
|
globalCompletedCount: numberWithCommas(
|
||||||
|
5612952 + (Math.floor((Date.now() - 1446268581061) / 3000))
|
||||||
|
),
|
||||||
camperCount,
|
camperCount,
|
||||||
lastCompleted,
|
lastCompleted,
|
||||||
title: "A map of all Free Code Camp's Challenges"
|
title: "A map of all Free Code Camp's Challenges"
|
||||||
|
Reference in New Issue
Block a user