Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescri
import pluginVitest from '@vitest/eslint-plugin'
import pluginPlaywright from 'eslint-plugin-playwright'
import i18nJsonPlugin from 'eslint-plugin-i18n-json'
import path from 'path'
import path from 'node:path'

export default defineConfigWithVueTs(
{
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<link rel="mask-icon" href="/img/icons/maskable-icon-512x512.png" color="#fff">
<!-- Matomo Tracking: Cookie-less and GDPR-conformant -->
<script>
var _paq = window._paq = window._paq || [];
var _paq = globalThis._paq = globalThis._paq || [];
(function() {
var u="//matomo.brdgm.me/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
Expand Down
32 changes: 4 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"generate-pwa-assets": "pwa-assets-generator"
},
"dependencies": {
"@brdgm/brdgm-commons": "^1.8.0",
"@brdgm/brdgm-commons": "^1.8.1",
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.3",
"core-js": "^3.41.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/setup/DifficultyLevel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default defineComponent({
},
methods: {
updateDifficultyLevel(event: Event) {
this.difficultyLevel = parseInt((event.target as HTMLInputElement).value)
this.difficultyLevel = Number.parseInt((event.target as HTMLInputElement).value)
this.state.setup.difficultyLevel = this.difficultyLevel
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/services/ConstructionCards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const cards : ConstructionCard[] = [
]

const cardsMap = new Map<number,ConstructionCard>()
cards.forEach(card => cardsMap.set(card.id, card))
for (const card of cards) {
cardsMap.set(card.id, card)
}

export default {

Expand Down
4 changes: 3 additions & 1 deletion src/services/DraftingPriorityCards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ const cards : DraftingPriorityCard[] = [
]

const cardsMap = new Map<number,DraftingPriorityCard>()
cards.forEach(card => cardsMap.set(card.id, card))
for (const card of cards) {
cardsMap.set(card.id, card)
}

export default {

Expand Down
4 changes: 3 additions & 1 deletion src/services/DraftingRowCards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ const cards : DraftingRowCard[] = [
]

const cardsMap = new Map<number,DraftingRowCard>()
cards.forEach(card => cardsMap.set(card.id, card))
for (const card of cards) {
cardsMap.set(card.id, card)
}

export default {

Expand Down
4 changes: 3 additions & 1 deletion src/services/WarCards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ const cards : WarCard[] = [
]

const cardsMap = new Map<number,WarCard>()
cards.forEach(card => cardsMap.set(card.id, card))
for (const card of cards) {
cardsMap.set(card.id, card)
}

export default {

Expand Down
2 changes: 1 addition & 1 deletion src/store/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const useStateStore = defineStore(`${name}.state`, {
state: () => {
return {
language: 'en',
baseFontSize: 1.0,
baseFontSize: 1,
setup: {
difficultyLevel: DifficultyLevel.NORMAL
},
Expand Down
2 changes: 1 addition & 1 deletion src/util/getTechColor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Tech from '@/services/enum/Tech'
* @param tech Tech card
* @returns Color code
*/
export default function(tech: Tech) : string {
export default function getTechColor(tech: Tech) : string {
switch (tech) {
case Tech.AGRICULTURE: return '#47914d'
case Tech.ARMY: return '#ce372f'
Expand Down
2 changes: 1 addition & 1 deletion src/util/getTechDuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Tech from '@/services/enum/Tech'
* @param round Age
* @returns Tech duration
*/
export default function(tech: Tech, round: number) : number {
export default function getTechDuration(tech: Tech, round: number) : number {
const index = round - 1
switch (tech) {
case Tech.AGRICULTURE: return [2,3,1,2,1,1,2,1][index]
Expand Down
2 changes: 1 addition & 1 deletion src/util/toTech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import TechPlaceholder from '@/services/enum/TechPlaceholder'
* Converts tech placeholder to undefined, keeps tech as is.
* @returns Tech or undefined
*/
export default function(tech: (Tech|TechPlaceholder)) : Tech|undefined {
export default function toTech(tech: (Tech|TechPlaceholder)) : Tech|undefined {
if (tech == TechPlaceholder.BLANK || tech == TechPlaceholder.EMPTY) {
return undefined
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/helper/mockRound.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Player from '@/services/enum/Player'
import { BotCardsPersistence, ProsperityCardsPersistence, Round, RowPlaceholdersPersistence, TechCardSelectionPersistence } from '@/store/state'

export default function (params?: MockRoundParams) : Round {
export default function mockRound(params?: MockRoundParams) : Round {
const round : Round = {
round: params?.round ?? 1,
startPlayer: params?.startPlayer ?? Player.PLAYER,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/helper/mockRouteLocation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LocationQuery, RouteLocation, RouteMeta, RouteParams, RouteRecord, RouteRecordName } from 'vue-router'

export default function (params?: MockRouteLocationParams) : RouteLocation {
export default function mockRouteLocation(params?: MockRouteLocationParams) : RouteLocation {
return {
name: params?.name,
path: params?.path ?? '',
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/helper/mockState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import DifficultyLevel from '@/services/enum/DifficultyLevel'
import Player from '@/services/enum/Player'
import { Round, State } from '@/store/state'

export default function (params?: MockStateParams) : State {
export default function mockState(params?: MockStateParams) : State {
return {
language: 'en',
baseFontSize: 1,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/services/RowPlaceholders.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ describe('services/RowPlaceholders', () => {
const rowPlaceholders = RowPlaceholders.new()

expect(rowPlaceholders.rows.length).to.eq(2)
rowPlaceholders.rows.forEach(row => {
for (const row of rowPlaceholders.rows) {
expect(row).to.greaterThanOrEqual(1)
expect(row).to.lessThanOrEqual(4)
})
}

const persistence = rowPlaceholders.toPersistence()
expect(persistence.rows.length).to.eq(2)
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { VitePWA } from 'vite-plugin-pwa'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import path from 'path'
import path from 'node:path'
import { description, appDeployName } from './package.json'
import legacy from '@vitejs/plugin-legacy'

Expand Down