Bruno Predot

Merge tag '0.3.2' into develop

0.3.2
@@ -37,8 +37,12 @@ defineProps({ @@ -37,8 +37,12 @@ defineProps({
37 </div> 37 </div>
38 </div> 38 </div>
39 <div class="p-4"> 39 <div class="p-4">
40 - <h2 class="text-lg font-bold mb-1 line-clamp-1">{{ movie.title }}</h2> 40 + <h2 class="text-lg font-bold mb-1 line-clamp-1">
41 - <p class="text-sm text-gray-400">{{ useDateFormat(movie.release_date, "DD-MM-YYYY") }}</p> 41 + {{ movie.title }}
  42 + </h2>
  43 + <p class="text-sm text-gray-400">
  44 + {{ useDateFormat(movie.release_date, "DD-MM-YYYY") }}
  45 + </p>
42 </div> 46 </div>
43 </section> 47 </section>
44 </template> 48 </template>
@@ -47,7 +47,9 @@ watch( @@ -47,7 +47,9 @@ watch(
47 {{ comment.rating }} 47 {{ comment.rating }}
48 </section> 48 </section>
49 </div> 49 </div>
50 - <p :id="`message${index}`" class="text-gray-300">{{ comment.message }}</p> 50 + <p :id="`message${index}`" class="text-gray-300">
  51 + {{ comment.message }}
  52 + </p>
51 </div> 53 </div>
52 </section> 54 </section>
53 <!-- Si aucun commentaire --> 55 <!-- Si aucun commentaire -->
1 <script lang="ts" setup> 1 <script lang="ts" setup>
2 //#region --Props--. 2 //#region --Props--.
3 -const props = defineProps({ 3 +defineProps({
4 score: { 4 score: {
5 type: Number, 5 type: Number,
6 required: true, 6 required: true,
@@ -35,7 +35,9 @@ const formatVoteCount = (count: number) => { @@ -35,7 +35,9 @@ const formatVoteCount = (count: number) => {
35 </section> 35 </section>
36 <section> 36 <section>
37 <p class="font-semibold">Note TMDB</p> 37 <p class="font-semibold">Note TMDB</p>
38 - <div class="text-sm text-gray-400">{{ formatVoteCount(nbVote) }}</div> 38 + <div class="text-sm text-gray-400">
  39 + {{ formatVoteCount(nbVote) }}
  40 + </div>
39 </section> 41 </section>
40 </section> 42 </section>
41 </template> 43 </template>
@@ -56,9 +56,9 @@ const formData = reactive({ @@ -56,9 +56,9 @@ const formData = reactive({
56 const v$ = useVuelidate(rules, formData); 56 const v$ = useVuelidate(rules, formData);
57 //#endregion 57 //#endregion
58 58
59 -const errormessages = computed(() => { 59 +// const errormessages = computed(() => {
60 - return v$.value.message.$errors.map((e) => e.$message); 60 +// return v$.value.message.$errors.map((e) => e.$message);
61 -}); 61 +// });
62 62
63 //#region --Function--. 63 //#region --Function--.
64 async function submitComment() { 64 async function submitComment() {
@@ -129,7 +129,7 @@ function handleMessageEvent(event: string) { @@ -129,7 +129,7 @@ function handleMessageEvent(event: string) {
129 </span> 129 </span>
130 <span v-else>Publier le commentaire</span> 130 <span v-else>Publier le commentaire</span>
131 </v-btn> 131 </v-btn>
132 - <v-btn class="mt-6 mr-4" color="primary" @click="clear"> effacer</v-btn> 132 + <v-btn class="mt-6 mr-4" color="primary" @click="clear"> effacer </v-btn>
133 </VForm> 133 </VForm>
134 </section> 134 </section>
135 </template> 135 </template>
1 // @ts-check 1 // @ts-check
2 import withNuxt from "./.nuxt/eslint.config.mjs"; 2 import withNuxt from "./.nuxt/eslint.config.mjs";
  3 +import js from "@eslint/js";
  4 +import eslintPluginVue from "eslint-plugin-vue";
  5 +import ts from "typescript-eslint";
3 6
4 -export default withNuxt(); 7 +export default withNuxt(
5 -// Your custom configs here 8 + // Your custom configs here
  9 + js.configs.recommended,
  10 + ...ts.configs.recommended,
  11 + ...eslintPluginVue.configs["flat/recommended"],
  12 + {
  13 + files: ["*.vue", "**/*.vue"],
  14 + languageOptions: {
  15 + parserOptions: {
  16 + parser: "@typescript-eslint/parser",
  17 + },
  18 + },
  19 + rules: {
  20 + "vue/multi-word-component-names": "off",
  21 + },
  22 + },
  23 + // your custom flat configs go here, for example:
  24 + // {
  25 + // files: ['**/*.ts', '**/*.tsx'],
  26 + // rules: {
  27 + // 'no-console': 'off' // allow console.log in TypeScript files
  28 + // }
  29 + // },
  30 + // {
  31 + // ...
  32 + // }
  33 +);
@@ -9,8 +9,8 @@ export interface CreditInterface { @@ -9,8 +9,8 @@ export interface CreditInterface {
9 9
10 export type CreditsResponse = { 10 export type CreditsResponse = {
11 id: number; 11 id: number;
12 - cast: CreditInterface[], 12 + cast: CreditInterface[];
13 - crew: CreditInterface[], 13 + crew: CreditInterface[];
14 movie_id: unknown; 14 movie_id: unknown;
15 movie: MovieInterface; 15 movie: MovieInterface;
16 -} 16 +};
1 -import type { CreditInterface, CreditsResponse } from "~/interfaces/credit"; 1 +import type { CreditsResponse } from "~/interfaces/credit";
2 2
3 export interface MovieInterface { 3 export interface MovieInterface {
4 id: number; 4 id: number;
@@ -12,7 +12,7 @@ export interface MovieInterface { @@ -12,7 +12,7 @@ export interface MovieInterface {
12 popularity: number; 12 popularity: number;
13 poster_path: string | null; 13 poster_path: string | null;
14 release_date: string; 14 release_date: string;
15 - runtime: number 15 + runtime: number;
16 title: string; 16 title: string;
17 video: boolean; 17 video: boolean;
18 vote_average: number; 18 vote_average: number;
@@ -21,6 +21,6 @@ export interface MovieInterface { @@ -21,6 +21,6 @@ export interface MovieInterface {
21 } 21 }
22 22
23 export type Genre = { 23 export type Genre = {
24 - id: number, 24 + id: number;
25 - name: string, 25 + name: string;
26 -} 26 +};
@@ -22,10 +22,10 @@ export class MovieComment extends Model { @@ -22,10 +22,10 @@ export class MovieComment extends Model {
22 return { 22 return {
23 // Attributs. 23 // Attributs.
24 id: this.uid(), 24 id: this.uid(),
25 - createdAt: this.string(''), 25 + createdAt: this.string(""),
26 - username: this.string(''), 26 + username: this.string(""),
27 - message: this.string(''), 27 + message: this.string(""),
28 - rating: this.string(''), 28 + rating: this.string(""),
29 // Relations. 29 // Relations.
30 movie_id: this.attr(null), 30 movie_id: this.attr(null),
31 movie: this.belongsTo(Movie, "movie_id", "id"), 31 movie: this.belongsTo(Movie, "movie_id", "id"),
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 "generate": "nuxt generate", 9 "generate": "nuxt generate",
10 "preview": "nuxt preview", 10 "preview": "nuxt preview",
11 "postinstall": "nuxt prepare", 11 "postinstall": "nuxt prepare",
12 - "lint:js": "eslint --ext \".ts,.vue\" .", 12 + "lint:js": "eslint --ext \".ts,.vue\" . --fix",
13 "lint:prettier": "prettier --write .", 13 "lint:prettier": "prettier --write .",
14 "lint": "npm run lint:js && npm run lint:prettier", 14 "lint": "npm run lint:js && npm run lint:prettier",
15 "format": "prettier --write \"{components,pages,plugins,middleware,layouts,composables,assets}/**/*.{js,jsx,ts,tsx,vue,html,css,scss,json,md}\"", 15 "format": "prettier --write \"{components,pages,plugins,middleware,layouts,composables,assets}/**/*.{js,jsx,ts,tsx,vue,html,css,scss,json,md}\"",
@@ -173,7 +173,9 @@ onMounted(() => { @@ -173,7 +173,9 @@ onMounted(() => {
173 173
174 <!-- Informations du film --> 174 <!-- Informations du film -->
175 <section class="w-full md:w-2/3 lg:w-3/4"> 175 <section class="w-full md:w-2/3 lg:w-3/4">
176 - <h1 class="text-3xl md:text-4xl font-bold mb-2">{{ movie.title }}</h1> 176 + <h1 class="text-3xl md:text-4xl font-bold mb-2">
  177 + {{ movie.title }}
  178 + </h1>
177 <p v-if="movie.release_date" class="text-gray-400 mb-4"> 179 <p v-if="movie.release_date" class="text-gray-400 mb-4">
178 {{ useDateFormat(movie.release_date, "DD-MM-YYYY") }} • {{ formatRuntime(movie.runtime) }} 180 {{ useDateFormat(movie.release_date, "DD-MM-YYYY") }} • {{ formatRuntime(movie.runtime) }}
179 </p> 181 </p>
@@ -187,7 +189,9 @@ onMounted(() => { @@ -187,7 +189,9 @@ onMounted(() => {
187 <!-- Synopsis --> 189 <!-- Synopsis -->
188 <div class="mb-6"> 190 <div class="mb-6">
189 <h2 class="text-xl font-bold mb-2">Synopsis</h2> 191 <h2 class="text-xl font-bold mb-2">Synopsis</h2>
190 - <p class="text-gray-300">{{ movie.overview || "Aucun synopsis disponible." }}</p> 192 + <p class="text-gray-300">
  193 + {{ movie.overview || "Aucun synopsis disponible." }}
  194 + </p>
191 </div> 195 </div>
192 196
193 <!-- Réalisateur et têtes d'affiche --> 197 <!-- Réalisateur et têtes d'affiche -->
1 export type Comment = { 1 export type Comment = {
2 - username: string 2 + username: string;
3 - message: string 3 + message: string;
4 - rating: number 4 + rating: number;
5 -} 5 +};
1 // vite.config.js 1 // vite.config.js
2 -import vue from '@vitejs/plugin-vue' 2 +import vue from "@vitejs/plugin-vue";
3 3
4 export default { 4 export default {
5 plugins: [vue()], 5 plugins: [vue()],
@@ -8,4 +8,4 @@ export default { @@ -8,4 +8,4 @@ export default {
8 environment: "happy-dom", 8 environment: "happy-dom",
9 // Additional test configurations can be added here 9 // Additional test configurations can be added here
10 }, 10 },
11 -} 11 +};
1 -import { defineVitestConfig } from '@nuxt/test-utils/config' 1 +import { defineVitestConfig } from "@nuxt/test-utils/config";
2 -import vue from '@vitejs/plugin-vue' 2 +import { fileURLToPath } from "node:url";
3 -import { fileURLToPath } from 'node:url'  
4 3
5 export default defineVitestConfig({ 4 export default defineVitestConfig({
6 /** 5 /**
@@ -8,31 +7,31 @@ export default defineVitestConfig({ @@ -8,31 +7,31 @@ export default defineVitestConfig({
8 * any custom Vitest config you require 7 * any custom Vitest config you require
9 */ 8 */
10 test: { 9 test: {
11 - environment: 'nuxt', 10 + environment: "nuxt",
12 globals: true, 11 globals: true,
13 // you can optionally set Nuxt-specific environment options 12 // you can optionally set Nuxt-specific environment options
14 environmentOptions: { 13 environmentOptions: {
15 nuxt: { 14 nuxt: {
16 - rootDir: fileURLToPath(new URL('./', import.meta.url)), 15 + rootDir: fileURLToPath(new URL("./", import.meta.url)),
17 - domEnvironment: 'happy-dom', // 'happy-dom' (default) or 'jsdom' 16 + domEnvironment: "happy-dom", // 'happy-dom' (default) or 'jsdom'
18 overrides: { 17 overrides: {
19 // other Nuxt config you want to pass 18 // other Nuxt config you want to pass
20 }, 19 },
21 mock: { 20 mock: {
22 intersectionObserver: true, 21 intersectionObserver: true,
23 indexedDb: true, 22 indexedDb: true,
24 - } 23 + },
25 }, 24 },
26 }, 25 },
27 coverage: { 26 coverage: {
28 - provider: 'v8', 27 + provider: "v8",
29 - reporter: ['text', 'json', 'html'], 28 + reporter: ["text", "json", "html"],
30 - } 29 + },
31 }, 30 },
32 resolve: { 31 resolve: {
33 alias: { 32 alias: {
34 - '~': fileURLToPath(new URL('./', import.meta.url)), 33 + "~": fileURLToPath(new URL("./", import.meta.url)),
35 - '@': fileURLToPath(new URL('./', import.meta.url)), 34 + "@": fileURLToPath(new URL("./", import.meta.url)),
36 - } 35 + },
37 - } 36 + },
38 -}) 37 +});