Upgrade ESLint to v3 (#8299)

* upgraded habitrpg-eslint-config to v2 and eslint to v3

* adapt to eslint3 rules

* update shrinkwrap

* update shrinkwrap again
This commit is contained in:
Matteo Pagliazzi
2016-12-20 22:31:36 +01:00
committed by GitHub
parent 3f96d05365
commit 92cbb4a07d
25 changed files with 247 additions and 241 deletions
+10 -8
View File
@@ -534,14 +534,16 @@ api.resetPassword = {
from: 'Habitica <admin@habitica.com>',
to: email,
subject: res.t('passwordResetEmailSubject'),
text: res.t('passwordResetEmailText', { username: user.auth.local.username,
newPassword,
baseUrl: nconf.get('BASE_URL'),
}),
html: res.t('passwordResetEmailHtml', { username: user.auth.local.username,
newPassword,
baseUrl: nconf.get('BASE_URL'),
}),
text: res.t('passwordResetEmailText', {
username: user.auth.local.username,
newPassword,
baseUrl: nconf.get('BASE_URL'),
}),
html: res.t('passwordResetEmailHtml', {
username: user.auth.local.username,
newPassword,
baseUrl: nconf.get('BASE_URL'),
}),
});
await user.save();
@@ -93,13 +93,13 @@ async function _getUserDataForExport (user) {
userId: user._id,
}).exec();
tasks = _.chain(tasks)
_.chain(tasks)
.map(task => task.toJSON())
.groupBy(task => task.type)
.each((tasksPerType, taskType) => {
userData.tasks[`${taskType}s`] = tasksPerType;
})
.value();
.value(); // to force evaluation
return userData;
}
@@ -29,9 +29,9 @@ api.getFrontPage = {
};
let staticPages = ['front', 'privacy', 'terms', 'features',
'videos', 'contact', 'plans', 'new-stuff', 'community-guidelines',
'old-news', 'press-kit', 'faq', 'overview', 'apps',
'clear-browser-data', 'merch', 'maintenance-info'];
'videos', 'contact', 'plans', 'new-stuff', 'community-guidelines',
'old-news', 'press-kit', 'faq', 'overview', 'apps',
'clear-browser-data', 'merch', 'maintenance-info'];
_.each(staticPages, (name) => {
api[`get${name}Page`] = {
@@ -120,12 +120,12 @@ api.iapiOSVerify = {
let purchaseData = purchaseDataList[index];
let token = purchaseData.transactionId;
let existingReceipt = await IapPurchaseReceipt.findOne({ // eslint-disable-line babel/no-await-in-loop
let existingReceipt = await IapPurchaseReceipt.findOne({ // eslint-disable-line no-await-in-loop
_id: token,
}).exec();
if (!existingReceipt) {
await IapPurchaseReceipt.create({ // eslint-disable-line babel/no-await-in-loop
await IapPurchaseReceipt.create({ // eslint-disable-line no-await-in-loop
_id: token,
consumed: true,
userId: user._id,
@@ -155,7 +155,7 @@ api.iapiOSVerify = {
break;
}
await payments.buyGems({ // eslint-disable-line babel/no-await-in-loop
await payments.buyGems({ // eslint-disable-line no-await-in-loop
user,
paymentMethod: 'IAP AppleStore',
amount,