mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
start upgrading eslint
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import i18n from '../i18n';
|
||||
import each from 'lodash/each';
|
||||
import i18n from '../i18n';
|
||||
import { capByLevel } from '../statHelpers';
|
||||
import { MAX_LEVEL } from '../constants';
|
||||
import {
|
||||
@@ -18,7 +18,7 @@ export default function rebirth (user, tasks = [], req = {}, analytics) {
|
||||
throw new NotAuthorized(i18n.t('notEnoughGems', req.language));
|
||||
}
|
||||
|
||||
let analyticsData = {
|
||||
const analyticsData = {
|
||||
uuid: user._id,
|
||||
category: 'behavior',
|
||||
};
|
||||
@@ -37,9 +37,9 @@ export default function rebirth (user, tasks = [], req = {}, analytics) {
|
||||
analytics.track('Rebirth', analyticsData);
|
||||
}
|
||||
|
||||
let lvl = capByLevel(user.stats.lvl);
|
||||
const lvl = capByLevel(user.stats.lvl);
|
||||
|
||||
each(tasks, function resetTasks (task) {
|
||||
each(tasks, task => {
|
||||
if (!task.challenge || !task.challenge.id || task.challenge.broken) {
|
||||
if (task.type !== 'reward') {
|
||||
task.value = 0;
|
||||
@@ -56,7 +56,7 @@ export default function rebirth (user, tasks = [], req = {}, analytics) {
|
||||
|
||||
removePinnedGearByClass(user);
|
||||
|
||||
let stats = user.stats;
|
||||
const { stats } = user;
|
||||
stats.buffs = {};
|
||||
stats.hp = 50;
|
||||
stats.lvl = 1;
|
||||
@@ -64,7 +64,7 @@ export default function rebirth (user, tasks = [], req = {}, analytics) {
|
||||
|
||||
user.preferences.automaticAllocation = false;
|
||||
|
||||
each(USERSTATSLIST, function resetStats (value) {
|
||||
each(USERSTATSLIST, value => {
|
||||
stats[value] = 0;
|
||||
});
|
||||
|
||||
@@ -86,7 +86,7 @@ export default function rebirth (user, tasks = [], req = {}, analytics) {
|
||||
});
|
||||
}
|
||||
|
||||
let flags = user.flags;
|
||||
const { flags } = user;
|
||||
flags.itemsEnabled = false;
|
||||
flags.dropsEnabled = false;
|
||||
flags.classSelected = false;
|
||||
@@ -110,7 +110,7 @@ export default function rebirth (user, tasks = [], req = {}, analytics) {
|
||||
user.stats.buffs = {};
|
||||
|
||||
return [
|
||||
{user, tasks},
|
||||
{ user, tasks },
|
||||
i18n.t('rebirthComplete'),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user