Fix more build errors

This commit is contained in:
Matt Isenhower 2024-11-07 08:52:01 -08:00
parent 542245964b
commit 2997c985d2
8 changed files with 16 additions and 24 deletions

View File

@ -9,7 +9,7 @@ module.exports = {
],
'rules': {
// ESLint
'indent': ['warn', 2, { 'SwitchCase': 1 }],
// 'indent': ['warn', 2, { 'SwitchCase': 1 }],
'comma-dangle': ['warn', 'always-multiline'],
'no-unused-vars': ['warn', { 'args': 'none' }],
'semi': 'warn',
@ -21,6 +21,8 @@ module.exports = {
'vue/require-default-prop': 'off',
'vue/max-attributes-per-line': ['warn', { singleline: { max: 4 } }],
'vue/html-self-closing': ['warn', { html: { void: 'always' } }],
'vue/no-deprecated-filter': 'off',
'vue/require-toggle-inside-transition': 'off',
},
'globals': {
'__dirname': 'readonly',
@ -29,26 +31,12 @@ module.exports = {
'module': 'readonly',
'Buffer': 'readonly',
},
'overrides': [
{
'files': ['src/**'],
'rules': {
'@dword-design/import-alias/prefer-alias': ['warn', { 'alias': {
'@': './src',
} }],
},
},
],
'env': {
'vue/setup-compiler-macros': true,
},
'ignorePatterns': [
'src/assets/i18n/index.mjs', // "assert" syntax is currently unrecognized
],
'parserOptions': {
'ecmaVersion': 2022,
'sourceType': 'module',
},
settings: {
// ...createAliasSetting({
// '@': './src',

View File

@ -124,14 +124,15 @@ class SplatfestTweet extends TwitterPostBase {
return `Reminder: The ${isGlobal ? 'global' : regionDemonyms} Splatfest starts in ${data.text}! #splatfest #splatoon2`;
return `Reminder: The Splatfest starts in ${this.regionInfo.name} in ${data.text}! #splatfest #splatoon2`;
case 'end':
case 'end': {
let hours = (data.festival.times.result - this.getDataTime()) / 60 / 60;
let duration = (hours == 1) ? '1 hour' : `${hours} hours`;
if (isSimultaneous)
return `The ${isGlobal ? 'global' : regionDemonyms} Splatfest is now closed. Results will be posted in ${duration}! #splatfest #splatoon2`;
return `The Splatfest is now closed in ${this.regionInfo.name}. Results will be posted in ${duration}! #splatfest #splatoon2`;
}
case 'result':
case 'result': {
let winner = data.results.summary.total ? 'bravo' : 'alpha';
// Just hardcoding this in here for now to avoid dealing with loading the Vuex store separately
@ -141,6 +142,7 @@ class SplatfestTweet extends TwitterPostBase {
let results = resultsFormat.replace('{team}', teamName);
return `${isGlobal ? 'Global' : regionDemonyms} Splatfest results: ${results} #splatfest #splatoon2`;
}
}
}
}

View File

@ -154,7 +154,7 @@ class Updater {
return false;
// Remove timeline items with an importance of -1
if (value.hasOwnProperty('importance'))
if ('importance' in value)
return value.importance > -1;
return true;

View File

@ -22,7 +22,7 @@ module.exports = async function retrieveGearData() {
// Find all gear and skills
let players = [battleData.player_result].concat(battleData.my_team_members, battleData.other_team_members);
for (player of players) {
for (let player of players) {
// Get the main and sub skills for each type of gear
let gearSkills = [
player.player.head_skills.main,
@ -30,13 +30,13 @@ module.exports = async function retrieveGearData() {
player.player.shoes_skills.main,
].concat(player.player.head_skills.subs, player.player.clothes_skills.subs, player.player.shoes_skills.subs);
for (skill of gearSkills) {
for (let skill of gearSkills) {
if (skill)
skills[skill.id] = skill;
}
// Get brands
for (brand of [player.player.head.brand, player.player.clothes.brand, player.player.shoes.brand])
for (let brand of [player.player.head.brand, player.player.clothes.brand, player.player.shoes.brand])
brands[brand.id] = brand;
// Get gear

View File

@ -40,6 +40,7 @@ module.exports = async () => {
// Update gear/brand/skill data from SplatNet
// (This takes a while and doesn't need to be updated frequently, so just disabling this here for now)
// eslint-disable-next-line no-constant-condition
if (false) {
let gearData = await retrieveGearData();
@ -66,6 +67,7 @@ module.exports = async () => {
let regex = /\{\{GearList\/Item.*?filter_brand/g;
let row;
// eslint-disable-next-line no-cond-assign
while (row = regex.exec(response.data)) {
// Format: name=value|brand=value|...
let details = row[0].split('|')

View File

@ -277,7 +277,7 @@ export default {
this.startUpdatingNow();
this.startUpdatingData();
},
beforeDestroy() {
beforeUnmount() {
this.stopUpdatingNow();
this.stopUpdatingData();
this.shutdown();

View File

@ -66,7 +66,7 @@ export default {
mounted() {
opened(this);
},
beforeDestroy() {
beforeUnmount() {
closed(this);
},
methods: {

View File

@ -72,7 +72,7 @@ function generateModule(region) {
allSplatfests(state, getters, rootState, rootGetters) {
return rootGetters['splatoon/splatfests/allSplatfests']
&& rootGetters['splatoon/splatfests/allSplatfests']
.filter(s => s.regions.hasOwnProperty(region)) // Only show Splatfests for this region
.filter(s => region in s.regions) // Only show Splatfests for this region
.map(s => ({ ...s, ...s.regions[region] })); // Apply this region's data
},
currentSplatfest(state, getters, { splatoon }) {