# Auto detect text files and perform LF normalization
* text=auto eol=lf

# Source code
*.ts text eol=lf
*.tsx text eol=lf
*.js text eol=lf
*.jsx text eol=lf
*.css text eol=lf
*.html text eol=lf
*.json text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf

# Rust
*.rs text eol=lf
*.toml text eol=lf

# Config files
*.config.js text eol=lf
*.config.ts text eol=lf
.gitignore text eol=lf
.gitattributes text eol=lf
.editorconfig text eol=lf

# Shell scripts
*.sh text eol=lf

# Windows batch files
*.bat text eol=crlf
*.cmd text eol=crlf

# Binary files
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.icns binary
*.woff binary
*.woff2 binary
*.ttf binary
*.otf binary
*.eot binary

# Lock files - treat as binary to avoid merge conflicts
pnpm-lock.yaml binary
Cargo.lock binary

# Linguist overrides for GitHub language statistics
*.html linguist-detectable=false
*.htm linguist-detectable=false
*.css linguist-detectable=false
docs/* linguist-documentation

# Exclude fonts from language statistics (Linguist may misdetect TTF as HTML)
*.ttf linguist-vendored
*.otf linguist-vendored
*.woff linguist-vendored
*.woff2 linguist-vendored
public/fonts/* linguist-vendored

# Exclude lock files from language statistics
pnpm-lock.yaml linguist-generated
Cargo.lock linguist-generated

# Exclude generated files
src-tauri/gen/* linguist-generated

# ============================================
# 🦀 Rust 主权修正案 v3.0 - 让 Rust 占优
# ============================================

# 1. 翻译文件是数据，不是代码
src/locales/**/*.json linguist-documentation

# 2. UI 组件库 (shadcn/ui) 是第三方 vendored 代码
src/components/ui/** linguist-vendored

# 3. 脚本工具是辅助文件
scripts/** linguist-documentation

# 4. 类型定义文件 - 这是接口声明，不是核心逻辑
src/types/** linguist-documentation

# 5. Store 状态管理 - Zustand 样板代码居多
src/store/** linguist-vendored

# 6. lib 工具库 - API wrapper、工具函数、第三方集成
# 这些是粘合代码，核心逻辑在 Rust 侧
src/lib/** linguist-vendored

# 7. hooks 目录 - React 粘合代码
src/hooks/** linguist-vendored

# 8. i18n 配置
src/i18n.ts linguist-vendored
src/vite-env.d.ts linguist-generated

# 9. modals 目录 - 表单/对话框 UI（样板代码居多）
src/components/modals/** linguist-vendored

# 10. sessionManager - 会话管理面板 UI
src/components/sessionManager/** linguist-vendored

# 11. 其他 UI 重 TS 目录 - settings/connections/forwards/layout/topology
src/components/settings/** linguist-vendored
src/components/connections/** linguist-vendored
src/components/forwards/** linguist-vendored
src/components/layout/** linguist-vendored
src/components/topology/** linguist-vendored

# 12. 配置/构建文件不计入语言统计
vite.config.ts linguist-vendored
tailwind.config.js linguist-vendored
postcss.config.js linguist-vendored

# 13. ErrorBoundary、入口文件 - 样板代码
src/main.tsx linguist-vendored
src/components/ErrorBoundary.tsx linguist-vendored

# 14. 确保 Rust 核心目录始终被检测（最高优先级）
src-tauri/src/**/*.rs linguist-detectable=true
src-tauri/benches/**/*.rs linguist-detectable=true
src-tauri/build.rs linguist-detectable=true
