Skip to content

Commit 834eeb8

Browse files
authored
fix: lint, format, types
1 parent 54c51ea commit 834eeb8

12 files changed

Lines changed: 110 additions & 46 deletions

File tree

scripts/cnf-fcen-qa.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env node
2-
/* eslint-env node */
3-
// 'use strict' removed to allow usage of global 'console'
42
/* global process */
3+
// 'use strict' removed to allow usage of global 'console'
54

65
import fs from 'fs'
76
import path from 'path'

scripts/test/loaders.stream.test.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-env node */
21
import { describe, it, expect, beforeEach, afterEach } from 'vitest'
32
import fs from 'fs'
43
import path from 'path'

src/App.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ onMounted(() => {
3434

3535
<!-- Main Content -->
3636
<main
37-
id="content" class="min-h-screen transition-all duration-300" :class="[
38-
'lg:ml-24', // Desktop: Add left margin for side rail
39-
'pt-14 lg:pt-0', // Mobile: Add top padding for top bar
40-
'pb-20 lg:pb-4' // Mobile: Add bottom padding for bottom nav
41-
]">
37+
id="content"
38+
class="min-h-screen transition-all duration-300"
39+
:class="[
40+
'lg:ml-24', // Desktop: Add left margin for side rail
41+
'pt-14 lg:pt-0', // Mobile: Add top padding for top bar
42+
'pb-20 lg:pb-4' // Mobile: Add bottom padding for bottom nav
43+
]"
44+
>
4245
<div class="container mx-auto px-4 py-3">
4346
<!-- KeepAlive preserves component instances for stateful views (active session,
4447
active filters) across navigation, avoiding costly re-mounts. -->

src/components/base/BaseBottomNav.vue

Lines changed: 69 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,42 @@
11
<template>
2-
<nav class="fixed bottom-0 left-0 right-0 z-30 lg:hidden" :class="navClasses"
3-
:aria-label="$t('navigation.mainNavigation')">
2+
<nav
3+
class="fixed bottom-0 left-0 right-0 z-30 lg:hidden"
4+
:class="navClasses"
5+
:aria-label="$t('navigation.mainNavigation')"
6+
>
47
<div class="flex justify-around items-center h-16 px-2 pb-safe">
5-
<RouterLink v-for="item in bottomNavItems" :key="item.to" :to="item.to" class="nav-item relative"
6-
:class="navItemClasses(item.to)" :aria-label="item.label">
8+
<RouterLink
9+
v-for="item in bottomNavItems"
10+
:key="item.to"
11+
:to="item.to"
12+
class="nav-item relative"
13+
:class="navItemClasses(item.to)"
14+
:aria-label="item.label"
15+
>
716
<component :is="item.icon" class="w-6 h-6" />
8-
<span v-if="item.showBadge"
9-
class="absolute top-1 right-1 w-2 h-2 bg-primary-600 dark:bg-primary-400 rounded-full" aria-hidden="true" />
17+
<span
18+
v-if="item.showBadge"
19+
class="absolute top-1 right-1 w-2 h-2 bg-primary-600 dark:bg-primary-400 rounded-full"
20+
aria-hidden="true"
21+
/>
1022
<span class="sr-only">{{ item.label }}</span>
1123
</RouterLink>
1224

