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/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml new file mode 100644 index 00000000..e10c0ea3 --- /dev/null +++ b/.github/workflows/reviewdog.yml @@ -0,0 +1,25 @@ +name: reviewdog +on: [pull_request] +jobs: + eslint: + name: runner / eslint + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/checkout@v3 + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: latest + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + cache: "pnpm" + - run: pnpm install + - uses: reviewdog/action-eslint@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-pr-review + eslint_flags: "--ignore-path .gitignore --ext .js,.vue ." 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 @@ -