start upgrading eslint

This commit is contained in:
Matteo Pagliazzi
2019-10-08 16:57:10 +02:00
parent 90c917f69e
commit 621787915c
304 changed files with 5992 additions and 6394 deletions

View File

@@ -1,6 +1,6 @@
import { last } from 'lodash';
import shared from '../../../common';
import { model as User } from '../../models/user';
import { last } from 'lodash';
// Build a list of gear items owned by default
const defaultOwnedGear = {};
@@ -14,7 +14,7 @@ Object.keys(shared.content.gear.flat).forEach(key => {
export function getDefaultOwnedGear () {
// Clone to avoid modifications to the original object
return Object.assign({}, defaultOwnedGear);
return { ...defaultOwnedGear };
}
// When passed a path to an item in the user object it'll return true if
@@ -62,18 +62,18 @@ export function validateItemPath (itemPath) {
// will be converted to the number 5
export function castItemVal (itemPath, itemVal) {
if (
itemPath.indexOf('items.pets') === 0 ||
itemPath.indexOf('items.eggs') === 0 ||
itemPath.indexOf('items.hatchingPotions') === 0 ||
itemPath.indexOf('items.food') === 0 ||
itemPath.indexOf('items.quests') === 0
itemPath.indexOf('items.pets') === 0
|| itemPath.indexOf('items.eggs') === 0
|| itemPath.indexOf('items.hatchingPotions') === 0
|| itemPath.indexOf('items.food') === 0
|| itemPath.indexOf('items.quests') === 0
) {
return Number(itemVal);
}
if (
itemPath.indexOf('items.mounts') === 0 ||
itemPath.indexOf('items.gear.owned') === 0
itemPath.indexOf('items.mounts') === 0
|| itemPath.indexOf('items.gear.owned') === 0
) {
if (itemVal === 'true') return true;
if (itemVal === 'false') return false;
@@ -82,4 +82,4 @@ export function castItemVal (itemPath, itemVal) {
}
return itemVal;
}
}