1325
<!-- Menu Button -->
14-
<button type="button" class="nav-item relative" :class="menuButtonClasses" :aria-label="$t('navigation.menu')"
15-
@click="showMenu = true">
26+
<button
27+
type="button"
28+
class="nav-item relative"
29+
:class="menuButtonClasses"
30+
:aria-label="$t('navigation.menu')"
31+
@click="showMenu = true"
32+
>
1633
<MoreHorizontalIcon class="w-6 h-6" />
1734
<!-- Show badge if any overflow item has a badge -->
18-
<span v-if="hasOverflowBadge"
19-
class="absolute top-1 right-1 w-2 h-2 bg-primary-600 dark:bg-primary-400 rounded-full" aria-hidden="true" />
35+
<span
36+
v-if="hasOverflowBadge"
37+
class="absolute top-1 right-1 w-2 h-2 bg-primary-600 dark:bg-primary-400 rounded-full"
38+
aria-hidden="true"
39+
/>
2040
<span class="sr-only">{{ $t('navigation.menu') }}</span>
2141
</button>
2242
</div>
@@ -26,34 +46,45 @@
2646
<BaseModal v-model:open="showMenu" :title="$t('navigation.menu')" size="sm">
2747
<nav class="space-y-2">
2848
<!-- Navigation Items (Home, About, Settings) -->
29-
<RouterLink v-for="item in overflowItems" :key="item.to" :to="item.to"
49+
<RouterLink
50+
v-for="item in overflowItems"
51+
:key="item.to"
52+
:to="item.to"
3053
class="flex items-center justify-between px-4 py-3 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors duration-150"
31-
@click="showMenu = false">
54+
@click="showMenu = false"
55+
>
3256
<div class="flex items-center space-x-3">
3357
<component :is="item.icon" class="w-5 h-5" />
3458
<span>{{ item.label }}</span>
3559
</div>
3660
<!-- Badge indicator for items with notifications -->
37-
<span v-if="item.showBadge" class="w-2 h-2 bg-primary-600 dark:bg-primary-400 rounded-full"
38-
aria-hidden="true" />
61+
<span
62+
v-if="item.showBadge"
63+
class="w-2 h-2 bg-primary-600 dark:bg-primary-400 rounded-full"
64+
aria-hidden="true"
65+
/>
3966
</RouterLink>
4067

4168
<!-- Divider -->
4269
<hr class="border-gray-200 dark:border-gray-700" />
4370

4471
<!-- Theme Toggle -->
45-
<button type="button"
72+
<button
73+
type="button"
4674
class="flex items-center space-x-3 px-4 py-3 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors duration-150 w-full text-left"
47-
@click="toggleTheme">
75+
@click="toggleTheme"
76+
>
4877
<SunIcon v-if="isDark" class="w-5 h-5" />
4978
<MoonIcon v-else class="w-5 h-5" />
5079
<span>{{ isDark ? $t('theme.light') : $t('theme.dark') }}</span>
5180
</button>
5281

5382
<!-- Language Toggle -->
54-
<button type="button"
83+
<button
84+
type="button"
5585
class="flex items-center space-x-3 px-4 py-3 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors duration-150 w-full text-left"
56-
@click="toggleLanguage">
86+
@click="toggleLanguage"
87+
>
5788
<LanguagesIcon class="w-5 h-5" />
5889
<span>{{ locale === 'en' ? 'Français' : 'English' }}</span>
5990
</button>
@@ -62,24 +93,37 @@
6293
<hr class="border-gray-200 dark:border-gray-700" />
6394

6495
<!-- GitHub Link -->
65-
<a href="https://github.com/gcharest/gluko" target="_blank" rel="noopener"
96+
<a
97+
href="https://github.com/gcharest/gluko"
98+
target="_blank"
99+
rel="noopener"
66100
class="flex items-center space-x-3 px-4 py-3 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors duration-150"
67-
@click="showMenu = false">
101+
@click="showMenu = false"
102+
>
68103
<!-- GitHub icon from Simple Icons -->
69-
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
104+
<svg
105+
class="w-5 h-5"
106+
viewBox="0 0 24 24"
107+
fill="currentColor"
108+
xmlns="http://www.w3.org/2000/svg"
109+
>
70110
<path
71-
d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
111+
d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"
112+
/>
72113
</svg>
73114
<span>{{ $t('navigation.sourceCode') }}</span>
74115
</a>
75116
</nav>
76117

77118
<!-- Version Info -->
78119
<div
79-
class="mt-6 pt-4 border-t border-gray-200 dark:border-gray-700 text-center text-sm text-gray-500 dark:text-gray-400">
120+
class="mt-6 pt-4 border-t border-gray-200 dark:border-gray-700 text-center text-sm text-gray-500 dark:text-gray-400"
121+
>
80122
<p>Gluko © Guillaume Charest 2021-2023</p>
81-
<p class="text-xs">ver. {{ version }} ({{ $t('settings.app.buildDate') }} {{ buildDate }}, {{
82-
$t('settings.app.deployDate') }} {{ deployDate }})</p>
123+
<p class="text-xs">
124+
ver. {{ version }} ({{ $t('settings.app.buildDate') }} {{ buildDate }},
125+
{{ $t('settings.app.deployDate') }} {{ deployDate }})
126+
</p>
83127
</div>
84128
</BaseModal>
85129
</template>

