From fab2b7ae3b28b91546aa58826c54f1f811862507 Mon Sep 17 00:00:00 2001 From: BeardedBear Date: Thu, 8 Jan 2026 21:24:14 +0100 Subject: [PATCH 1/5] Tidy Vue templates and linting config Add eslint-plugin-vue; wrap console.error calls with DEV checks. Fix template formatting and attribute ordering (v-if/v-for/key placement, self-closing tags), and adjust some prop/type defaults to satisfy lint rules and prevent runtime issues. --- .github/copilot-instructions.md | 2 +- eslint.config.js | 30 ++++++- src/App.vue | 8 +- src/components/album/AlbumFoot.vue | 4 +- src/components/album/AlbumGallery.vue | 6 +- src/components/album/AlbumGroup.vue | 2 +- src/components/album/AlbumHead.vue | 12 +-- src/components/album/AlbumIndex.vue | 64 +++++++------- src/components/album/AlbumLink.vue | 4 +- src/components/artist/ArtistHeader.vue | 12 +-- src/components/artist/ArtistInfo.vue | 30 ++++--- src/components/artist/ArtistLinks.vue | 12 +-- src/components/artist/ArtistList.vue | 6 +- src/components/artist/ArtistNavigation.vue | 68 +++++++-------- src/components/artist/ArtistOptions.vue | 10 +-- src/components/artist/ArtistProfile.vue | 2 +- src/components/artist/ArtistSidebar.vue | 14 +-- src/components/artist/ArtistTabs.vue | 2 +- src/components/artist/BlockAlbums.vue | 6 +- src/components/artist/BlockAlbumsLive.vue | 6 +- src/components/artist/BlockEps.vue | 6 +- src/components/artist/BlockSingles.vue | 8 +- src/components/artist/RelatedArtists.vue | 2 +- src/components/artist/SingleTrack.vue | 10 ++- src/components/artist/TopTracks.vue | 18 ++-- src/components/config/ColorsTheme.vue | 4 +- src/components/config/ConfigIndex.vue | 8 +- src/components/dialog/AddAlbum.vue | 8 +- src/components/dialog/AddCollection.vue | 2 +- src/components/dialog/AddPlaylist.vue | 2 +- src/components/dialog/AddSong.vue | 11 +-- src/components/dialog/AlbumVariants.vue | 2 +- src/components/dialog/DialogWrap.vue | 32 +++---- src/components/dialog/EditPlaylist.vue | 34 +++++--- .../dialog/PlaylistOptionsDialog.vue | 6 +- src/components/dialog/PreContentTrack.vue | 8 +- src/components/dialog/SearchDialog.vue | 2 +- src/components/frame/FrameIndex.vue | 28 +++--- src/components/minimized/MinimizedWindows.vue | 4 +- .../notification/NotificationIndex.vue | 6 +- src/components/player/PlayerControls.vue | 14 +-- src/components/player/PlayerEpisode.vue | 2 +- src/components/player/PlayerIndex.vue | 8 +- src/components/player/PlayerMetas.vue | 8 +- src/components/player/PlayerSlideUp.vue | 17 ++-- src/components/player/PlayerSong.vue | 14 ++- src/components/player/SeekBar.vue | 8 +- src/components/player/device/DeviceIndex.vue | 10 ++- src/components/player/device/DeviceList.vue | 29 ++++--- src/components/player/device/DeviceType.vue | 3 +- src/components/player/device/DeviceVolume.vue | 86 ++++++++++--------- src/components/player/device/QueuedTracks.vue | 14 +-- .../player/history/TrackHistory.vue | 4 +- src/components/playlist/PlaylistActions.vue | 16 ++-- src/components/playlist/PlaylistHeader.vue | 6 +- src/components/playlist/PlaylistTracks.vue | 33 +++---- src/components/podcast/PodcastCard.vue | 4 +- src/components/podcast/PodcastEpisode.vue | 22 ++--- .../podcast/PodcastFollowButton.vue | 4 +- src/components/releases/ReleaseIndex.vue | 10 +-- src/components/releases/ReleaseList.vue | 12 +-- src/components/releases/ReleaseSide.vue | 12 +-- src/components/search/SearchAlbums.vue | 6 +- src/components/search/SearchArtists.vue | 6 +- src/components/search/SearchInput.vue | 8 +- src/components/search/SearchPodcasts.vue | 12 ++- src/components/search/SearchSongs.vue | 8 +- src/components/sidebar/MainMenu.vue | 4 +- src/components/sidebar/PlaylistIcon.vue | 10 +-- src/components/sidebar/SidebarHead.vue | 12 +-- src/components/sidebar/SidebarIndex.vue | 52 +++++------ src/components/sidebar/SidebarStore.ts | 7 +- src/components/sidebar/VisibilityIcon.vue | 4 +- src/components/ui/AlbumCover.vue | 8 +- src/components/ui/ButtonIndex.vue | 13 +-- src/components/ui/CustomSelect.vue | 14 +-- src/components/ui/LanguageSelect.vue | 14 +-- src/components/ui/LoadingDots.vue | 2 +- src/components/ui/PageFit.vue | 4 +- src/components/ui/PageScroller.vue | 6 +- src/components/ui/ShareContent.vue | 14 +-- src/components/ui/Tooltip.vue | 54 ++++++------ src/views/LoginPage.vue | 2 +- src/views/album/AlbumPage.vue | 18 ++-- src/views/artist/ArtistPage.vue | 10 ++- src/views/home/HomePage.vue | 6 +- src/views/playlist/CollectionPage.vue | 12 +-- src/views/playlist/PlaylistPage.vue | 18 ++-- src/views/playlist/PlaylistStore.ts | 3 +- src/views/podcasts/PodcastListPage.vue | 18 ++-- src/views/podcasts/PodcastPage.vue | 14 +-- src/views/podcasts/PodcastsStore.ts | 21 ++--- src/views/releases/ReleaseListPage.vue | 16 ++-- src/views/user/UserPage.vue | 14 +-- 94 files changed, 695 insertions(+), 552 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 0659c7bb..9aa0aae9 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -39,7 +39,7 @@ async followPodcast(podcastId: string) { this.isFollowing = true; notification({ msg: "Success message", type: NotificationType.Success }); } catch (error) { - console.error("Error description:", error); + if (import.meta.env.DEV) console.error("Error description:", error); notification({ msg: "Error message", type: NotificationType.Error }); } } diff --git a/eslint.config.js b/eslint.config.js index 97fa7bbc..284cb6fe 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -3,6 +3,7 @@ import tseslint from "@typescript-eslint/eslint-plugin"; import tsParser from "@typescript-eslint/parser"; import perfectionist from "eslint-plugin-perfectionist"; import eslintPluginPrettier from "eslint-plugin-prettier"; +import pluginVue from "eslint-plugin-vue"; import globals from "globals"; export default [ @@ -12,6 +13,8 @@ export default [ }, // Configuration de base ESLint eslint.configs.recommended, + // Configuration recommandée pour Vue 3 + ...pluginVue.configs["flat/recommended"], // Configuration globale { @@ -52,12 +55,26 @@ export default [ }, }, - // Configuration pour les fichiers Vue - Ignorons les erreurs d'analyse pour l'instant + // Configuration pour les fichiers Vue (TypeScript) { files: ["**/*.vue"], - ignores: ["**/*.vue"], + languageOptions: { + parserOptions: { + ecmaVersion: "latest", + parser: tsParser, + sourceType: "module", + }, + }, + plugins: { + "@typescript-eslint": tseslint, + }, rules: { - // Désactiver temporairement l'analyse des fichiers Vue + "@typescript-eslint/no-unused-vars": "warn", + "vue/html-indent": "off", + "vue/html-self-closing": "off", + "vue/max-attributes-per-line": "off", + "vue/multi-word-component-names": "off", + "vue/singleline-html-element-content-newline": "off", }, }, @@ -85,7 +102,12 @@ export default [ { rules: { "linebreak-style": ["error", "unix"], // Force l'utilisation de LF (unix) au lieu de CRLF (windows) - "no-console": "warn", + "no-console": [ + "warn", + { + allow: ["warn", "error"], + }, + ], "no-debugger": "warn", }, }, diff --git a/src/App.vue b/src/App.vue index ca5a9366..34c96587 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,12 +1,16 @@