From f6119eb0cdac4daa248d30528bf4ed992a0b5c46 Mon Sep 17 00:00:00 2001 From: SolitudeRA Date: Sat, 17 Jan 2026 00:40:34 +0900 Subject: [PATCH 1/2] chore: tidy up code --- .gitignore | 83 ++++++++++++++++++++++++++++++++--------------- .husky/pre-commit | 7 ++-- .prettierignore | 56 ++++++++++++++++++++++++-------- package.json | 5 ++- 4 files changed, 108 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index 6b3cf2a..8dddc2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,51 +1,82 @@ -# build output +# ============================================================ +# 构建输出 +# ============================================================ dist/ +build/ +output/ -# generated types +# ============================================================ +# 框架生成文件 +# ============================================================ +# Astro .astro/ -# dependencies +# ============================================================ +# 依赖 +# ============================================================ node_modules/ -# logs -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* +# ============================================================ +# 缓存 +# ============================================================ +.cache/ +.turbo/ +*.tsbuildinfo +.eslintcache -# environment variables +# ============================================================ +# 环境变量 +# ============================================================ .env .env.production .env.local .env.*.local -# macOS-specific files -.DS_Store - -# jetbrains setting folder -.idea/ - # ============================================================ -# 以下配置用于减少 Cline AI 助手的上下文开销 +# 日志 # ============================================================ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +*.log -# 测试覆盖率报告 +# ============================================================ +# 测试 +# ============================================================ coverage/ .nyc_output/ - -# Vitest UI 临时文件 .vitest/ -# TypeScript 构建缓存 -*.tsbuildinfo +# ============================================================ +# 编辑器 & IDE +# ============================================================ +# VS Code (保留推荐配置) +.vscode/* +!.vscode/extensions.json +!.vscode/launch.json +!.vscode/settings.json -# Cline 本地配置 (个人偏好) -.clinerules.local +# JetBrains +.idea/ -# 编辑器临时文件 +# Vim *.swp *.swo *~ -# 锁文件 (体积大,通常不需要 AI 阅读) -# 注意: pnpm-lock.yaml 应该提交到 git,但 Cline 通常不需要读取 +# ============================================================ +# 操作系统 +# ============================================================ +# macOS +.DS_Store + +# Windows +Thumbs.db +Desktop.ini + +# ============================================================ +# Cline +# ============================================================ +# Cline 本地配置 (个人偏好) +.clinerules.local diff --git a/.husky/pre-commit b/.husky/pre-commit index a12d718..c0a29fa 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,5 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" +# TypeScript 类型检查 +pnpm astro check -pnpm format:staged \ No newline at end of file +# 格式化暂存文件 +pnpm format:staged diff --git a/.prettierignore b/.prettierignore index 6ba5f04..4ac0eb5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,23 +1,53 @@ -# deps -node_modules - -# build outputs +# ============================================================ +# 构建输出 +# ============================================================ dist -.astro -.vercel -.netlify -output build +output + +# ============================================================ +# 框架生成文件 +# ============================================================ +.astro -# caches +# ============================================================ +# 依赖 & 锁文件 +# ============================================================ +node_modules +pnpm-lock.yaml +package-lock.json +yarn.lock + +# ============================================================ +# 缓存 +# ============================================================ .cache .turbo .tmp temp coverage -# lockfiles -pnpm-lock.yaml +# ============================================================ +# 静态资源 (无需格式化) +# ============================================================ +public +docs/assets + +# ============================================================ +# 自动生成的文件 +# ============================================================ +*.d.ts +src/env.d.ts +*.min.js +*.min.css + +# ============================================================ +# 版本控制 +# ============================================================ +.git -# misc -.DS_Store \ No newline at end of file +# ============================================================ +# 操作系统 +# ============================================================ +.DS_Store +Thumbs.db diff --git a/package.json b/package.json index b22ebd8..b0f6963 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,10 @@ "test:all": "vitest run" }, "lint-staged": { - "*.{js,jsx,ts,tsx,astro,json,md,yml,yaml,css,scss}": [ + "*.{astro,tsx,ts,jsx,js}": [ + "prettier --write" + ], + "*.{json,md,yml,yaml,css,scss,html}": [ "prettier --write" ] }, From 0fecd62400dc7660467ee8af926645927a00be9c Mon Sep 17 00:00:00 2001 From: SolitudeRA Date: Sat, 17 Jan 2026 00:41:01 +0900 Subject: [PATCH 2/2] chore: tidy up code --- .husky/pre-commit | 3 --- 1 file changed, 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index c0a29fa..f7835a1 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,2 @@ -# TypeScript 类型检查 -pnpm astro check - # 格式化暂存文件 pnpm format:staged