src/components/base/BaseFooter.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ const deployDate = new Date(__DEPLOY_DATE__).toISOString().slice(0, 10)
1212
<span class="text-muted small">
1313
Gluko © Guillaume Charest 2021-2023
1414
<br class="d-sm-none" />
15-
<span class="d-none d-sm-inline">| </span>ver. {{ version }} ({{ $t('settings.app.buildDate') }} {{
16-
buildDate }}, {{ $t('settings.app.deployDate') }} {{ deployDate }})
15+
<span class="d-none d-sm-inline">| </span>ver. {{ version }} ({{
16+
$t('settings.app.buildDate')
17+
}}
18+
{{ buildDate }}, {{ $t('settings.app.deployDate') }} {{ deployDate }})
1719
</span>
1820
</div>
1921
</div>

src/components/calculator/MealCalculator.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ import { useToast } from '@/composables/useToast'
88
import type { Nutrient } from '@/types/meal-history'
99
import { BookPlusIcon } from 'lucide-vue-next'
1010
11-
const ConfirmationModal = defineAsyncComponent(() => import('@/components/modals/ConfirmationModal.vue'))
11+
const ConfirmationModal = defineAsyncComponent(
12+
() => import('@/components/modals/ConfirmationModal.vue')
13+
)
1214
const SaveMealModal = defineAsyncComponent(() => import('@/components/modals/SaveMealModal.vue'))
13-
const TagManagementModal = defineAsyncComponent(() => import('@/components/modals/TagManagementModal.vue'))
15+
const TagManagementModal = defineAsyncComponent(
16+
() => import('@/components/modals/TagManagementModal.vue')
17+
)
1418
1519
const store = useMealStore()
1620
const toast = useToast()

src/components/nutrients/NutrientListItem.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import BaseCard from '@/components/base/BaseCard.vue'
66
import BaseButton from '@/components/base/BaseButton.vue'
77
import { EditIcon, TrashIcon } from 'lucide-vue-next'
88
9-
const ConfirmationModal = defineAsyncComponent(() => import('@/components/modals/ConfirmationModal.vue'))
9+
const ConfirmationModal = defineAsyncComponent(
10+
() => import('@/components/modals/ConfirmationModal.vue')
11+
)
1012
1113
const mealStore = useMealStore()
1214
const props = defineProps({

src/i18n/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,4 +552,4 @@
552552
"whyTitle": "Why Gluko?",
553553
"whyDescription": "Managing Type 1 Diabetes requires constant attention to carbohydrate intake for proper insulin dosing. Gluko makes this easier by providing quick access to reliable nutritional information, enabling easy calculation of complex meals, and supporting families and caregivers with comprehensive meal tracking."
554554
}
555-
}
555+
}

src/i18n/locales/fr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,4 +546,4 @@
546546
"whyTitle": "Pourquoi Gluko?",
547547
"whyDescription": "La gestion du diabète de type 1 nécessite une attention constante à l'apport en glucides pour un dosage approprié de l'insuline. Gluko facilite cela en fournissant un accès rapide à des informations nutritionnelles fiables, en permettant le calcul facile de repas complexes et en soutenant les familles et les soignants avec un suivi complet des repas."
548548
}
549-
}
549+
}

src/stores/nutrientsFile.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const tokenizeWithAccents = (str: string) => {
4040
.toLowerCase()
4141
.normalize('NFD') // Decompose accented characters
4242
.replace(/[\u0300-\u036f]/g, '') // Remove diacritics (é → e, ç → c, etc.)
43-
.split(/[\s\-\.\/,]+/) // Split on whitespace and common separators
43+
.split(/[\s\-.,/]+/) // Split on whitespace and common separators
4444
.filter((token) => token.length > 0)
4545
}
4646

@@ -60,7 +60,13 @@ export const useNutrientFileStore = defineStore('nutrientsFile', () => {
6060
const initializeSearch = () => {
6161
miniSearch = new MiniSearch<NutrientFile>({
6262
fields: ['FoodDescription', 'FoodDescriptionF'],
63-
storeFields: ['FoodID', 'FoodDescription', 'FoodDescriptionF', 'FoodGroupName', 'FoodGroupNameF'],
63+
storeFields: [
64+
'FoodID',
65+
'FoodDescription',
66+
'FoodDescriptionF',
67+
'FoodGroupName',
68+
'FoodGroupNameF'
69+
],
6470
idField: 'FoodID',
6571
tokenize: tokenizeWithAccents,
6672
processTerm: (term: string) => term || null,

0 commit comments

Comments
 (0)