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 @@
-
-