From 938c497ca3983d9a10d2ad46905db58ae53862bd Mon Sep 17 00:00:00 2001 From: chengww Date: Sun, 17 May 2026 23:54:28 +0800 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20=E4=BF=AE=E5=A4=8D=20main=20?= =?UTF-8?q?=E4=B8=8A=E7=9A=84=E5=AD=98=E9=87=8F=20lint=20=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pr-check.yml 只在 PR 触发,main push 不跑 lint,导致存量错误一直未被发现, PR #675 / #676 都被 Code Quality job 拦下。 - 9 处 prettier/prettier 格式错误:StickyTabPage.vue / RadioCard.vue / list/index.vue / mv/index.vue / podcast/index.vue 的属性换行与 import 排序,全部 eslint --fix 自动修复 - 1 处 no-undef ScrollToOptions(StickyTabPage.vue:79):在 eslint.config.mjs 的 .ts 与 .vue 配置块同时补 ScrollToOptions 到 globals,与既有的 ScrollBehavior 同级;TypeScript DOM lib 类型不在 globals.browser 里, 需手动声明 --- eslint.config.mjs | 6 +++-- .../components/common/StickyTabPage.vue | 4 +++- src/renderer/components/podcast/RadioCard.vue | 6 +---- src/renderer/views/list/index.vue | 2 +- src/renderer/views/mv/index.vue | 4 +--- src/renderer/views/podcast/index.vue | 22 ++++++++++++++----- 6 files changed, 27 insertions(+), 17 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 52d7192..3ac5407 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -55,7 +55,8 @@ export default [ defineEmits: 'readonly', // TypeScript 全局类型 NodeJS: 'readonly', - ScrollBehavior: 'readonly' + ScrollBehavior: 'readonly', + ScrollToOptions: 'readonly' } }, plugins: { @@ -148,7 +149,8 @@ export default [ useMessage: 'readonly', // TypeScript 全局类型 NodeJS: 'readonly', - ScrollBehavior: 'readonly' + ScrollBehavior: 'readonly', + ScrollToOptions: 'readonly' } }, plugins: { diff --git a/src/renderer/components/common/StickyTabPage.vue b/src/renderer/components/common/StickyTabPage.vue index a4e3345..a5275f1 100644 --- a/src/renderer/components/common/StickyTabPage.vue +++ b/src/renderer/components/common/StickyTabPage.vue @@ -4,7 +4,9 @@
-

+

{{ title }}

diff --git a/src/renderer/components/podcast/RadioCard.vue b/src/renderer/components/podcast/RadioCard.vue index 4fc5956..25f52e0 100644 --- a/src/renderer/components/podcast/RadioCard.vue +++ b/src/renderer/components/podcast/RadioCard.vue @@ -23,11 +23,7 @@ const goToDetail = () => {

-
+

{{ t('podcast.noCategoryRadios') }}

@@ -134,7 +143,10 @@ {{ t('common.loading') }}
-
+
{{ t('common.noMore') }}
From 95694057ecef593fa96170e97f5de50ee9272282 Mon Sep 17 00:00:00 2001 From: chengww Date: Mon, 18 May 2026 00:01:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?ci:=20typecheck=20=E5=89=8D=E5=85=88?= =?UTF-8?q?=E8=B7=91=20build=20=E8=AE=A9=20unplugin=20=E7=94=9F=E6=88=90?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=20import=20d.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tsconfig.web.json 的 compilerOptions.types 显式 require src/renderer/{auto-imports,components}.d.ts,这两个文件由 unplugin-auto-import / unplugin-vue-components 在 vite 启动时生成, 且被 .gitignore 排除(58922dc 维护者主动设置)。 CI 直接跑 typecheck 拿不到 d.ts 会报 TS2688,导致所有 PR 都过不了 Code Quality job。在 Type check 步骤前插入一次 npm run build 触发 unplugin 生成 d.ts,同时顺带验证 build 链路(一次到位,不增加额外 专用脚本,CI 多 30-60s 但能拦下 build 阶段的回归)。 本地验证:删除两个 d.ts 后跑 npm run build 重新生成,typecheck 通过。 --- .github/workflows/pr-check.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index a60f0f5..cc82c98 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -64,6 +64,13 @@ jobs: - name: Lint run: npx eslint --max-warnings 0 "src/**/*.{ts,tsx,vue,js}" + # tsconfig.web.json 显式 require src/renderer/{auto-imports,components}.d.ts + # 这两个文件由 unplugin-auto-import / unplugin-vue-components 在 vite 启动时 + # 生成,且被 .gitignore 排除(58922dc 维护者主动设置)。CI 直接跑 typecheck + # 拿不到 d.ts 会报 TS2688,先跑一次 build 触发 unplugin 生成 + - name: Build (generates auto-import / components d.ts) + run: npm run build + - name: Type check run: npm run typecheck From 1a8b5f4977e89641527e4def1ea66b37eb5fefaf Mon Sep 17 00:00:00 2001 From: chengww Date: Mon, 18 May 2026 00:07:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?ci:=20=E5=8A=A0=20setup-bun=20=E8=AE=A9=20l?= =?UTF-8?q?int:i18n=20=E6=AD=A5=E9=AA=A4=E8=83=BD=E8=B7=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit package.json 里 lint:i18n = "bun scripts/check_i18n.ts",但 pr-check.yml 只装了 Node 没装 bun,I18n check 步骤报 sh: bun: not found。 之前这个错误被前两步(lint / typecheck)的失败遮住,前两步修了之后才暴露。 用官方 oven-sh/setup-bun 一步搞定,放在 setup-node 之后、install 之前。 --- .github/workflows/pr-check.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index cc82c98..af15af6 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -58,6 +58,11 @@ jobs: with: node-version: 24 + # lint:i18n 脚本用 bun 跑(package.json: "bun scripts/check_i18n.ts"), + # CI 默认环境没有 bun 会报 sh: bun: not found + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + - name: Install dependencies run: npm install