From 301877e2e11a5865a266b5ff8f851299d6b7f916 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 27 Jul 2023 12:46:05 +0100 Subject: [PATCH] Fix eslint config and apply all fixes. --- .eslintrc.cjs | 7 +++ package.json | 12 ----- src/App.vue | 38 +++++++-------- src/components/ChannelItem.vue | 9 ++-- src/components/ChannelPage.vue | 14 +++--- src/components/ChaptersBar.vue | 61 +++++++++++++------------ src/components/CollapsableText.vue | 12 +++-- src/components/CommentItem.vue | 13 +++--- src/components/ConfirmModal.vue | 9 ++-- src/components/ContentItem.vue | 5 +- src/components/ErrorHandler.vue | 2 +- src/components/FeedPage.vue | 4 +- src/components/FooterComponent.vue | 10 ++-- src/components/HistoryPage.vue | 32 ++++++------- src/components/LoadingIndicatorPage.vue | 22 ++++----- src/components/LoginPage.vue | 6 +-- src/components/ModalComponent.vue | 1 + src/components/NavBar.vue | 18 ++++---- src/components/PageNotFound.vue | 4 +- src/components/PlaylistAddModal.vue | 13 +++--- src/components/PlaylistItem.vue | 9 ++-- src/components/PlaylistPage.vue | 12 ++--- src/components/PlaylistVideos.vue | 25 +++++----- src/components/PlaylistsPage.vue | 27 +++++------ src/components/PreferencesPage.vue | 42 ++++++++--------- src/components/RegisterPage.vue | 10 ++-- src/components/SearchResults.vue | 2 +- src/components/ShareModal.vue | 52 +++++++++++---------- src/components/SortingSelector.vue | 9 ++-- src/components/SubscriptionsPage.vue | 32 ++++++------- src/components/ToastComponent.vue | 3 +- src/components/VideoItem.vue | 39 ++++++++-------- src/components/VideoPlayer.vue | 8 ++-- src/components/WatchOnButton.vue | 7 ++- src/components/WatchVideo.vue | 24 +++++----- 35 files changed, 308 insertions(+), 285 deletions(-) create mode 100644 .eslintrc.cjs diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 00000000..1e1946eb --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,7 @@ +module.exports = { + root: true, + env: { + node: true, + }, + extends: ["plugin:vue/vue3-recommended", "eslint:recommended", "plugin:prettier/recommended"], +}; diff --git a/package.json b/package.json index 3e807eab..79008309 100644 --- a/package.json +++ b/package.json @@ -51,18 +51,6 @@ "vite-plugin-pwa": "0.16.4", "workbox-window": "7.0.0" }, - "eslintConfig": { - "root": true, - "env": { - "node": true - }, - "extends": [ - "plugin:vue/vue3-essential", - "plugin:prettier/recommended", - "eslint:recommended" - ], - "rules": {} - }, "browserslist": [ "last 1 chrome version", "last 1 firefox version" diff --git a/src/App.vue b/src/App.vue index 21938271..27225d46 100644 --- a/src/App.vue +++ b/src/App.vue @@ -29,25 +29,6 @@ export default { theme: "dark", }; }, - methods: { - setTheme() { - let themePref = this.getPreferenceString("theme", "dark"); - if (themePref == "auto") this.theme = darkModePreference.matches ? "dark" : "light"; - else this.theme = themePref; - - // Change title bar color based on user's theme - const themeColor = document.querySelector("meta[name='theme-color']"); - if (this.theme === "light") { - themeColor.setAttribute("content", "#FFF"); - } else { - themeColor.setAttribute("content", "#0F0F0F"); - } - - // Used for the scrollbar - const root = document.querySelector(":root"); - this.theme == "dark" ? root.classList.add("dark") : root.classList.remove("dark"); - }, - }, mounted() { this.setTheme(); darkModePreference.addEventListener("change", () => { @@ -112,6 +93,25 @@ export default { } })(); }, + methods: { + setTheme() { + let themePref = this.getPreferenceString("theme", "dark"); + if (themePref == "auto") this.theme = darkModePreference.matches ? "dark" : "light"; + else this.theme = themePref; + + // Change title bar color based on user's theme + const themeColor = document.querySelector("meta[name='theme-color']"); + if (this.theme === "light") { + themeColor.setAttribute("content", "#FFF"); + } else { + themeColor.setAttribute("content", "#0F0F0F"); + } + + // Used for the scrollbar + const root = document.querySelector(":root"); + this.theme == "dark" ? root.classList.add("dark") : root.classList.remove("dark"); + }, + }, }; diff --git a/src/components/ChannelItem.vue b/src/components/ChannelItem.vue index d9809240..269add07 100644 --- a/src/components/ChannelItem.vue +++ b/src/components/ChannelItem.vue @@ -6,14 +6,14 @@

- +

- +

@@ -29,6 +29,9 @@ diff --git a/src/components/ChannelPage.vue b/src/components/ChannelPage.vue index 6eaed839..371e32e6 100644 --- a/src/components/ChannelPage.vue +++ b/src/components/ChannelPage.vue @@ -12,27 +12,27 @@
-

- +

+

- +
diff --git a/src/components/ChaptersBar.vue b/src/components/ChaptersBar.vue index 7d873de1..24cf0697 100644 --- a/src/components/ChaptersBar.vue +++ b/src/components/ChaptersBar.vue @@ -5,11 +5,11 @@ {{ $t("video.chapters") }} ({{ chapters.length }})
@@ -31,11 +31,11 @@ {{ $t("video.chapters") }} ({{ chapters.length }})
@@ -50,11 +50,11 @@
@@ -65,6 +65,32 @@
+ + - - diff --git a/src/components/CollapsableText.vue b/src/components/CollapsableText.vue index d3d3e9e3..3095b8b2 100644 --- a/src/components/CollapsableText.vue +++ b/src/components/CollapsableText.vue @@ -1,7 +1,8 @@ -