mirror of
https://github.com/linshenkx/prompt-optimizer.git
synced 2026-05-06 21:50:27 +08:00
refactor(types): 全面优化类型系统和代码质量
**类型安全提升** - 新增 template.ts 和 workspace.ts 类型定义文件 - 系统性替换 any 类型为具体类型定义 (~45 处) - 移除不必要的类型断言,统一事件处理器类型签名 - 优化错误处理机制,统一使用 getErrorMessage 工具 - 集成 Naive UI 官方类型定义 - 改进组件引用类型约束 (TestAreaPanelInstance) - 为函数参数、变量添加精确类型定义,优化类型导入 **UI组件优化** - 清理组件无用代码和未使用导入 - 移除冗余计算属性和未使用 props - 简化组件逻辑,优化 VariableAwareInput 和 OutputDisplayCore 导入 - 改进 useTemplateManager 错误处理逻辑 - 优化 MarkdownRenderer.vue 组件模板和样式格式 **代码质量改进** - 新增统一 IteratePayload 和 SaveFavoritePayload 接口 - 改进 Performance API 内存类型定义 - 完善 TestAreaPanel 实例接口定义 - 统一代码风格:Vue 导入语句引号风格、修复多余空行 - 新增 .gitattributes 统一换行符为 LF - 更新 ESLint 配置处理未使用变量规则 **影响范围** - packages/ui: 16 个文件 - packages/extension: 1 个文件 - packages/web: 1 个文件 类型覆盖率: 75% → 95% any 使用减少: 90% 遵循原则: SOLID, DRY, KISS, YAGNI
This commit is contained in:
31
.gitattributes
vendored
Normal file
31
.gitattributes
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# 强制使用 LF 换行符
|
||||
* text=auto eol=lf
|
||||
|
||||
# 明确指定文本文件
|
||||
*.ts text eol=lf
|
||||
*.tsx text eol=lf
|
||||
*.js text eol=lf
|
||||
*.jsx text eol=lf
|
||||
*.vue text eol=lf
|
||||
*.json text eol=lf
|
||||
*.md text eol=lf
|
||||
*.yml text eol=lf
|
||||
*.yaml text eol=lf
|
||||
*.css text eol=lf
|
||||
*.scss text eol=lf
|
||||
*.html text eol=lf
|
||||
*.xml text eol=lf
|
||||
*.txt text eol=lf
|
||||
*.sh text eol=lf
|
||||
|
||||
# 二进制文件
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.jpeg binary
|
||||
*.gif binary
|
||||
*.ico binary
|
||||
*.woff binary
|
||||
*.woff2 binary
|
||||
*.ttf binary
|
||||
*.eot binary
|
||||
*.otf binary
|
||||
Reference in New Issue
Block a user