Skip to content

Commit

Permalink
🎨 Comply with Biome rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Romitou committed Jun 25, 2024
1 parent b7ed676 commit 149a985
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 73 deletions.
11 changes: 11 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,16 @@
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"arrowParentheses": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"quoteStyle": "single",
"quoteProperties": "asNeeded",
"semicolons": "always",
"trailingCommas": "all"
}
}
}
4 changes: 2 additions & 2 deletions components/ActiveBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const props = defineProps({
active: {
type: Boolean,
required: true
}
required: true,
},
});
</script>
14 changes: 8 additions & 6 deletions components/GameCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime.js';
import 'dayjs/locale/fr.js';
import { PropType } from 'vue/dist/vue';
import { Game } from '~/typings/api';
import type { PropType } from 'vue/dist/vue';
import type { Game } from '~/typings/api';
// eslint-disable-next-line import/no-named-as-default-member
dayjs.locale('fr');
Expand All @@ -40,21 +40,23 @@ dayjs.extend(relativeTime);
const props = defineProps({
game: {
type: Object as PropType<Game>,
required: true
required: true,
},
selected: {
type: Boolean,
required: false,
default: false
}
default: false,
},
});
const isArchived = (game: Game) => {
return game.archiveDate !== -1;
};
const format = (timestamp: number) => {
if (!timestamp || timestamp === -1) { return 'À venir'; }
if (!timestamp || timestamp === -1) {
return 'À venir';
}
const formatted = dayjs(timestamp).fromNow();
return formatted.charAt(0).toUpperCase() + formatted.slice(1);
};
Expand Down
6 changes: 3 additions & 3 deletions components/GameLog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
const props = defineProps({
log: {
type: String,
required: true
required: true,
},
last: {
type: Boolean,
required: false,
default: false
}
default: false,
},
});
</script>

Expand Down
8 changes: 4 additions & 4 deletions components/ModifierCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
</template>

<script setup lang="ts">
import { PropType } from 'vue/dist/vue';
import { Modifier } from '~/typings/api';
import type { PropType } from 'vue/dist/vue';
import type { Modifier } from '~/typings/api';
const props = defineProps({
modifier: {
type: Object as PropType<Modifier>,
required: true
}
required: true,
},
});
const getDescription = (modifier: Modifier) => {
Expand Down
8 changes: 4 additions & 4 deletions components/PlayerCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
</template>

<script setup lang="ts">
import { PropType } from 'vue';
import { Member } from '~/typings/api';
import type { PropType } from 'vue';
import type { Member } from '~/typings/api';
const props = defineProps({
player: {
type: Object as PropType<Member>,
required: true
}
required: true,
},
});
</script>

Expand Down
4 changes: 2 additions & 2 deletions components/RankBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
const props = defineProps({
rank: {
type: String,
required: true
}
required: true,
},
});
</script>

Expand Down
1 change: 0 additions & 1 deletion components/UpcomingGame.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

<script setup>
import { SpeakerWaveIcon, XMarkIcon } from '@heroicons/vue/24/outline';
import { useFetch } from '#app';
import dayjs, { extend, locale } from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import 'dayjs/locale/fr';
Expand Down
2 changes: 1 addition & 1 deletion pages/discordLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { useUserStore } from '~/stores/user';
definePageMeta({
layout: 'standalone'
layout: 'standalone',
});
onMounted(() => {
Expand Down
8 changes: 6 additions & 2 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@
</template>

<script setup lang="ts">
import { ArrowDownIcon, ClipboardIcon, ClipboardDocumentCheckIcon, ArrowTopRightOnSquareIcon } from '@heroicons/vue/24/outline';
import {
ArrowDownIcon,
ArrowTopRightOnSquareIcon,
ClipboardDocumentCheckIcon,
ClipboardIcon,
} from '@heroicons/vue/24/outline';
const copied = ref(false);
Expand All @@ -119,7 +124,6 @@ const copy = () => {
copied.value = false;
}, 2000);
};
</script>

<style scoped>
Expand Down
8 changes: 4 additions & 4 deletions plugins/vue3-toastify.client.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import Vue3Toastify, { Options, toast } from 'vue3-toastify';
import Vue3Toastify, { type Options, toast } from 'vue3-toastify';
import { defineNuxtPlugin } from '#app';
import 'vue3-toastify/dist/index.css';

export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(Vue3Toastify, {
theme: 'dark',
position: 'bottom-right'
} as Options as any);
position: 'bottom-right',
} as Options);

return {
provide: { toast }
provide: { toast },
};
});
88 changes: 44 additions & 44 deletions typings/api.ts
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
export interface Member {
name: string;
rank: string;
uuid: string;
kills: number;
deaths: number;
wins: number;
name: string;
rank: string;
uuid: string;
kills: number;
deaths: number;
wins: number;
}

export interface Modifier {
name: string;
enabled: boolean;
material: string;
description: string[];
web: string[];
name: string;
enabled: boolean;
material: string;
description: string[];
web: string[];
}

export interface Team {
name: string;
colors: number[];
name: string;
colors: number[];
}

export interface Game {
id: number;
name: string;
type: string;
status: string;
alive: string[];
players: string[];
modifiers: string[] | undefined;
logs: string[];
moles: string[] | undefined;
teams: Team[] | undefined;
events: string[] | undefined;
playerRoles: Record<string, string> | undefined;
playerTeams: Record<string, string> | undefined;
finalTeams: Record<string, string> | undefined;
hours: number;
minutes: number;
seconds: number;
startDate: number;
scheduleDate: number;
archiveDate: number;
id: number;
name: string;
type: string;
status: string;
alive: string[];
players: string[];
modifiers: string[] | undefined;
logs: string[];
moles: string[] | undefined;
teams: Team[] | undefined;
events: string[] | undefined;
playerRoles: Record<string, string> | undefined;
playerTeams: Record<string, string> | undefined;
finalTeams: Record<string, string> | undefined;
hours: number;
minutes: number;
seconds: number;
startDate: number;
scheduleDate: number;
archiveDate: number;
}

export interface GameResponse {
games: Game[];
archivedGames: Game[];
games: Game[];
archivedGames: Game[];
}

export interface Stats {
games: number;
members: number;
modifiers: number;
games: number;
members: number;
modifiers: number;
}

export interface DiscordProfile {
id: number;
username: string;
id: number;
username: string;
}

export interface MinecraftProfile {
uuid: string;
username: string;
uuid: string;
username: string;
}

export interface User {
discordProfile: DiscordProfile;
minecraftProfile: MinecraftProfile;
discordProfile: DiscordProfile;
minecraftProfile: MinecraftProfile;
}

0 comments on commit 149a985

Please sign in to comment.